@ttt-productions/ttt-core 0.78.13 → 0.78.15

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 (174) hide show
  1. package/dist/capabilities/capability-registry.js.map +1 -1
  2. package/dist/capabilities/index.js.map +1 -1
  3. package/dist/capabilities/messaging-surfaces.js.map +1 -1
  4. package/dist/constants/admin-labels.js.map +1 -1
  5. package/dist/constants/app-mode.js.map +1 -1
  6. package/dist/constants/business-admin.js.map +1 -1
  7. package/dist/constants/business-content.js.map +1 -1
  8. package/dist/constants/business-platform.js.map +1 -1
  9. package/dist/constants/business-user.js.map +1 -1
  10. package/dist/constants/business-work-project.js.map +1 -1
  11. package/dist/constants/business.js.map +1 -1
  12. package/dist/constants/chat.js.map +1 -1
  13. package/dist/constants/craft-skill-statements.js.map +1 -1
  14. package/dist/constants/index.d.ts +1 -0
  15. package/dist/constants/index.d.ts.map +1 -1
  16. package/dist/constants/index.js +1 -0
  17. package/dist/constants/index.js.map +1 -1
  18. package/dist/constants/moderation.js.map +1 -1
  19. package/dist/constants/options.js.map +1 -1
  20. package/dist/constants/pagination.js.map +1 -1
  21. package/dist/constants/publish-attestations.js.map +1 -1
  22. package/dist/constants/release-flags.js.map +1 -1
  23. package/dist/constants/retention.js.map +1 -1
  24. package/dist/constants/safety-confirmation-phrases.d.ts +19 -0
  25. package/dist/constants/safety-confirmation-phrases.d.ts.map +1 -0
  26. package/dist/constants/safety-confirmation-phrases.js +33 -0
  27. package/dist/constants/safety-confirmation-phrases.js.map +1 -0
  28. package/dist/constants/safety-telemetry-patterns.js.map +1 -1
  29. package/dist/constants/scheduled-jobs.js.map +1 -1
  30. package/dist/constants/storage-keys.js.map +1 -1
  31. package/dist/doc-schemas/account-deletion.js.map +1 -1
  32. package/dist/doc-schemas/audit.js.map +1 -1
  33. package/dist/doc-schemas/chat-sync.js.map +1 -1
  34. package/dist/doc-schemas/commissions.js.map +1 -1
  35. package/dist/doc-schemas/content.js.map +1 -1
  36. package/dist/doc-schemas/firestore-primitives.js.map +1 -1
  37. package/dist/doc-schemas/index.js.map +1 -1
  38. package/dist/doc-schemas/media-activation-jobs.js.map +1 -1
  39. package/dist/doc-schemas/media-assets.js.map +1 -1
  40. package/dist/doc-schemas/messaging.js.map +1 -1
  41. package/dist/doc-schemas/moderation.js.map +1 -1
  42. package/dist/doc-schemas/ncii/allegations.js.map +1 -1
  43. package/dist/doc-schemas/ncii/cases.js.map +1 -1
  44. package/dist/doc-schemas/ncii/config.js.map +1 -1
  45. package/dist/doc-schemas/ncii/holds.js.map +1 -1
  46. package/dist/doc-schemas/ncii/removal.js.map +1 -1
  47. package/dist/doc-schemas/ncii/requests.js.map +1 -1
  48. package/dist/doc-schemas/notification-ledger.js.map +1 -1
  49. package/dist/doc-schemas/notifications.js.map +1 -1
  50. package/dist/doc-schemas/operational.js.map +1 -1
  51. package/dist/doc-schemas/payments.js.map +1 -1
  52. package/dist/doc-schemas/publicUser.js.map +1 -1
  53. package/dist/doc-schemas/registry.js.map +1 -1
  54. package/dist/doc-schemas/report-docs.js.map +1 -1
  55. package/dist/doc-schemas/safety/age.js.map +1 -1
  56. package/dist/doc-schemas/safety/case-alert.js.map +1 -1
  57. package/dist/doc-schemas/safety/case-aliases.js.map +1 -1
  58. package/dist/doc-schemas/safety/case.d.ts.map +1 -1
  59. package/dist/doc-schemas/safety/case.js +2 -1
  60. package/dist/doc-schemas/safety/case.js.map +1 -1
  61. package/dist/doc-schemas/safety/evidence.js.map +1 -1
  62. package/dist/doc-schemas/safety/foundation.js.map +1 -1
  63. package/dist/doc-schemas/safety/holds.js.map +1 -1
  64. package/dist/doc-schemas/safety/monitors.js.map +1 -1
  65. package/dist/doc-schemas/safety/provenance.js.map +1 -1
  66. package/dist/doc-schemas/safety/report.js.map +1 -1
  67. package/dist/doc-schemas/safety/reviewer-security.js.map +1 -1
  68. package/dist/doc-schemas/safety/sagas.js.map +1 -1
  69. package/dist/doc-schemas/social.js.map +1 -1
  70. package/dist/doc-schemas/square-announcement-jobs.js.map +1 -1
  71. package/dist/doc-schemas/system.js.map +1 -1
  72. package/dist/doc-schemas/user.js.map +1 -1
  73. package/dist/doc-schemas/work-project.js.map +1 -1
  74. package/dist/ids/chat-ids.js.map +1 -1
  75. package/dist/ids/index.js.map +1 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/media/atoms.js.map +1 -1
  78. package/dist/media/domain-events-admin.js.map +1 -1
  79. package/dist/media/domain-events-social.js.map +1 -1
  80. package/dist/media/domain-events-user.js.map +1 -1
  81. package/dist/media/domain-events-work.js.map +1 -1
  82. package/dist/media/domain-events.js.map +1 -1
  83. package/dist/media/edge-serving-contract.js.map +1 -1
  84. package/dist/media/file-origin.js.map +1 -1
  85. package/dist/media/hall-library-target-fields.js.map +1 -1
  86. package/dist/media/index.js.map +1 -1
  87. package/dist/media/media-asset-url.js.map +1 -1
  88. package/dist/media/pending-media.js.map +1 -1
  89. package/dist/media/photodna-coverage.js.map +1 -1
  90. package/dist/media/start-upload.js.map +1 -1
  91. package/dist/media/target-info.js.map +1 -1
  92. package/dist/media/ttt-media-specs.js.map +1 -1
  93. package/dist/media/upload-tray-display.js.map +1 -1
  94. package/dist/notifications/index.js.map +1 -1
  95. package/dist/paths/collection-groups.js.map +1 -1
  96. package/dist/paths/collection-refs.js.map +1 -1
  97. package/dist/paths/collections.js.map +1 -1
  98. package/dist/paths/index.js.map +1 -1
  99. package/dist/paths/path-builders.js.map +1 -1
  100. package/dist/paths/related-ids.js.map +1 -1
  101. package/dist/paths/storage-paths.js.map +1 -1
  102. package/dist/paths/utils.js.map +1 -1
  103. package/dist/permissions/guild-standing-assignment-policy.js.map +1 -1
  104. package/dist/permissions/index.js.map +1 -1
  105. package/dist/permissions/work-project-permissions-data.js.map +1 -1
  106. package/dist/permissions/work-project-permissions.js.map +1 -1
  107. package/dist/report/chat-report-channel-ref.js.map +1 -1
  108. package/dist/report/index.js.map +1 -1
  109. package/dist/report/report-config-values.js.map +1 -1
  110. package/dist/safety/active-safety-case-alert.js.map +1 -1
  111. package/dist/safety/index.js.map +1 -1
  112. package/dist/safety/ncii-intake-derivations.js.map +1 -1
  113. package/dist/safety/resource-keys.js.map +1 -1
  114. package/dist/schemas/admin-dispatch-actions.js.map +1 -1
  115. package/dist/schemas/admin.d.ts.map +1 -1
  116. package/dist/schemas/admin.js +3 -2
  117. package/dist/schemas/admin.js.map +1 -1
  118. package/dist/schemas/atoms.js.map +1 -1
  119. package/dist/schemas/auditions.js.map +1 -1
  120. package/dist/schemas/chat.js.map +1 -1
  121. package/dist/schemas/commissions.js.map +1 -1
  122. package/dist/schemas/craft-skills.js.map +1 -1
  123. package/dist/schemas/hall-library.js.map +1 -1
  124. package/dist/schemas/index.js.map +1 -1
  125. package/dist/schemas/media.js.map +1 -1
  126. package/dist/schemas/ncii.d.ts.map +1 -1
  127. package/dist/schemas/ncii.js +2 -1
  128. package/dist/schemas/ncii.js.map +1 -1
  129. package/dist/schemas/notification.js.map +1 -1
  130. package/dist/schemas/payments.js.map +1 -1
  131. package/dist/schemas/safety.d.ts.map +1 -1
  132. package/dist/schemas/safety.js +6 -5
  133. package/dist/schemas/safety.js.map +1 -1
  134. package/dist/schemas/social.js.map +1 -1
  135. package/dist/schemas/stake-share-operation.js.map +1 -1
  136. package/dist/schemas/uploads.js.map +1 -1
  137. package/dist/schemas/users.js.map +1 -1
  138. package/dist/schemas/utility.js.map +1 -1
  139. package/dist/schemas/voting.js.map +1 -1
  140. package/dist/schemas/work-project-management.js.map +1 -1
  141. package/dist/types/admin-ops.js.map +1 -1
  142. package/dist/types/admin-users.js.map +1 -1
  143. package/dist/types/admin.js.map +1 -1
  144. package/dist/types/audit.js.map +1 -1
  145. package/dist/types/commissions.js.map +1 -1
  146. package/dist/types/content.js.map +1 -1
  147. package/dist/types/index.js.map +1 -1
  148. package/dist/types/messaging.js.map +1 -1
  149. package/dist/types/moderation.js.map +1 -1
  150. package/dist/types/payments.js.map +1 -1
  151. package/dist/types/publicUser.js.map +1 -1
  152. package/dist/types/social.js.map +1 -1
  153. package/dist/types/system.js.map +1 -1
  154. package/dist/types/user.js.map +1 -1
  155. package/dist/types/work-project.js.map +1 -1
  156. package/dist/upload-variables/apply-to-commission-variables.js.map +1 -1
  157. package/dist/upload-variables/create-admin-audition-variables.js.map +1 -1
  158. package/dist/upload-variables/create-audition-entry-variables.js.map +1 -1
  159. package/dist/upload-variables/create-commission-variables.js.map +1 -1
  160. package/dist/upload-variables/create-work-project-audition-variables.js.map +1 -1
  161. package/dist/upload-variables/index.js.map +1 -1
  162. package/dist/upload-variables/on-progress.js.map +1 -1
  163. package/dist/upload-variables/square-streetz-post-variables.js.map +1 -1
  164. package/dist/upload-variables/update-chapter-media-variables.js.map +1 -1
  165. package/dist/upload-variables/update-episode-media-variables.js.map +1 -1
  166. package/dist/upload-variables/update-tale-cover-photo-variables.js.map +1 -1
  167. package/dist/upload-variables/update-television-cover-photo-variables.js.map +1 -1
  168. package/dist/upload-variables/update-track-media-variables.js.map +1 -1
  169. package/dist/upload-variables/update-tune-cover-photo-variables.js.map +1 -1
  170. package/dist/upload-variables/upload-craft-skill-variables.js.map +1 -1
  171. package/dist/upload-variables/upload-profile-picture-variables.js.map +1 -1
  172. package/dist/utils/format.js.map +1 -1
  173. package/dist/utils/index.js.map +1 -1
  174. package/package.json +7 -7
@@ -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;AAC7E,+EAA+E;AAC/E,oEAAoE;AACpE,yDAAyD;AACzD,EAAE;AACF,0EAA0E;AAC1E,oEAAoE;AACpE,gEAAgE;AAChE,EAAE;AACF,sEAAsE;AACtE,2EAA2E;AAC3E,kEAAkE;AAClE,8CAA8C;AAC9C,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AAExE,OAAO,E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A8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,mFAAmF;AACnF,8DAA8D;AAC9D,gFAAgF;AAChF,8EAA8E;AAE9E,mGAAmG;AACnG,4FAA4F;AAC5F,oCAAoC;AACpC,MAAM,uCAAuC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,WAAW,EAAE,uBAAuB;IACpC,qBAAqB,EAAE,iCAAiC;IACxD,iGAAiG;IACjG,mGAAmG;IACnG,wDAAwD;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 +1 @@
1
- {"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/evidence.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,EAAE;AACF,mBAAmB;AAC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,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,uCAAuC;CACtD,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,sDAAsD;AACtD,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;AAGvF,sDAAsD;AACtD,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAGlF;;;;;;;;;kFASkF;AAClF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,8FAA8F;IAC9F,iGAAiG;IACjG,0FAA0F;IAC1F,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,MAAM,EAAE,qCAAqC;IAC7C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,qCAAqC;IAC7C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — the evidence cluster (Appendix A §A4, Finding-H5 / Finding-M2).\n//\n// Two collections:\n// - `safetyEvidenceManifests/{manifestId}` = SafetyEvidenceManifestV1 — an\n// IMMUTABLE, versioned manifest. Finding-H5: a manifest is NO LONGER\n// media-shaped — a `sourceKind` discriminator ('media'|'communication'|\n// 'externalFact') selects WHICH sub-object is present. No manifest may carry\n// a null/placeholder media object.\n// - `safetyEvidenceJobs/{jobId}` = SafetyEvidenceJobV1 — the capture/verify/\n// disposition saga row (Finding-M2: `commandId` + terminal timestamps; the\n// `verified` status is disambiguated as a (phase, status) PAIR, never a bare\n// status) with two subcollections: …/items/{itemId} and\n// …/disposition/{locationId}.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A4 — no invented values, no\n// placeholders.\n//\n// SHARED media lineage comes from ../media-assets.js (the single canonical lineage\n// used by media, CSAM, and safety); it is NEVER redefined here.\n//\n// Collection note: this cluster introduces TWO NEW Firestore collections plus two\n// subcollections under `safetyEvidenceJobs`. Wiring collections.ts /\n// path-builders.ts / registry.ts is deferred to the app leg (the orchestrator binds\n// the schemas + path builders there); the deterministic doc-id shapes are\n// documented on each schema below.\n\nimport { z } from 'zod';\nimport { MediaOriginLineageV1Schema } from '../media-assets.js';\n\n// ===========================================================================\n// §A4 manifest / communication array caps — the ONE named declaration (Rule 36).\n// Every `.max(...)` bound below derives from these; the app's evidence-manifest\n// writer imports the SAME constants for its `bound(...)` checks so the schema and the\n// writer can never drift to two different numbers.\n// ===========================================================================\n\n/** MAX variants[] on a media manifest (§A4). */\nexport const MAX_MANIFEST_VARIANTS = 64;\n/** MAX provenanceRefs[] (eventProvenance ids promoted into the case) on a manifest (§A4). */\nexport const MAX_MANIFEST_PROVENANCE_REFS = 64;\n/** MAX ncmecReceiptRefs[] on a manifest (§A4). */\nexport const MAX_MANIFEST_NCMEC_RECEIPTS = 32;\n/** MAX attachmentItemIds[] on a communication manifest (§A4). */\nexport const MAX_COMMUNICATION_ATTACHMENTS = 256;\n\n// ===========================================================================\n// §A4 — safetyEvidenceManifests/{manifestId} = SafetyEvidenceManifestV1\n// (Finding-H5). IMMUTABLE, versioned. `sourceKind` selects the present sub-object.\n// ===========================================================================\n\n/** The source-kind discriminator (Finding-H5). Selects WHICH sub-object is present\n * on the manifest: `media` → original/variants/lineage/evidenceCopy;\n * `communication` → communication; `externalFact` → externalFact. */\nexport const SafetyEvidenceSourceKindSchema = z.enum([\n 'media',\n 'communication',\n 'externalFact',\n]);\nexport type SafetyEvidenceSourceKind = z.infer<typeof SafetyEvidenceSourceKindSchema>;\n\n/** §A4 `original` — present ONLY when sourceKind='media'. The captured original\n * object descriptor (never a serving URL). */\nexport const SafetyEvidenceOriginalV1Schema = z.object({\n bucket: z.string().min(1),\n key: z.string().min(1),\n generation: z.string().min(1),\n contentType: z.string().min(1),\n filename: z.string().min(1).optional(),\n sizeBytes: z.number(),\n md5: z.string().min(1),\n sha256: z.string().min(1),\n capturedAt: z.number(),\n}).strict();\nexport type SafetyEvidenceOriginalV1 = z.infer<typeof SafetyEvidenceOriginalV1Schema>;\n\n/** §A4 `variants[]` — media only; MAX 64. */\nexport const SafetyEvidenceVariantV1Schema = z.object({\n variantKey: z.string().min(1),\n sha256: z.string().min(1),\n sizeBytes: z.number(),\n}).strict();\nexport type SafetyEvidenceVariantV1 = z.infer<typeof SafetyEvidenceVariantV1Schema>;\n\n/** §A4 `communication` — present ONLY when sourceKind='communication'.\n * `attachmentItemIds` MAX 256. */\nexport const SafetyEvidenceCommunicationV1Schema = z.object({\n channelId: z.string().min(1),\n messageSeqStart: z.number(),\n messageSeqEnd: z.number(),\n transcriptObjectRef: z.string().min(1),\n attachmentItemIds: z.array(z.string().min(1)).max(MAX_COMMUNICATION_ATTACHMENTS),\n}).strict();\nexport type SafetyEvidenceCommunicationV1 = z.infer<typeof SafetyEvidenceCommunicationV1Schema>;\n\n/** §A4 externalFact `factKind`. */\nexport const SafetyEvidenceExternalFactKindSchema = z.enum([\n 'lawEnforcement',\n 'thirdPartyReport',\n 'operatorKnowledge',\n 'other',\n]);\nexport type SafetyEvidenceExternalFactKind = z.infer<typeof SafetyEvidenceExternalFactKindSchema>;\n\n/** §A4 `externalFact` — present ONLY when sourceKind='externalFact'. */\nexport const SafetyEvidenceExternalFactV1Schema = z.object({\n factKind: SafetyEvidenceExternalFactKindSchema,\n narrativeRef: z.string().min(1),\n establishedActualKnowledgeAt: z.number().optional(),\n sourceContactRef: z.string().min(1).optional(),\n}).strict();\nexport type SafetyEvidenceExternalFactV1 = z.infer<typeof SafetyEvidenceExternalFactV1Schema>;\n\n/** §A4 `detector` — never the raw hash. */\nexport const SafetyEvidenceDetectorV1Schema = z.object({\n source: z.string().min(1),\n listId: z.string().min(1),\n sdkVersion: z.string().min(1),\n requestTraceId: z.string().min(1),\n matchResult: z.string().min(1),\n}).strict();\nexport type SafetyEvidenceDetectorV1 = z.infer<typeof SafetyEvidenceDetectorV1Schema>;\n\n/** §A4 `evidenceCopy` — media only; the verified evidence-vault copy descriptor. */\nexport const SafetyEvidenceCopyV1Schema = z.object({\n destinationBucket: z.string().min(1),\n destinationKey: z.string().min(1),\n keyVersion: z.string().min(1),\n verifyMethod: z.string().min(1),\n verifyResult: z.string().min(1),\n}).strict();\nexport type SafetyEvidenceCopyV1 = z.infer<typeof SafetyEvidenceCopyV1Schema>;\n\n/** §A4 `reporter` — restricted; segregated from ordinary admin views. */\nexport const SafetyEvidenceReporterV1Schema = z.object({\n reporterUidRef: z.string().min(1),\n narrativeRef: z.string().min(1),\n}).strict();\nexport type SafetyEvidenceReporterV1 = z.infer<typeof SafetyEvidenceReporterV1Schema>;\n\n/**\n * `safetyEvidenceManifests/{manifestId}` — IMMUTABLE, versioned\n * SafetyEvidenceManifestV1 (Finding-H5). Doc id is the deterministic `manifestId`.\n *\n * **Invariant (H5) — enforced by the superRefine below:** no manifest may require a\n * null/placeholder media object. The sub-objects are present ONLY for their matching\n * `sourceKind`:\n * - sourceKind='media' → `original` + `lineage` REQUIRED; `variants`/\n * `evidenceCopy` allowed; `communication`/\n * `externalFact` MUST be absent.\n * - sourceKind='communication' → `communication` REQUIRED; `original`/`variants`/\n * `lineage`/`evidenceCopy`/`externalFact` MUST be absent.\n * - sourceKind='externalFact' → `externalFact` REQUIRED; `original`/`variants`/\n * `lineage`/`evidenceCopy`/`communication` MUST be absent.\n *\n * Lineage-keyed auto-action + dedup (incident-wide blocking by `rootIngestId`,\n * auto-ban of `originatingUploaderUid`) apply ONLY to sourceKind='media' — a\n * communication/externalFact manifest carries no lineage and is multi-subject via\n * the case `…/accounts` subcollection (`subjectAccountsRef`), never a synthesized\n * uploader.\n */\nexport const SafetyEvidenceManifestV1Schema = z.object({\n schemaVersion: z.literal(1),\n manifestId: z.string().min(1),\n caseId: z.string().min(1),\n createdAt: z.number(),\n sourceKind: SafetyEvidenceSourceKindSchema, // REQUIRED — selects the present sub-object\n original: SafetyEvidenceOriginalV1Schema.optional(), // present ONLY when sourceKind='media'\n variants: z.array(SafetyEvidenceVariantV1Schema).max(MAX_MANIFEST_VARIANTS).optional(), // media only\n lineage: MediaOriginLineageV1Schema.optional(), // present ONLY when sourceKind='media'\n communication: SafetyEvidenceCommunicationV1Schema.optional(), // present ONLY when sourceKind='communication'\n externalFact: SafetyEvidenceExternalFactV1Schema.optional(), // present ONLY when sourceKind='externalFact'\n // multi-subject lives in the case childSafetyCases/{caseId}/accounts subcollection\n // (no fake uploader on the manifest); this points at …/accounts:\n subjectAccountsRef: z.string().min(1),\n provenanceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_PROVENANCE_REFS), // eventProvenance ids promoted into the case\n contentDocSnapshotRef: z.string().min(1).optional(),\n contentDocRevision: z.number().optional(),\n detector: SafetyEvidenceDetectorV1Schema.optional(), // never the raw hash\n evidenceCopy: SafetyEvidenceCopyV1Schema.optional(), // media only\n reporter: SafetyEvidenceReporterV1Schema.optional(), // restricted; segregated from ordinary admin views\n ncmecReceiptRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n}).strict().superRefine((val, ctx) => {\n // H5 invariant: the sourceKind→present-object set. `media` requires original +\n // lineage and forbids communication/externalFact; `communication` requires\n // communication and forbids all media-only fields + externalFact; `externalFact`\n // requires externalFact and forbids all media-only fields + communication.\n const present = (field: string) =>\n ctx.addIssue({ code: 'custom', path: [field], message: `${field} is only allowed when sourceKind matches` });\n const missing = (field: string) =>\n ctx.addIssue({ code: 'custom', path: [field], message: `${field} is required for this sourceKind` });\n\n if (val.sourceKind === 'media') {\n if (val.original === undefined) missing('original');\n if (val.lineage === undefined) missing('lineage');\n if (val.communication !== undefined) present('communication');\n if (val.externalFact !== undefined) present('externalFact');\n } else if (val.sourceKind === 'communication') {\n if (val.communication === undefined) missing('communication');\n if (val.original !== undefined) present('original');\n if (val.variants !== undefined) present('variants');\n if (val.lineage !== undefined) present('lineage');\n if (val.evidenceCopy !== undefined) present('evidenceCopy');\n if (val.externalFact !== undefined) present('externalFact');\n } else {\n // externalFact\n if (val.externalFact === undefined) missing('externalFact');\n if (val.original !== undefined) present('original');\n if (val.variants !== undefined) present('variants');\n if (val.lineage !== undefined) present('lineage');\n if (val.evidenceCopy !== undefined) present('evidenceCopy');\n if (val.communication !== undefined) present('communication');\n }\n});\nexport type SafetyEvidenceManifestV1 = z.infer<typeof SafetyEvidenceManifestV1Schema>;\n\n// ===========================================================================\n// §A4 — safetyEvidenceJobs/{jobId} = SafetyEvidenceJobV1 (Finding-M2).\n// `verified` is disambiguated as a (phase, status) PAIR, never a bare status.\n// `commandId` is deterministic per (jobId, phase). One worker per phase drives:\n// capture worker → (capture: pending → running → verified) | (capture: deadLetter)\n// verify worker → (verify: pending → running → verified)\n// disposition worker → (disposition: pending → running → disposed) | (disposition: deadLetter)\n// (disposition runs only after preservationStatus=dispositionPending). Terminal\n// timestamps: completedAt on (capture|verify, verified), disposedAt on\n// (disposition, disposed), deadLetterAt on any deadLetter.\n// ===========================================================================\n\n/** §A4 job phase — one worker per phase. */\nexport const SafetyEvidenceJobPhaseSchema = z.enum([\n 'capture',\n 'verify',\n 'disposition',\n]);\nexport type SafetyEvidenceJobPhase = z.infer<typeof SafetyEvidenceJobPhaseSchema>;\n\n/** §A4 job status — disambiguated by the (phase, status) pairing rules above; never\n * a bare status. */\nexport const SafetyEvidenceJobStatusSchema = z.enum([\n 'pending',\n 'running',\n 'verified',\n 'disposed',\n 'deadLetter',\n]);\nexport type SafetyEvidenceJobStatus = z.infer<typeof SafetyEvidenceJobStatusSchema>;\n\n/** `safetyEvidenceJobs/{jobId}` — the capture/verify/disposition saga row\n * (Finding-M2). Doc id is the deterministic `jobId`. `commandId` is deterministic\n * per (jobId, phase) — idempotent + replayed by commandId. */\nexport const SafetyEvidenceJobV1Schema = z.object({\n schemaVersion: z.literal(1),\n jobId: z.string().min(1),\n caseId: z.string().min(1),\n phase: SafetyEvidenceJobPhaseSchema,\n commandId: z.string().min(1), // deterministic per (jobId, phase)\n status: SafetyEvidenceJobStatusSchema,\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n lastErrorCode: z.string().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n completedAt: z.number().optional(), // (capture|verify, verified)\n disposedAt: z.number().optional(), // (disposition, disposed)\n deadLetterAt: z.number().optional(), // any deadLetter\n}).strict();\nexport type SafetyEvidenceJobV1 = z.infer<typeof SafetyEvidenceJobV1Schema>;\n\n// ===========================================================================\n// §A4 subcollections under a job\n// ===========================================================================\n\n/** §A4 job-item role — the source object vs the destination (evidence-copy) object. */\nexport const SafetyEvidenceJobItemRoleSchema = z.enum(['source', 'destination']);\nexport type SafetyEvidenceJobItemRole = z.infer<typeof SafetyEvidenceJobItemRoleSchema>;\n\n/** §A4 job-item verify result. */\nexport const SafetyEvidenceJobItemVerifyResultSchema = z.enum(['pending', 'ok', 'mismatch']);\nexport type SafetyEvidenceJobItemVerifyResult = z.infer<typeof SafetyEvidenceJobItemVerifyResultSchema>;\n\n/** `safetyEvidenceJobs/{jobId}/items/{itemId}` — per-object source/destination row.\n * Doc id is the `itemId`. */\nexport const SafetyEvidenceJobItemV1Schema = z.object({\n role: SafetyEvidenceJobItemRoleSchema,\n bucket: z.string().min(1),\n key: z.string().min(1),\n generation: z.string().min(1).optional(),\n sizeBytes: z.number(),\n sha256: z.string().min(1),\n md5: z.string().min(1).optional(),\n verifyResult: SafetyEvidenceJobItemVerifyResultSchema,\n}).strict();\nexport type SafetyEvidenceJobItemV1 = z.infer<typeof SafetyEvidenceJobItemV1Schema>;\n\n/** §A4 disposition method (per evidence location). */\nexport const SafetyEvidenceDispositionMethodSchema = z.enum(['delete', 'cryptoErase']);\nexport type SafetyEvidenceDispositionMethod = z.infer<typeof SafetyEvidenceDispositionMethodSchema>;\n\n/** §A4 disposition result (per evidence location). */\nexport const SafetyEvidenceDispositionResultSchema = z.enum(['gone', 'leftover']);\nexport type SafetyEvidenceDispositionResult = z.infer<typeof SafetyEvidenceDispositionResultSchema>;\n\n/** `safetyEvidenceJobs/{jobId}/disposition/{locationId}` — per-evidence-location\n * deletion-verification record. Doc id is the `locationId`.\n *\n * [M-5] This IS the durable hard-deletion attestation body: the disposition worker runs only after\n * the case reaches `preservationStatus:'dispositionPending'` (every hold ref released + a reviewed\n * disposition job), and records `method` + `verifiedAt` + `result`. Because soft-delete is DISABLED\n * on the evidence bucket, `result:'gone'` attests a verified TRUE hard-deletion (there is no\n * soft-delete/lifecycle tombstone to model — no `softDeletedAt`/`hardDeleteTime`). `generation`\n * pins the exact object generation that was destroyed, so a later object re-created at the same\n * bucket/key (a new generation) is never falsely attested as this destruction. */\nexport const SafetyEvidenceDispositionV1Schema = z.object({\n bucket: z.string().min(1),\n key: z.string().min(1),\n // [M-5] the exact object generation this record attests destroyed — pins the attestation to a\n // single immutable object version so a same-key re-upload (new generation) is not covered by it.\n // Optional: an object with no generation concept (or a leftover with none read) omits it.\n generation: z.string().min(1).optional(),\n method: SafetyEvidenceDispositionMethodSchema,\n verifiedAt: z.number(),\n result: SafetyEvidenceDispositionResultSchema,\n leftoverDetail: z.string().min(1).optional(),\n}).strict();\nexport type SafetyEvidenceDispositionV1 = z.infer<typeof SafetyEvidenceDispositionV1Schema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"foundation.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,qEAAqE;AACrE,4EAA4E;AAC5E,oCAAoC;AACpC,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,wBAAwB;AAExB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oCAAoC,EACpC,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAErC,8EAA8E;AAC9E,8CAA8C;AAC9C,8EAA8E;AAE9E;gFACgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,MAAM;IACN,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,uBAAuB;IACvB,sBAAsB,EAAE,oCAAoC;IAC5D,qCAAqC,EAAE,6BAA6B;IACpE,sCAAsC;IACtC,OAAO;CACR,CAAC,CAAC;AAGH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,sBAAsB;IACtB,qCAAqC;CACK,CAAC;AAE7C,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;AAG3E;;qEAEqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7C,UAAU;IACV,aAAa;IACb,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,iBAAiB;IACjB,sBAAsB;IACtB,oBAAoB;IACpB,uFAAuF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IACnB,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,UAAU;IACV,QAAQ;CACT,CAAC,CAAC;AAGH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,IAAI,CAAC;IACpD,MAAM;IACN,mBAAmB;IACnB,QAAQ;IACR,2BAA2B;CAC5B,CAAC,CAAC;AAGH,8EAA8E;AAC9E,uEAAuE;AACvE,6EAA6E;AAC7E,8EAA8E;AAE9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAGzG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7C,aAAa;IACb,aAAa;IACb,mBAAmB;IACnB,oBAAoB;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,eAAe,EAAE,yBAAyB;IAC1C,cAAc,EAAE,wBAAwB;IACxC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;;0CAK0C;AAC1C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["// Trust & Safety — shared foundation enums + the canonical target locator.\n//\n// This file is the SINGLE SOURCE for every enum and locator that crosses more\n// than one T&S cluster (report spine, case spine, holds, evidence, sagas,\n// NCMEC, NCII). Cluster document-schema files import their value sets from\n// HERE so two clusters can never define the same enum with drifting values.\n// Every value is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A (the frozen spec) — no\n// invented values, no placeholders.\n//\n// Cross-boundary: these types are consumed by both functions/src and src/ in\n// ttt-prod, so they live in ttt-core (the single source of truth for the\n// backend↔frontend boundary) and surface on the `@ttt-productions/ttt-core/\n// doc-schemas` subpath.\n\nimport { z } from 'zod';\nimport {\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n} from '../../constants/business.js';\n\n// ===========================================================================\n// A1 — Report reasons + reportable item types\n// ===========================================================================\n\n/** The controlling report-reason taxonomy (fixes the client/server drift\n * TS-032). The two protected reasons fork into a childSafetyCase / nciiCase. */\nexport const ReportReasonSchema = z.enum([\n 'Spam',\n 'Harassment',\n 'Hate Speech',\n 'Violence or Threats',\n 'Sexual Content',\n 'Self-Harm',\n 'Impersonation',\n 'Intellectual Property',\n 'Child Safety Concern', // → protected fork: childSafetyCase\n 'Nonconsensual Intimate Image (NCII)', // → protected fork: nciiCase\n 'Not related to on-site entertainment',\n 'Other',\n]);\nexport type ReportReason = z.infer<typeof ReportReasonSchema>;\n\n/** The two reasons that take the mandatory in-process protected branch. */\nexport const PROTECTED_REPORT_REASONS = [\n 'Child Safety Concern',\n 'Nonconsensual Intimate Image (NCII)',\n] as const satisfies readonly ReportReason[];\n\n/** Which protected fork a protected-reason report committed. */\nexport const ProtectedForkSchema = z.enum(['childSafetyCase', 'nciiCase']);\nexport type ProtectedFork = z.infer<typeof ProtectedForkSchema>;\n\n/** EXACTLY the `reportableItems` keys in ttt-prod src/lib/report-config.ts. A\n * ttt-prod CI test asserts this enum and `reportableItems` stay in sync (the\n * sync test lives app-side because report-config.ts is app-side). */\nexport const ReportableItemTypeSchema = z.enum([\n 'username',\n 'craft-skill',\n 'commission-listing',\n 'commission-proposal',\n 'square-streetz-post',\n 'profile-picture',\n 'guild-invite-message',\n 'guild-chat-message',\n // A single message in a WORK-PARTY admin correspondence thread (pendingAdminDispatches\n // partyKind 'workProject' — the one multi-member chat surface transported through\n // Firestore `conversationMessages`). The resolver enforces the work-party kind\n // server-side; user↔admin support threads are NOT reportable (an admin is already a\n // participant in every thread — DJ ruling 2026-07-13).\n 'admin-work-message',\n 'hall-library-item',\n // [EUAS-017] a single Hall sub-item (a Tale chapter / Tune track / Television episode). The\n // `hallItem` TargetLocatorV1 already carries an optional `subItemId`; the report UI passes the\n // sub-item id + its parent hall item, and the resolver derives the canonical sub-item path\n // server-side. Admins can already hide a single sub-item (runSetHallSubItemHidden) — this makes the\n // matching user-facing report reachable.\n 'hall-library-sub-item',\n 'audition',\n 'audition-entry',\n 'work-project',\n 'work-asset',\n 'work-realm',\n]);\nexport type ReportableItemType = z.infer<typeof ReportableItemTypeSchema>;\n\n/** The DO-transported chat report types — no Firestore message doc / owner exists to\n * hold at intake (H-04 V1); the resolver goes through the signed chat-Worker context\n * read. `admin-work-message` is NOT here: its messages are Firestore docs. Derived\n * subset — compile-linked to the canonical enum, never a re-declared string set. */\nexport const CHAT_REPORT_ITEM_TYPES = [\n 'guild-chat-message',\n 'guild-invite-message',\n] as const satisfies readonly ReportableItemType[];\n\n/** Item types whose report work-view renders the content-action (moderate) panel —\n * the backend moderation cores accept these. Compile-linked subset of the enum. */\nexport const CONTENT_ACTION_PANEL_ITEM_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'hall-library-sub-item',\n 'craft-skill',\n // Work-party admin correspondence message — single-doc hidden flip (2026-07-13).\n 'admin-work-message',\n] as const satisfies readonly ReportableItemType[];\nexport type ContentActionPanelItemType = (typeof CONTENT_ACTION_PANEL_ITEM_TYPES)[number];\n\n// ===========================================================================\n// A11 — Target locator (the ONE typed locator used by allegations, temp holds,\n// removal targets, and the report resolver) + privacy-safe summary\n// ===========================================================================\n\n/** Discriminated locator — replaces every all-optional `contentRef`. Every\n * hideable surface in report-config.ts has a typed locator ([H-02]). */\nexport const TargetLocatorV1Schema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('mediaAsset'), mediaAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('hallItem'), hallItemId: z.string().min(1), subItemId: z.string().min(1).optional() }).strict(),\n z.object({ kind: z.literal('squarePost'), postId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('profileImage'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('username'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('craftSkill'), profileUid: z.string().min(1), craftSkillId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionListing'), commissionListingId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionProposal'), commissionListingId: z.string().min(1), commissionProposalId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workProject'), workProjectId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workAsset'), workProjectId: z.string().min(1), workAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workRealm'), workRealmId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('audition'), auditionId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('auditionEntry'), auditionId: z.string().min(1), auditionEntryId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('guildInviteMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('chatAttachment'), channelId: z.string().min(1), messageId: z.string().min(1), attachmentId: z.string().min(1) }).strict(),\n // [H-04 V1] Plain guild chat message (text-only or Worker-unresolved). Distinct from\n // `chatAttachment` (which carries an actual attachment id) so a text-only protected chat\n // report has a clean, unambiguous locator without misusing the attachment variant.\n z.object({ kind: z.literal('guildChatMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n // A work-party admin correspondence message — a Firestore doc at\n // pendingAdminDispatches/{adminDispatchId}/conversationMessages/{messageId} (unlike the\n // DO-addressed guildChatMessage/guildInviteMessage locators, messageId here is a doc id,\n // not a numeric seq).\n z.object({ kind: z.literal('adminWorkMessage'), adminDispatchId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('url'), url: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('additionalText'), textRef: z.string().min(1) }).strict(),\n]);\nexport type TargetLocatorV1 = z.infer<typeof TargetLocatorV1Schema>;\n\n/** The set of locator discriminants — used wherever only the `kind` is needed. */\nexport const TargetLocatorKindSchema = z.enum([\n 'mediaAsset',\n 'hallItem',\n 'squarePost',\n 'profileImage',\n 'username',\n 'craftSkill',\n 'commissionListing',\n 'commissionProposal',\n 'workProject',\n 'workAsset',\n 'workRealm',\n 'audition',\n 'auditionEntry',\n 'guildInviteMessage',\n 'chatAttachment',\n // [H-04 V1] Plain guild chat message locator (text-only / Worker-unresolved protected report).\n 'guildChatMessage',\n // Work-party admin correspondence message (Firestore conversationMessages doc).\n 'adminWorkMessage',\n 'url',\n 'additionalText',\n]);\nexport type TargetLocatorKind = z.infer<typeof TargetLocatorKindSchema>;\n\n/** Privacy-safe summary ONLY — no narrative / PII; used on roots + public rows. */\nexport const TargetLocatorSummaryV1Schema = z.object({\n kind: TargetLocatorKindSchema,\n surfaceLabel: z.string(),\n hasResolvedTarget: z.boolean(),\n}).strict();\nexport type TargetLocatorSummaryV1 = z.infer<typeof TargetLocatorSummaryV1Schema>;\n\n// ===========================================================================\n// A9 — Reporting determination + NCMEC submission state\n// ===========================================================================\n\n/** Case-level reporting determination (Finding-H6). The ONLY carrier of \"no\n * NCMEC report required\" — `notRequired` was removed from NcmecSubmissionState. */\nexport const ReportDispositionSchema = z.enum([\n 'undetermined',\n 'reportRequired',\n 'notRequired',\n 'correctedNoApparentViolation',\n]);\nexport type ReportDisposition = z.infer<typeof ReportDispositionSchema>;\n\n/** Reason codes for the privileged setReportDisposition command (§A9). The first five are the\n * not-required / exception reasons (no NCMEC report ever arose, or a triggering signal was\n * corrected); the last two are the report-required reasons (a report IS legally required). The\n * disposition↔reason pairing is enforced by the ONE cross-field rule below (Rule 36). */\nexport const ReportDispositionReasonCodeSchema = z.enum([\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n // Report-required reasons — valid ONLY with disposition 'reportRequired'.\n 'apparentCsamConfirmed', // human review confirmed apparent CSAM\n 'hashMatchValidated', // validated hash match\n]);\nexport type ReportDispositionReasonCode = z.infer<typeof ReportDispositionReasonCodeSchema>;\n\n/** The reason codes that ASSERT a reporting obligation — legal ONLY with 'reportRequired'.\n * Compile-linked subset of the canonical reason enum. */\nexport const REPORT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'apparentCsamConfirmed',\n 'hashMatchValidated',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The not-required / exception reason codes — legal with every disposition that does NOT assert a\n * reporting obligation ('notRequired', 'correctedNoApparentViolation'). Compile-linked subset. */\nexport const NOT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The ONE cross-field pairing (§A9, Rule 36): which reason codes each disposition permits.\n * Declared HERE once; both the setReportDisposition input (case.ts) and the SafetyDispositionAction\n * console command (admin.ts) apply `refineReportDispositionReasonCode` derived from this map rather\n * than re-declaring the pairing. 'undetermined' is the initial state, never an operator-settable\n * target, so it permits NO reason code (the operator command excludes it). Typed as an exhaustive\n * Record so a new disposition fails to compile until its permitted codes are declared. */\nexport const REPORT_DISPOSITION_ALLOWED_REASON_CODES: Record<\n ReportDisposition,\n readonly ReportDispositionReasonCode[]\n> = {\n undetermined: [],\n reportRequired: REPORT_REQUIRED_DISPOSITION_REASON_CODES,\n notRequired: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n correctedNoApparentViolation: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n};\n\n/** Shared cross-field refinement enforcing the disposition↔reason pairing above. Applied by BOTH\n * the setReportDisposition input schemas and the SafetyDispositionAction console command so the\n * rule lives in exactly one place. Reports the failure on the `dispositionReasonCode` path. */\nexport function refineReportDispositionReasonCode(\n value: { disposition: ReportDisposition; dispositionReasonCode: ReportDispositionReasonCode },\n ctx: z.RefinementCtx,\n): void {\n if (!REPORT_DISPOSITION_ALLOWED_REASON_CODES[value.disposition].includes(value.dispositionReasonCode)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['dispositionReasonCode'],\n message: `Reason code '${value.dispositionReasonCode}' is not valid for disposition '${value.disposition}'.`,\n });\n }\n}\n\n/** Shared cross-field rule (§A9): disposition 'reportRequired' MUST carry at least one evidence ref —\n * a reporting obligation can only be asserted once the evidence has been revealed. Every OTHER\n * disposition ('notRequired', 'correctedNoApparentViolation', 'undetermined') MAY leave evidenceRefs\n * empty. Declared HERE once (Rule 36) and applied — alongside refineReportDispositionReasonCode — by\n * BOTH the setReportDisposition input schemas (case.ts) and the SafetyStagedAction console command\n * (admin.ts), never re-declared. Reports the failure on the `evidenceRefs` path. */\nexport function refineReportDispositionEvidenceRefs(\n value: { disposition: ReportDisposition; evidenceRefs: readonly string[] },\n ctx: z.RefinementCtx,\n): void {\n if (value.disposition === 'reportRequired' && value.evidenceRefs.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['evidenceRefs'],\n message:\n \"Disposition 'reportRequired' requires at least one evidence ref (evidence must have been revealed).\",\n });\n }\n}\n\n// ===========================================================================\n// [EUAS-008] Structured safety-case CLOSURE record — the operator's terminal\n// determination persisted when a CSAM / NCII case is closed via the guided\n// resolution flow (resolveAdminTask). Embedded on the NCII case (`closure`) and on\n// a child-safety `decisions/{id}` row (kind `caseClosed`) so both case types carry\n// the SAME structured outcome/summary/note + actor/timestamp — not just a status\n// flip. This does NOT replace the case lifecycle's own terminal status; it records\n// WHO closed it, WHY, and with what outcome.\n// ===========================================================================\n\n/** founded = a violation was substantiated; unfounded = no violation on review. */\nexport const SafetyCaseClosureOutcomeSchema = z.enum(['founded', 'unfounded']);\nexport type SafetyCaseClosureOutcome = z.infer<typeof SafetyCaseClosureOutcomeSchema>;\n\n/** The structured closure record written on a safety-case close. */\nexport const SafetyCaseClosureV1Schema = z.object({\n outcome: SafetyCaseClosureOutcomeSchema,\n resolutionSummary: z.string().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n adminNote: z.string().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n closedByUid: z.string().min(1),\n closedAt: z.number(),\n}).strict();\nexport type SafetyCaseClosureV1 = z.infer<typeof SafetyCaseClosureV1Schema>;\n\n/** NCMEC submission lifecycle — MANUAL-PORTAL model (§A9). NO `notRequired` (that is\n * ReportDisposition). There is no automated ispws API: a report-needed obligation sits in\n * `awaitingManualFiling` from enqueue until the operator files on the NCMEC portal and records the\n * confirmation (markNcmecPortalComplete → `completed`). Jobs are born `awaitingManualFiling`; the\n * case-list `ncmecStatus` projection uses the same value (no separate `queued` state). There is no\n * in-app retraction — corrections are portal-manual (correction-lifecycle decision). The old\n * API-drive states\n * (opening/open/uploading/addingFileDetails/finishing/retryableFailure/ambiguousResult/permanentFailure)\n * were removed with the live-API client. */\nexport const NcmecSubmissionStateSchema = z.enum([\n 'awaitingManualFiling',\n 'completed',\n]);\nexport type NcmecSubmissionState = z.infer<typeof NcmecSubmissionStateSchema>;\n\n// ===========================================================================\n// A3 — Safety-hold + resource-command vocabularies (the ONE destructive-guard\n// authority). The NCII/storage resource types live in THIS enum (H1 fix).\n// ===========================================================================\n\nexport const SafetyHoldResourceTypeSchema = z.enum([\n 'contentDoc',\n 'mediaAsset',\n 'account',\n 'chatMessageRange',\n 'channel',\n 'nciiTemporaryTarget',\n 'storageObject',\n 'reportEvidenceObject',\n]);\nexport type SafetyHoldResourceType = z.infer<typeof SafetyHoldResourceTypeSchema>;\n\n/** Lifecycle/retention regime governed by the A3 compatibility matrix. */\nexport const SafetyHoldClassSchema = z.enum([\n 'childSafety',\n 'nciiTemporary',\n 'legalRetention',\n 'preservationEvidence',\n // An OPEN ordinary (non-protected) content report places an account-level hold\n // (resourceType 'account', ownerUid = the reported user) so a user can't delete\n // their data out from under an unreviewed report (e.g. a DMCA/IP complaint, then\n // delete-to-clear-tracks). blocksDeletion + blocksAnonymization; released when the\n // report group's admin close-out resolves it. Durable (no expiresAt).\n 'ordinaryReport',\n]);\nexport type SafetyHoldClass = z.infer<typeof SafetyHoldClassSchema>;\n\n/** Resource-scoped destructive command kinds (A3). */\nexport const SafetyCommandKindSchema = z.enum([\n 'nciiRemoval',\n 'csamActiveByteRemoval',\n 'evidenceDisposition',\n]);\nexport type SafetyCommandKind = z.infer<typeof SafetyCommandKindSchema>;\n\n// ===========================================================================\n// Reviewer-capability matrix (§A11 [M4] + §A9). One solo operator holds all\n// at launch; every privileged command checks the SPECIFIC capability + reauth.\n// ===========================================================================\n\nexport const SafetyReviewerCapabilitySchema = z.enum([\n 'nciiRequestReviewer',\n 'nciiEvidenceReviewer',\n 'nciiAppealReviewer',\n 'childSafetyReviewer',\n 'legalDispositionAuthority',\n]);\nexport type SafetyReviewerCapability = z.infer<typeof SafetyReviewerCapabilitySchema>;\n\n// ===========================================================================\n// A7 — Registration-completion outcome (DOMAIN enum; replaces the unsafe\n// generic gRPC retryable/terminal code lists). Only a domain outcome feeds the\n// orphan-Auth deletion policy.\n// ===========================================================================\n\nexport const RegistrationCompletionOutcomeSchema = z.enum([\n 'completed',\n 'alreadyCompletedSameUid',\n 'retryableInfrastructureFailure',\n 'reauthenticationRequired',\n 'appCheckRetryRequired',\n 'nonceExpired',\n 'nonceUnknown',\n 'nonceConsumedDifferentUid',\n 'sessionHashMismatch',\n 'attestationSignatureInvalid',\n 'privateDataConflict',\n 'policyVersionRejected',\n]);\nexport type RegistrationCompletionOutcome = z.infer<typeof RegistrationCompletionOutcomeSchema>;\n\n// ===========================================================================\n// A11 — NCII / TAKE IT DOWN shared vocabularies (consumed by BOTH NCII clusters)\n// ===========================================================================\n\n/** Closed enum of required field codes — completeness + public missing-fields. */\nexport const TakeItDownFieldCodeSchema = z.enum([\n 'requesterName',\n 'contactEmail',\n 'contactPhone',\n 'requesterRole',\n 'electronicSignature',\n 'authorityBasis',\n 'authorityCertification',\n 'authorityEvidence',\n 'targetLocator',\n 'nonconsentStatement',\n 'supportingFacts',\n 'goodFaithCertification',\n]);\nexport type TakeItDownFieldCode = z.infer<typeof TakeItDownFieldCodeSchema>;\n\n/** Closed PUBLIC-SAFE reason codes — never reveal evidence/uploader/crossover. */\nexport const TakeItDownPublicReasonCodeSchema = z.enum([\n 'needMoreInformation',\n 'couldNotVerifyRequesterRole',\n 'couldNotLocateContent',\n 'outsideCoveredScope',\n 'duplicateOfExistingRequest',\n 'removedSuccessfully',\n 'underReview',\n 'closedSeeNotice',\n]);\nexport type TakeItDownPublicReasonCode = z.infer<typeof TakeItDownPublicReasonCodeSchema>;\n\n/** Validity-failure reason codes ([H2]). `incomplete` is a COMPLETENESS state,\n * NEVER a validity state. */\nexport const TakeItDownInvalidReasonCodeSchema = z.enum([\n 'missingSignature',\n 'missingLocator',\n 'missingNonconsentStatement',\n 'missingContactInformation',\n 'requesterNotDepictedPersonOrAuthorizedRepresentative',\n 'authorityNotEstablished',\n 'locatorNotResolvableAfterReasonableEffort',\n 'requestOutsideCoveredDepiction',\n 'duplicateSuperseded',\n 'fraudulentOrBadFaith',\n 'otherCounselApproved',\n]);\nexport type TakeItDownInvalidReasonCode = z.infer<typeof TakeItDownInvalidReasonCodeSchema>;\n\n/** Requester role (depicted person vs authorized representative). */\nexport const TakeItDownRequesterRoleSchema = z.enum(['depictedPerson', 'authorizedRepresentative']);\nexport type TakeItDownRequesterRole = z.infer<typeof TakeItDownRequesterRoleSchema>;\n\n/** Two-axis state: completeness vs validity (H2). */\nexport const TakeItDownCompletenessStatusSchema = z.enum(['incomplete', 'complete']);\nexport type TakeItDownCompletenessStatus = z.infer<typeof TakeItDownCompletenessStatusSchema>;\n\nexport const TakeItDownValidityStatusSchema = z.enum(['pending', 'valid', 'invalid', 'unableToLocate']);\nexport type TakeItDownValidityStatus = z.infer<typeof TakeItDownValidityStatusSchema>;\n\n/** The public no-login status-page status set (root + statusProjection). No\n * appeal model — no `appealedCorrected` (the appeal/reinstatement flow was\n * removed; protected reports have no uploader appeal/notice/reinstatement). */\nexport const TakeItDownPublicStatusSchema = z.enum([\n 'received',\n 'needsMoreInfo',\n 'validInProgress',\n 'completed',\n 'unableToLocate',\n 'invalidGeneralReason',\n]);\nexport type TakeItDownPublicStatus = z.infer<typeof TakeItDownPublicStatusSchema>;\n\n/** Request action types ([L1]). */\nexport const NciiActionTypeSchema = z.enum([\n 'intakeReceived',\n 'completenessDecided',\n 'validityDecided',\n 'tempHoldPlaced',\n 'tempHoldReleased',\n 'removalStarted',\n 'removalCompleted',\n 'hashBlockReversed',\n 'childSafetyCaseLinked',\n 'legalDispositionRecorded',\n]);\nexport type NciiActionType = z.infer<typeof NciiActionTypeSchema>;\n\nexport const NciiActionResultSchema = z.enum(['succeeded', 'failed', 'deferred', 'rejected']);\nexport type NciiActionResult = z.infer<typeof NciiActionResultSchema>;\n\n/** Honest derived completion ([H4]) — never 'completed' for a partial failure. */\nexport const NciiRemovalCompletionOutcomeSchema = z.enum([\n 'completed',\n 'completedWithApprovedException',\n 'unableToComplete',\n]);\nexport type NciiRemovalCompletionOutcome = z.infer<typeof NciiRemovalCompletionOutcomeSchema>;\n\nexport const NciiTargetSurfaceSchema = z.enum([\n 'original',\n 'hallCopy',\n 'profileMedia',\n 'chatAttachment',\n 'variant',\n 'cacheServing',\n 'exactHashMatch',\n]);\nexport type NciiTargetSurface = z.infer<typeof NciiTargetSurfaceSchema>;\n\nexport const NciiTargetOutcomeSchema = z.enum([\n 'pending',\n 'removed',\n 'tombstoned',\n 'verifiedGone',\n 'leftoverRetrying',\n 'unableToComplete',\n 'terminalException',\n]);\nexport type NciiTargetOutcome = z.infer<typeof NciiTargetOutcomeSchema>;\n\n/** CLOSED terminal-exception enum — a technical outage is NOT an exception. */\nexport const NciiTerminalExceptionSchema = z.enum([\n 'legallyPermittedRetention',\n 'contentNotPresentVerified',\n 'counselApprovedException',\n]);\nexport type NciiTerminalException = z.infer<typeof NciiTerminalExceptionSchema>;\n\n/** Internal operational case status ([H7]).\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 * NEVER cleared on the click. The NCII removal worker flips the case to the terminal `closed`\n * ONLY on VERIFIED removal completion (clearing the pin via onSafetyCaseClosed). If the\n * removal saga exhausts its retries (dead-letter), the case moves to `failed` — kept pinned,\n * surfaced in the Safety Console failed-jobs view, with a Restart that re-arms the job. Both\n * are explicit values (never derived). */\nexport const NciiInternalStatusSchema = z.enum([\n 'open',\n 'removalInProgress',\n 'processing',\n 'failed',\n 'removed',\n 'rejected',\n 'closed',\n]);\nexport type NciiInternalStatus = z.infer<typeof NciiInternalStatusSchema>;\n\n/** Child-safety linkage status on an NCII case ([H7]). */\nexport const NciiChildSafetyLinkStatusSchema = z.enum([\n 'none',\n 'assessmentPending',\n 'linked',\n 'resolvedNoChildSafetyCase',\n]);\nexport type NciiChildSafetyLinkStatus = z.infer<typeof NciiChildSafetyLinkStatusSchema>;\n\n// ===========================================================================\n// A11 [F4] — child-safety crossover (possible-minor ≠ automatic CSAM).\n// Embedded on nciiCases. childSafetyCaseId lives HERE (one canonical place).\n// ===========================================================================\n\nexport const NciiMinorAssessmentSchema = z.enum(['adult', 'unknown', 'possibleMinor', 'confirmedMinor']);\nexport type NciiMinorAssessment = z.infer<typeof NciiMinorAssessmentSchema>;\n\nexport const NciiCsamAssessmentSchema = z.enum([\n 'notAssessed',\n 'notApparent',\n 'apparentViolation',\n 'validatedHashMatch',\n]);\nexport type NciiCsamAssessment = z.infer<typeof NciiCsamAssessmentSchema>;\n\nexport const NciiChildSafetyCrossoverSchema = z.object({\n minorAssessment: NciiMinorAssessmentSchema,\n csamAssessment: NciiCsamAssessmentSchema,\n childSafetyCaseId: z.string().min(1).optional(),\n assessedByUid: z.string().min(1).optional(),\n assessedAt: z.number().optional(),\n}).strict();\nexport type NciiChildSafetyCrossover = z.infer<typeof NciiChildSafetyCrossoverSchema>;\n\n/** [H-2] Per-leg lifecycle status for the possible-minor crossover side-effects (serving-deny,\n * PhotoDNA) persisted on the crossover child-safety case (see ChildSafetyCaseV1.crossoverLegs).\n * `pending` is the in-transaction initial marker the assessment writes before the post-commit leg\n * runs; the leg then flips it to `done` (succeeded) or `failed` (captureException'd, awaiting a\n * reconcile/replay). A leg is ABSENT (not `pending`) when it never applied — an external / no-media\n * target has no bytes to deny or scan. */\nexport const SafetyCrossoverLegStatusSchema = z.enum(['pending', 'done', 'failed']);\nexport type SafetyCrossoverLegStatus = z.infer<typeof SafetyCrossoverLegStatusSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"holds.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/holds.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,wCAAwC;AACxC,EAAE;AACF,yFAAyF;AACzF,6EAA6E;AAC7E,kFAAkF;AAClF,uFAAuF;AACvF,qFAAqF;AACrF,gFAAgF;AAChF,kFAAkF;AAClF,gBAAgB;AAChB,EAAE;AACF,oFAAoF;AACpF,kFAAkF;AAClF,sFAAsF;AACtF,sFAAsF;AACtF,qDAAqD;AACrD,EAAE;AACF,oFAAoF;AACpF,kFAAkF;AAClF,oFAAoF;AACpF,oFAAoF;AACpF,qBAAqB;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,8EAA8E;AAC9E,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ACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;wEACwE;AACxE,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — safety holds + resource-scoped destructive commands (Appendix\n// A §A3, Finding-H1 / [C-01] / [M-05]).\n//\n// The SINGLE destructive-guard authority: a `safetyHoldRefs/{caseId}__{resourceKeyHash}`\n// row is the only doc that ever authorizes/denies a destructive byte-op; the\n// `safetyHoldResources/{resourceKeyHash}` aggregate carries per-flag counters for\n// O(1) destructive checks; and `safetyResourceCommands/{resourceKeyHash}__{commandId}`\n// is the resource-scoped destructive command that resolves the release-before-delete\n// race. Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A3 — no invented values, no\n// placeholders.\n//\n// SHARED enums come from ./foundation.js (the single source for every cross-cluster\n// enum); they are NEVER redefined here. The hold-ref/aggregate resource type uses\n// SafetyHoldResourceTypeSchema (the H1 enum that carries the NCII/storage types); the\n// resource-command's `resourceType` uses TargetLocatorKindSchema (the [C-01] serving-\n// vs-evidence resource = `TargetLocatorV1['kind']`).\n//\n// Collection note: this cluster introduces three NEW Firestore collections plus two\n// overflow subcollections under `safetyResourceCommands`. Wiring collections.ts /\n// path-builders.ts / registry.ts is deferred to the app leg (the orchestrator binds\n// the schemas + path builders there); the composite doc-id shapes are documented on\n// each schema below.\n\nimport { z } from 'zod';\nimport {\n SafetyHoldResourceTypeSchema,\n SafetyHoldClassSchema,\n SafetyCommandKindSchema,\n TargetLocatorKindSchema,\n} from './foundation.js';\n\n// ===========================================================================\n// A3 — safetyHoldRefs/{caseId}__{resourceKeyHash}\n// Mutable lifecycle row; the SINGLE destructive-guard hold authority (H1). Every\n// hold — child-safety AND NCII-temporary — is one of these refs; no other doc is\n// ever the authority. There is NO `holdSources[]` authority array.\n// ===========================================================================\n\n/** Lifecycle state of a hold ref. CAS release is on `state='active'`. */\nexport const SafetyHoldRefStateSchema = z.enum(['active', 'released']);\nexport type SafetyHoldRefState = z.infer<typeof SafetyHoldRefStateSchema>;\n\n/** `safetyHoldRefs/{caseId}__{resourceKeyHash}` — mutable lifecycle row; the SINGLE\n * destructive-guard hold authority (H1). Doc id is the deterministic composite\n * `{caseId}__{resourceKeyHash}`. */\nexport const SafetyHoldRefV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n resourceType: SafetyHoldResourceTypeSchema,\n resourceId: z.string().min(1),\n resourceKeyHash: z.string().min(1),\n canonicalResourceKey: z.string().min(1),\n // [C-07] The uid that OWNS the held resource (the content uploader / account subject),\n // when one is resolvable. NOT load-bearing for the destructive guard (that reads ONLY\n // the resourceKeyHash aggregate) — this is an admin-observability index so active holds\n // can be listed per account (\"does this account have pending safety actions?\"). Optional:\n // some resources have no single owning uid, and the `account` key already encodes the uid.\n ownerUid: z.string().min(1).optional(),\n blocksDeletion: z.boolean(),\n blocksAnonymization: z.boolean(),\n blocksReplacementCleanup: z.boolean(),\n state: SafetyHoldRefStateSchema,\n holdClass: SafetyHoldClassSchema, // lifecycle/retention regime; FULL set governed by the A3 compatibility matrix\n createdAt: z.number(),\n releasedAt: z.number().optional(),\n releaseReason: z.string().optional(),\n sourceRequestId: z.string().min(1).optional(), // the statutory request that created an nciiTemporary hold (H1)\n expiresAt: z.number().optional(), // minimize-retention expiry for nciiTemporary holds; ABSENT for childSafety / legalRetention / preservationEvidence\n releaseCommandId: z.string().min(1).optional(), // deterministic id of the CAS release/consume command (H1)\n}).strict();\nexport type SafetyHoldRefV1 = z.infer<typeof SafetyHoldRefV1Schema>;\n\n// ===========================================================================\n// A3 — safetyHoldResources/{resourceKeyHash}\n// Aggregate for O(1) destructive checks; per-flag counters. Create-ref +\n// increment in ONE tx; release decrements the exact ref's counters in the same\n// CAS transaction. Counters never go below zero. A destructive op is denied when\n// its relevant count > 0 and FAILS CLOSED on lookup error.\n// ===========================================================================\n\n/** `safetyHoldResources/{resourceKeyHash}` — aggregate per-flag counters for O(1)\n * destructive checks. Doc id is the `resourceKeyHash`. */\nexport const SafetyHoldResourceV1Schema = z.object({\n schemaVersion: z.literal(1),\n resourceKeyHash: z.string().min(1),\n canonicalResourceKey: z.string().min(1),\n activeRefCount: z.number(),\n blocksDeletionCount: z.number(),\n blocksAnonymizationCount: z.number(),\n blocksReplacementCleanupCount: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type SafetyHoldResourceV1 = z.infer<typeof SafetyHoldResourceV1Schema>;\n\n// ===========================================================================\n// A3 — safetyResourceCommands/{resourceKeyHash}__{commandId}\n// Resource-scoped destructive command (the release-before-delete race fix).\n// `commandId` is deterministic per `(resourceKeyHash, commandKind)`, so every\n// compatible ref over the SAME bytes joins ONE command. Inline caps:\n// authorizedFor.requestIds MAX 64, bypassHoldRefIds MAX 256; overflow moves to the\n// child collections below and flips the matching `*Overflowed` flag.\n// ===========================================================================\n\n/** Command lifecycle state. The destructive byte-op runs ONLY under a command in\n * `authorized`/`executing`; a `failed` delete keeps the command + refs active for\n * idempotent retry (failed → re-lease → retry). */\nexport const SafetyResourceCommandStateSchema = z.enum([\n 'authorized',\n 'executing',\n 'verifiedRemoved',\n 'failed',\n]);\nexport type SafetyResourceCommandState = z.infer<typeof SafetyResourceCommandStateSchema>;\n\n/** The obligation(s) that authorized this destructive op. Overflow beyond\n * `requestIds` MAX 64 moves to the `authorizedRequests` child collection and sets\n * `requestIdsOverflowed=true`. */\nexport const SafetyResourceCommandAuthorizedForV1Schema = z.object({\n requestIds: z.array(z.string().min(1)).max(64),\n caseId: z.string().min(1).optional(),\n /** Additional case ids this command is authorized to bypass SERVING holds for — the\n * LINKED child-safety case(s) in an NCII↔child-safety crossover (C-08). An\n * `nciiRemoval` command authorized for the NCII `caseId` may bypass the linked\n * child-safety case's hold on the SERVING resource so the 48h removal isn't stalled;\n * the evidence-vault preservation hold has a DISTINCT resource key and is never\n * bypassable. Bounded — a crossover links at most a handful of cases. */\n linkedCaseIds: z.array(z.string().min(1)).max(32).optional(),\n requestIdsOverflowed: z.boolean().optional(),\n}).strict();\nexport type SafetyResourceCommandAuthorizedForV1 = z.infer<typeof SafetyResourceCommandAuthorizedForV1Schema>;\n\n/** `safetyResourceCommands/{resourceKeyHash}__{commandId}` — resource-scoped\n * destructive command. Doc id is the deterministic composite\n * `{resourceKeyHash}__{commandId}` where `commandId` is deterministic per\n * `(resourceKeyHash, commandKind)`. */\nexport const SafetyResourceCommandV1Schema = z.object({\n schemaVersion: z.literal(1),\n resourceKeyHash: z.string().min(1),\n canonicalResourceKey: z.string().min(1),\n commandId: z.string().min(1), // deterministic per (resourceKeyHash, commandKind)\n commandKind: SafetyCommandKindSchema,\n resourceType: TargetLocatorKindSchema, // [C-01] the SERVING vs evidence-vault resource this command targets\n authorizedFor: SafetyResourceCommandAuthorizedForV1Schema, // overflow → authorizedRequests child collection\n bypassHoldRefIds: z.array(z.string().min(1)).max(256), // ONLY the bypassable refs per the compatibility matrix; overflow → bypassRefs child collection\n bypassHoldRefsOverflowed: z.boolean().optional(),\n state: SafetyResourceCommandStateSchema,\n attemptCount: z.number(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n lastErrorCode: z.string().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n verifiedRemovedAt: z.number().optional(),\n}).strict();\nexport type SafetyResourceCommandV1 = z.infer<typeof SafetyResourceCommandV1Schema>;\n\n// ===========================================================================\n// A3 [M-05] — overflow child collections under a resource command (mirror the\n// `relatedAssets` overflow pattern). A `*Overflowed` flag means the inline array\n// is NOT the complete set and the child collection MUST be consulted.\n// ===========================================================================\n\n/** `safetyResourceCommands/{resourceKeyHash}__{commandId}/authorizedRequests/{requestId}`\n * — overflow beyond `authorizedFor.requestIds` MAX 64. Doc id is the `requestId`. */\nexport const SafetyResourceCommandAuthorizedRequestV1Schema = z.object({\n requestId: z.string().min(1),\n caseId: z.string().min(1).optional(),\n addedAt: z.number(),\n}).strict();\nexport type SafetyResourceCommandAuthorizedRequestV1 = z.infer<typeof SafetyResourceCommandAuthorizedRequestV1Schema>;\n\n/** `safetyResourceCommands/{resourceKeyHash}__{commandId}/bypassRefs/{refId}` —\n * overflow beyond `bypassHoldRefIds` MAX 256. Doc id is the `refId`. */\nexport const SafetyResourceCommandBypassRefV1Schema = z.object({\n refId: z.string().min(1),\n holdClass: SafetyHoldClassSchema,\n addedAt: z.number(),\n}).strict();\nexport type SafetyResourceCommandBypassRefV1 = z.infer<typeof SafetyResourceCommandBypassRefV1Schema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"monitors.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/monitors.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,0DAA0D;AAC1D,EAAE;AACF,kFAAkF;AAClF,uFAAuF;AACvF,0DAA0D;AAC1D,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AACjF,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,0EAA0E;AAC1E,kFAAkF;AAClF,gBAAgB;AAChB,EAAE;AACF,6EAA6E;AAC7E,iDAAiD;AACjD,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,gFAAgF;AAChF,+EAA+E;AAC/E,kFAAkF;AAClF,qBAAqB;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,iDAAiD;AACjD,yFAAyF;AACzF,4EAA4E;AAC5E,mCAAmC;AACnC,8EAA8E;AAE9E;;;;;yCAKyC;AACzC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC;IAC/C,WAAW;IAC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AA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;CAC/B,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — per-obligation SLA monitors + the global dead-man heartbeat\n// (Appendix A §A8, Finding-M1 / Finding-H4 / Finding-H2).\n//\n// One monitor ROW per distinct obligation (the single `safetySlaMonitor/{caseId}`\n// is removed). Most rows are case-scoped — `safetySlaMonitors/{caseId}__{monitorKind}`\n// — but the NCII removal deadline is REQUEST-scoped [H4]:\n// `safetySlaMonitors/{requestId}__nciiRemovalDeadline`, because each statutory\n// request owns its own 48h obligation and a monitor can never be resolved by\n// finishing a DIFFERENT linked request. ONE schema covers both shapes (`caseId?`\n// and `requestId?` both optional). Arming or resolving one row MUST NOT read or\n// write another row (no cross-monitor coupling).\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A8 — no invented values, no\n// placeholders.\n//\n// No cross-cluster foundation enums are consumed here; the monitor enums are\n// §A8-specific value sets and live in this file.\n//\n// Collection note: this cluster introduces ONE NEW Firestore collection\n// (`safetySlaMonitors`, two doc-id shapes) plus ONE singleton document\n// (`safetyMonitorHeartbeat/global`). Wiring collections.ts / path-builders.ts /\n// registry.ts is deferred to the app leg (the orchestrator binds the schemas +\n// path builders there); the composite + singleton doc-id shapes are documented on\n// each schema below.\n\nimport { z } from 'zod';\n\n// ===========================================================================\n// A8 — safetySlaMonitors/{caseId}__{monitorKind}\n// AND the request-scoped variant safetySlaMonitors/{requestId}__nciiRemovalDeadline\n// One row per distinct obligation. Each fires the external (Sentry / Cloud-\n// Monitoring) alarm independently.\n// ===========================================================================\n\n/** The distinct obligation kinds. The two FIXED (non-operator-configurable)\n * headline urgent-tab countdowns are `photoDnaContract` (the CSAM 72h match-\n * reporting clock) and `nciiRemovalDeadline` (the NCII 48h statutory removal\n * clock). The rest are internal operational alarms on a CSAM/NCII case, never the\n * headline clock. Clocks + the urgent tab attach ONLY to PhotoDNA-hash detections\n * and cases reported as CSAM or NCII. */\nexport const SafetySlaMonitorKindSchema = z.enum([\n 'reviewDue',\n 'photoDnaContract',\n 'actualKnowledgeUnreported',\n 'ncmecRetry',\n 'quarantineStall',\n 'evidenceStall',\n 'accountActionPending',\n 'nciiRemovalDeadline',\n]);\nexport type SafetySlaMonitorKind = z.infer<typeof SafetySlaMonitorKindSchema>;\n\n/** [H2] nciiRemovalDeadline only: `provisional` on first facial-completeness,\n * `binding` once valid. */\nexport const SafetySlaMonitorStageSchema = z.enum(['provisional', 'binding']);\nexport type SafetySlaMonitorStage = z.infer<typeof SafetySlaMonitorStageSchema>;\n\n/** Monitor lifecycle status. */\nexport const SafetySlaMonitorStatusSchema = z.enum(['armed', 'overdue', 'resolved']);\nexport type SafetySlaMonitorStatus = z.infer<typeof SafetySlaMonitorStatusSchema>;\n\n/** `safetySlaMonitors/{caseId}__{monitorKind}` — per-obligation SLA monitor.\n * The `nciiRemovalDeadline` row is REQUEST-scoped [H4]: its doc id is the\n * composite `{requestId}__nciiRemovalDeadline` and it carries `requestId` (not\n * `caseId`). ONE schema covers both shapes — `caseId?` and `requestId?` are both\n * optional. The case `nciiCases/{caseId}.nciiRemovalDeadlineAt` is a\n * NON-authoritative projection of the minimum active request monitor. */\nexport const SafetySlaMonitorV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1).optional(),\n requestId: z.string().min(1).optional(), // nciiRemovalDeadline rows are request-scoped [H4]\n monitorKind: SafetySlaMonitorKindSchema,\n armedAt: z.number(),\n deadlineAt: z.number(),\n escalationLevel: z.number(),\n lastFiredAt: z.number().optional(),\n monitorStage: SafetySlaMonitorStageSchema.optional(), // [H2] nciiRemovalDeadline only\n basisSubmissionId: z.string().min(1).optional(), // [H2] the immutable TakeItDownSubmissionV1 whose receivedAt pins this deadline\n status: SafetySlaMonitorStatusSchema,\n resolvedAt: z.number().optional(),\n resolutionBasis: z.string().optional(),\n}).strict();\nexport type SafetySlaMonitorV1 = z.infer<typeof SafetySlaMonitorV1Schema>;\n\n// ===========================================================================\n// A8 — safetyMonitorHeartbeat/global (global dead-man monitor; SINGLETON)\n// The scheduled monitor sweep stamps `lastRunAt`; a missed heartbeat\n// (now − lastRunAt > expectedIntervalMs) self-alarms out-of-band. Removes the old\n// per-case `heartbeatAt` — the heartbeat is GLOBAL, not per-case. Doc id is the\n// fixed singleton literal `global`.\n// ===========================================================================\n\nexport const SafetyMonitorHeartbeatV1Schema = z.object({\n schemaVersion: z.literal(1),\n lastRunAt: z.number(),\n expectedIntervalMs: z.number(),\n}).strict();\nexport type SafetyMonitorHeartbeatV1 = z.infer<typeof SafetyMonitorHeartbeatV1Schema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"provenance.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/provenance.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sBAAsB;AACtB,EAAE;AACF,8EAA8E;AAC9E,mFAAmF;AACnF,oFAAoF;AACpF,+EAA+E;AAC/E,EAAE;AACF,0EAA0E;AAC1E,kFAAkF;AAClF,gBAAgB;AAChB,EAAE;AACF,gFAAgF;AAChF,kFAAkF;AAClF,gFAAgF;AAChF,2CAA2C;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,kCAAkC;AAClC,6EAA6E;AAC7E,+EAA+E;AAC/E,yEAAyE;AACzE,8EAA8E;AAE9E,6BAA6B;AAC7B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9C,YAAY;IACZ,gBAAgB;IAChB,aAAa;IACb,OAAO;IACP,cAAc;CACf,CAAC,CAAC;AAGH;;;;;;8EAM8E;AAC9E,MAAM,CAAC,MAAM,mCAAmC,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AE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;8EAG8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,gCAAgC,EAAE,kCAAkC;IACjF,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,qEAAqE;IAClG,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,qCAAqC;IACrE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,mCAAmC;CACpD,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,8EAA8E;AAC9E,mFAAmF;AACnF,+EAA+E;AAC/E,8CAA8C;AAC9C,8EAA8E;AAE9E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,EAAE;IAClB,WAAW,EAAE,EAAE;IACf,KAAK,EAAE,EAAE;IACT,yDAAyD;CACjD,CAAC","sourcesContent":["// Trust & Safety — the provenance cluster (Appendix A §A6, Finding-M2 concrete\n// retention profile).\n//\n// `eventProvenance/{eventId}` — server-only, restricted provenance for source\n// events (upload/message/login/report). On a hold the record is copied/linked into\n// the evidence manifest (retentionClass='casePromoted', hold-governed). A scheduled\n// deletion worker enforces the routine TTLs with a hold-aware no-delete guard.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A6 — no invented values, no\n// placeholders.\n//\n// Collection note: this cluster introduces ONE NEW Firestore collection. Wiring\n// collections.ts / path-builders.ts / registry.ts is deferred to the app leg (the\n// orchestrator binds the schema + path builder there); the deterministic doc-id\n// shape is documented on the schema below.\n\nimport { z } from 'zod';\n\n// ===========================================================================\n// §A6 — eventProvenance/{eventId}\n// `eventId` is DETERMINISTIC per source event (e.g. the upload event id, the\n// message-send seq key, the login session key, or the report id) so a replayed\n// source event converges on the same provenance doc — never a duplicate.\n// ===========================================================================\n\n/** §A6 source-event kind. */\nexport const EventProvenanceKindSchema = z.enum([\n 'uploadInit',\n 'uploadFinalize',\n 'messageSend',\n 'login',\n 'reportSubmit',\n]);\nexport type EventProvenanceKind = z.infer<typeof EventProvenanceKindSchema>;\n\n/** §A6 retention class. Build defaults (counsel may only SHORTEN):\n * routine uploadInit/uploadFinalize/messageSend = 90 days;\n * login = 30 days;\n * reportSubmit = retained with the case.\n * On a hold the record is copied/linked into the evidence manifest as\n * 'casePromoted' (hold-governed); the scheduled deletion worker's hold-aware\n * no-delete guard never deletes a casePromoted record while a hold exists. */\nexport const EventProvenanceRetentionClassSchema = z.enum(['routine', 'casePromoted']);\nexport type EventProvenanceRetentionClass = z.infer<typeof EventProvenanceRetentionClassSchema>;\n\n/** §A6 `subjectRefs` — a TYPED object, NOT an open array. Each field is the\n * relevant id for the source event's kind. */\nexport const EventProvenanceSubjectRefsSchema = z.object({\n uid: z.string().min(1).optional(),\n assetId: z.string().min(1).optional(),\n channelId: z.string().min(1).optional(),\n messageSeq: z.number().optional(),\n reportId: z.string().min(1).optional(),\n}).strict();\nexport type EventProvenanceSubjectRefs = z.infer<typeof EventProvenanceSubjectRefsSchema>;\n\n/** `eventProvenance/{eventId}` — server-only, restricted provenance row. Doc id is\n * deterministic per source event. `trustedClientIp` is derived behind Firebase/\n * Cloudflare and is a restricted, INDEX-EXEMPT field; `userAgent` is truncated to\n * 256 chars + normalized. NO reuse for ads/engagement-profiling/analytics. */\nexport const EventProvenanceV1Schema = z.object({\n schemaVersion: z.literal(1),\n kind: EventProvenanceKindSchema,\n subjectRefs: EventProvenanceSubjectRefsSchema, // typed object, not an open array\n trustedClientIp: z.string(), // derived behind Firebase/Cloudflare; restricted, INDEX-EXEMPT field\n userAgent: z.string().max(256), // truncated to 256 chars, normalized\n at: z.number(),\n sessionId: z.string(),\n retentionClass: EventProvenanceRetentionClassSchema,\n}).strict();\nexport type EventProvenanceV1 = z.infer<typeof EventProvenanceV1Schema>;\n\n// ===========================================================================\n// §A6 — routine-retention build defaults (counsel may only SHORTEN). These are the\n// hold-aware deletion worker's TTL inputs; days, not ms. `reportSubmit` has NO\n// routine TTL — it is retained with the case.\n// ===========================================================================\n\n/** Routine TTL (days) by kind — build default; counsel may only shorten. */\nexport const EVENT_PROVENANCE_ROUTINE_TTL_DAYS = {\n uploadInit: 90,\n uploadFinalize: 90,\n messageSend: 90,\n login: 30,\n // reportSubmit: retained with the case — no routine TTL.\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"report.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/report.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sFAAsF;AACtF,sFAAsF;AACtF,qFAAqF;AACrF,+EAA+E;AAC/E,EAAE;AACF,qFAAqF;AACrF,4DAA4D;AAC5D,EAAE;AACF,sEAAsE;AACtE,yFAAyF;AACzF,4EAA4E;AAC5E,0FAA0F;AAC1F,oDAAoD;AAEpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,iCAAiC;AACjC,8EAA8E;AAE9E;;;;;;;;;;;wDAWwD;AACxD,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F,2FAA2F;AAC3F,EAAE;AACF,0FAA0F;AAC1F,4FAA4F;AAC5F,0FAA0F;AAC1F,mFAAmF;AACnF,EAAE;AACF,4CAA4C;AAC5C,qFAAqF;AACrF,8EAA8E","sourcesContent":["// Trust & Safety — the report spine (Appendix A §A1, Finding-H1).\n//\n// The canonical report-target contract produced by the server `resolveReportTarget()`\n// resolver (Phase 1 step 2) plus the protected report root + public projection. Every\n// shape here is transcribed verbatim from docs/code_changes_needed/trust-and-safety/\n// IMPLEMENTATION_PLAN.md Appendix A §A1 — no invented values, no placeholders.\n//\n// SHARED enums + the target locator come from ./foundation.js (the single source for\n// every cross-cluster enum); they are NEVER redefined here.\n//\n// Collection bindings (../registry.ts): `contentReports/{reportId}` →\n// `ProtectedReportRootV1Schema`, `contentReports/{reportId}/publicProjection/{reportId}`\n// → `ReportPublicProjectionV1Schema`, and `activeReportGroups/{groupKey}` →\n// `ReportGroupV1Schema`. These REPLACED the legacy loose-string report/group schemas; the\n// report DOC shape now lives entirely in this file.\n\nimport { z } from 'zod';\nimport {\n ReportReasonSchema,\n ReportableItemTypeSchema,\n ProtectedForkSchema,\n TargetLocatorV1Schema,\n} from './foundation.js';\nimport {\n MAX_REPORT_NARRATIVE_LENGTH,\n MAX_REPORT_SNAPSHOT_TEXT_LENGTH,\n} from '../../constants/business.js';\n\n// ===========================================================================\n// Canonical-key version token. The key formulas are DEFINED below as comments\n// (deterministic IDs are documented, never computed in this schema layer); the\n// server resolver/writer computes them. Bump this token if any formula input\n// set or hashing scheme changes.\n// ===========================================================================\n\n/** Version token folded into every canonical key formula below.\n *\n * v2 (pre-launch, no migration): two coordinated formula-input changes ride this\n * single bump —\n * (1) `canonicalTargetKey` composition is now INJECTIVE: each field is\n * length-prefixed (`len:value`) before joining, so no pair of adjacent\n * attacker-controlled fields (chat `canonicalParentPath` + `canonicalItemId`)\n * can produce a colliding preimage across different (channel, message) pairs.\n * (2) `revision` is derived from CONTENT-relevant state only (the content-edit\n * stamp `updatedAt`, falling back to `createdAt`) — NEVER the Firestore write\n * clock (`updateTime`). Counter writes (likes/votes/follows) no longer fragment\n * report groups or defeat per-reporter dedupe. */\nexport const REPORT_CANONICAL_KEY_VERSION = 'v2';\n\n// ===========================================================================\n// A1 — Server resolver result (ResolvedReportTargetV1)\n// ===========================================================================\n\n/** The server resolver result. The client `reportedItemId`/`reportedUserId` are\n * hints only; every field here is re-derived server-side at the reported revision. */\nexport const ResolvedReportTargetV1Schema = z.object({\n schemaVersion: z.literal(1),\n itemType: ReportableItemTypeSchema,\n canonicalParentPath: z.string(), // server-derived parent doc path\n canonicalItemId: z.string(), // server-derived item id (NEVER the client hint)\n revision: z.number(), // reported content revision — derived from the content-edit stamp\n // (updatedAt, falling back to createdAt), NEVER the write clock (updateTime)\n ownerUid: z.string(), // server-derived owner/sender uid (NOT client-supplied)\n ownerBlockKey: z.string(), // derived owner block key\n mediaAssetId: z.string().optional(), // typed per surface\n channelId: z.string().optional(),\n messageId: z.string().optional(),\n attachmentId: z.string().optional(),\n locator: TargetLocatorV1Schema, // the §A11 discriminated locator for downstream hold/removal\n resolvedAt: z.number(),\n}).strict();\nexport type ResolvedReportTargetV1 = z.infer<typeof ResolvedReportTargetV1Schema>;\n\n// ===========================================================================\n// A1 — Sanitized frozen snapshot (ReportTargetSnapshotV1)\n// ===========================================================================\n\n/** The sanitized frozen snapshot captured at resolve time — no reporter identity,\n * no PII; immutable. */\nexport const ReportTargetSnapshotV1Schema = z.object({\n schemaVersion: z.literal(1),\n itemType: ReportableItemTypeSchema,\n canonicalItemId: z.string(),\n revision: z.number(),\n contentSummaryRef: z.string(), // pointer to a sanitized content snapshot (restricted)\n contentHashes: z.array(z.string()).max(16).optional(),\n // [H-11/EUAS-013/R14] The sanitized REPORTED CONTENT captured at report time, so an author can't edit\n // the violating text/media out before review and have the operator see only the cleaned live doc\n // (edit-to-evade). `capturedText` = the bounded reported text/title/description (NO PII);\n // `capturedMediaAssetIds` = the reported media asset ids. Frozen + immutable like the rest.\n capturedText: z.string().max(MAX_REPORT_SNAPSHOT_TEXT_LENGTH).optional(),\n capturedMediaAssetIds: z.array(z.string()).max(32).optional(),\n capturedAt: z.number(),\n}).strict();\nexport type ReportTargetSnapshotV1 = z.infer<typeof ReportTargetSnapshotV1Schema>;\n\n// ===========================================================================\n// A1 — Segregated reporter narrative (NarrativeRecordV1)\n// ===========================================================================\n\n/** The reporter's free-text narrative — segregated reporter PII. Lives in a\n * restricted subcollection (`contentReports/{reportId}/private/narrative`),\n * admin-read-only, client-write-forbidden; NEVER inlined on the report root or\n * the public projection. The frozen target snapshot is stored alongside it at\n * `contentReports/{reportId}/private/snapshot` (ReportTargetSnapshotV1). */\nexport const NarrativeRecordV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1),\n reporterUid: z.string().min(1), // stored so account-erasure can scrub the narrative\n text: z.string().min(1).max(MAX_REPORT_NARRATIVE_LENGTH),\n createdAt: z.number(),\n}).strict();\nexport type NarrativeRecordV1 = z.infer<typeof NarrativeRecordV1Schema>;\n\n// ===========================================================================\n// A1 — Protected report root (ProtectedReportRootV1)\n// ===========================================================================\n\n/** Cluster-local lifecycle status of the protected report root. */\nexport const ProtectedReportRootStatusSchema = z.enum([\n 'pending_review',\n 'grouped',\n 'actioned',\n 'dismissed',\n]);\nexport type ProtectedReportRootStatus = z.infer<typeof ProtectedReportRootStatusSchema>;\n\n/** The protected report root (restricted — reporter identity + narrative segregated).\n * FUTURE shape of the EXISTING `contentReports/{reportId}` collection (rebinding\n * deferred to the app leg). `protectedFork` is set ONLY by the protected branch\n * (Phase 1 step 2a). */\nexport const ProtectedReportRootV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1), // = sha256(lp(version) + lp(reporterUid) + lp(canonicalTargetKey)) — see injective formulas below\n reporterUid: z.string().min(1),\n reason: ReportReasonSchema,\n resolvedTarget: ResolvedReportTargetV1Schema,\n snapshotRef: z.string(), // → ReportTargetSnapshotV1\n canonicalTargetKey: z.string(), // see formula below\n narrativeRef: z.string().optional(),\n protectedFork: ProtectedForkSchema.optional(), // set ONLY by the protected branch (Phase 1 step 2a)\n status: ProtectedReportRootStatusSchema,\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type ProtectedReportRootV1 = z.infer<typeof ProtectedReportRootV1Schema>;\n\n// ===========================================================================\n// A1 — Public projection (ReportPublicProjectionV1)\n// ===========================================================================\n\n/** Public projection — no reporter identity / narrative. */\nexport const ReportPublicProjectionV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1),\n itemType: ReportableItemTypeSchema,\n reason: ReportReasonSchema,\n status: ProtectedReportRootStatusSchema,\n createdAt: z.number(),\n}).strict();\nexport type ReportPublicProjectionV1 = z.infer<typeof ReportPublicProjectionV1Schema>;\n\n// ===========================================================================\n// A1 — Report group (ReportGroupV1) — dedup/count group keyed by canonicalTargetKey\n// ===========================================================================\n\n/** The dedup/count group for all reports of the same target+revision. The group key\n * IS the `canonicalTargetKey` (== reportGroupKey). NO trusted client owner field — the\n * owner lives on the restricted ProtectedReportRootV1 (resolvedTarget.ownerUid), never\n * here. An app-side trigger maintains the counts; this is the public-ish group surface\n * the admin browse + admin-task queue read. Bound to `activeReportGroups/{groupKey}`. */\nexport const ReportGroupV1Schema = z.object({\n schemaVersion: z.literal(1),\n groupKey: z.string().min(1), // = canonicalTargetKey\n itemType: ReportableItemTypeSchema,\n totalReports: z.number(),\n highestReasonScore: z.number(),\n lastReportAt: z.number(),\n latestReason: ReportReasonSchema,\n // [R12] close-lifecycle states. An ordinary report's admin close (hide/remove/restore) moves the\n // group to `processing` and STAYS in the queue — it is NEVER cleared on the click. The group flips\n // to the terminal `resolved` ONLY when the edge serving-deny (hide/remove) or block-clear (restore)\n // VERIFIES. If the content-serving-sync saga exhausts its retries (dead-letter), the group moves to\n // `failed` — kept in the queue, surfaced in the Safety Console failed-jobs view, with a Restart that\n // re-arms the job. Both are explicit values (never derived).\n status: z.enum(['pending', 'reviewing', 'processing', 'failed', 'resolved']),\n}).strict();\nexport type ReportGroupV1 = z.infer<typeof ReportGroupV1Schema>;\n\n// ===========================================================================\n// Canonical keys (DEFINED — not inline prose). Computed server-side by the\n// resolver/writer; documented here, NOT computed in this schema layer. The\n// `version` token in each formula is `REPORT_CANONICAL_KEY_VERSION` above (now v2).\n//\n// canonicalTargetKey = sha256( lp(version) + lp(itemType) + lp(canonicalParentPath)\n// + lp(canonicalItemId) + lp(String(revision)) )\n// // v2: INJECTIVE composition. lp(s) length-prefixes each field\n// // as `<byteLength>:<s>` (or hash each field separately) so no ':'\n// // ambiguity can straddle two adjacent attacker-controlled fields.\n// // The old `[...].join(':')` was collision-prone for chat targets,\n// // whose canonicalParentPath + canonicalItemId are BOTH client-\n// // derived strings (synthetic:chat:<channelRef> / <messageId>).\n// // `revision` is the CONTENT revision (content-edit stamp, never\n// // the Firestore write clock) — see REPORT_CANONICAL_KEY_VERSION.\n//\n// reportId = sha256( lp(version) + lp(reporterUid) + lp(canonicalTargetKey) )\n// // deterministic dup-key: one report per reporter+target+revision.\n// // This determinism is what makes the protected branch's retry a\n// // no-op on the already-committed hold (Phase 1 step 2a).\n//\n// reportGroupKey = canonicalTargetKey\n// // grouping key: all reporters of the same target+revision.\n// ===========================================================================\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reviewer-security.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/reviewer-security.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,EAAE;AACF,gGAAgG;AAChG,oGAAoG;AACpG,wGAAwG;AACxG,oGAAoG;AACpG,+FAA+F;AAC/F,qGAAqG;AACrG,oBAAoB;AACpB,EAAE;AACF,kGAAkG;AAClG,0FAA0F;AAC1F,oGAAoG;AACpG,qGAAqG;AACrG,sGAAsG;AACtG,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,iGAAiG;AACjG,kGAAkG;AAClG,8FAA8F;AAC9F,EAAE;AACF,+FAA+F;AAC/F,gEAAgE;AAEhE,O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AC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,gDAAgD;IACxE,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;IAC5D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,8DAA8D;IAC1G,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,WAAW;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,WAAW;CACnC,CAAC,CAAC,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"reviewer-security.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/reviewer-security.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,EAAE;AACF,gGAAgG;AAChG,oGAAoG;AACpG,wGAAwG;AACxG,oGAAoG;AACpG,+FAA+F;AAC/F,qGAAqG;AACrG,oBAAoB;AACpB,EAAE;AACF,kGAAkG;AAClG,0FAA0F;AAC1F,oGAAoG;AACpG,qGAAqG;AACrG,sGAAsG;AACtG,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,iGAAiG;AACjG,kGAAkG;AAClG,8FAA8F;AAC9F,EAAE;AACF,+FAA+F;AAC/F,gEAAgE;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAEjE,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAE9E;iGACiG;AACjG,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;AAGzG;uEACuE;AACvE,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,cAA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C","sourcesContent":["// Trust & Safety — PER-USER privileged-reviewer security state (Appendix A §A11 [M-6] / [H-17]).\n//\n// This cluster owns the two BACKEND-ONLY, per-operator documents that back the WebAuthn passkey\n// two-step reauth and the per-user reviewer-capability grants. They are the per-user COUNTERPART to\n// the global `_config/privilegedReviewerSecurity` POLICY singleton (PrivilegedReviewerSecurityProfileV1\n// in ./../ncii/config.ts — what \"fresh reauth\" MEANS): these hold, per operator, WHICH passkeys are\n// enrolled, the in-flight ceremony challenge, the open reauth grant window, and which reviewer\n// capabilities the operator actually holds. Distinct concepts, distinct docs — never merged with the\n// policy singleton.\n//\n// - `privilegedReviewerPasskeyProfiles/{uid}` = PrivilegedReviewerPasskeyProfileV1 — registered\n// WebAuthn credentials + pending ceremony challenge + the active reauth grant window.\n// - `privilegedReviewerCapabilityGrants/{uid}` = PrivilegedReviewerCapabilityGrantV1 — the set of\n// SafetyReviewerCapability the operator is granted (the per-user grantable form of the §A11 [M4]\n// reviewer-capability matrix, which until now existed only as the SafetyReviewerCapability enum).\n//\n// Collection choice mirrors the existing backend-only per-operator security pattern (the app's\n// `operatorStepUp/{uid}` TOTP doc): a top-level collection keyed by uid, Cloud-Functions-only\n// (firestore.rules deny all client read/write — wired app-side). Credentials are an INLINE array\n// (an operator enrolls a handful of authenticators, never enough to overflow a doc) rather than a\n// subcollection — matches the small-bounded-set inline modeling used elsewhere in this layer.\n//\n// SHARED enums come from ./foundation.js (the single source for every cross-cluster enum); the\n// SafetyReviewerCapability matrix is IMPORTED, never redefined.\n\nimport { z } from 'zod';\nimport { SafetyReviewerCapabilitySchema } from './foundation.js';\n\n// ===========================================================================\n// §A11 [M-6] — WebAuthn credential + ceremony challenge (embedded shapes)\n// ===========================================================================\n\n/** WebAuthn authenticator transport hints (as reported by the client at registration). Advisory\n * only — the server never trusts them for authorization; used to steer the client `get()` UI. */\nexport const WebAuthnTransportSchema = z.enum(['usb', 'nfc', 'ble', 'internal', 'hybrid', 'smart-card']);\nexport type WebAuthnTransport = z.infer<typeof WebAuthnTransportSchema>;\n\n/** In-flight WebAuthn ceremony kind — a registration (`navigator.credentials.create`) or an\n * authentication/assertion (`navigator.credentials.get`) challenge. */\nexport const PrivilegedReviewerChallengeTypeSchema = z.enum(['registration', 'authentication']);\nexport type PrivilegedReviewerChallengeType = z.infer<typeof PrivilegedReviewerChallengeTypeSchema>;\n\n/** One registered WebAuthn passkey credential (standard WebAuthn credential record). `publicKey` is\n * the COSE-encoded public key (base64url); `signCount` is the authenticator signature counter used\n * for clone detection (a non-monotonic count on assertion is a signal). Never stores any private\n * key material — WebAuthn's private key never leaves the authenticator. */\nexport const PrivilegedReviewerPasskeyCredentialV1Schema = z.object({\n credentialId: z.string().min(1), // base64url WebAuthn credential id (the assertion lookup key)\n publicKey: z.string().min(1), // base64url COSE public key\n signCount: z.number(), // authenticator signature counter (clone-detection); may legitimately be 0\n transports: z.array(WebAuthnTransportSchema).optional(), // advisory client-reported transports\n aaguid: z.string().min(1).optional(), // authenticator model identifier (AAGUID)\n label: z.string().min(1), // operator-facing label (\"YubiKey 5C\", \"MacBook Touch ID\")\n createdAt: z.number(), // epoch ms; enrollment time\n lastUsedAt: z.number().optional(), // epoch ms; updated on each successful assertion\n}).strict();\nexport type PrivilegedReviewerPasskeyCredentialV1 = z.infer<typeof PrivilegedReviewerPasskeyCredentialV1Schema>;\n\n/** The single in-flight WebAuthn ceremony challenge for this operator (registration or assertion).\n * The raw challenge is server-generated random bytes (base64url); it is single-use and expires at\n * `expiresAt` — a stale/absent challenge fails the ceremony closed. Replaced on each new ceremony. */\nexport const PrivilegedReviewerReauthChallengeV1Schema = z.object({\n challenge: z.string().min(1), // base64url server-generated random challenge\n type: PrivilegedReviewerChallengeTypeSchema,\n createdAt: z.number(), // epoch ms; challenge issue time\n expiresAt: z.number(), // epoch ms; single-use TTL — a passed/absent challenge fails closed\n}).strict();\nexport type PrivilegedReviewerReauthChallengeV1 = z.infer<typeof PrivilegedReviewerReauthChallengeV1Schema>;\n\n// ===========================================================================\n// §A11 [M-6] / [H-17] — privilegedReviewerPasskeyProfiles/{uid}\n// = PrivilegedReviewerPasskeyProfileV1\n// ===========================================================================\n\n/** `privilegedReviewerPasskeyProfiles/{uid}` — per-operator WebAuthn passkey enrollment + the open\n * two-step reauth grant window. BACKEND-ONLY (Cloud-Functions-only; client read/write denied in\n * firestore.rules). The per-user counterpart to the `_config/privilegedReviewerSecurity` policy\n * singleton: the policy says what fresh reauth MEANS, this says what THIS operator has enrolled and\n * whether a grant is currently open.\n *\n * A successful passkey assertion opens the grant: `grantExpiresAt` is set to now + the policy's\n * `privilegedReauthTtlSeconds`, and `twoStepReauthCapabilities` records which reviewer capabilities\n * that grant covers. A privileged capability invocation is allowed only while `grantExpiresAt` is in\n * the future AND the capability is in `twoStepReauthCapabilities` AND the operator is granted it (see\n * PrivilegedReviewerCapabilityGrantV1). An empty `twoStepReauthCapabilities` + absent `grantExpiresAt`\n * = no open grant. */\nexport const PrivilegedReviewerPasskeyProfileV1Schema = z.object({\n schemaVersion: z.literal(1),\n uid: z.string().min(1), // the operator this profile belongs to (= doc id)\n // Enrolled WebAuthn credentials (inline; a handful per operator). Empty until first enrollment.\n credentials: z.array(PrivilegedReviewerPasskeyCredentialV1Schema),\n // The single in-flight registration/authentication ceremony challenge (absent between ceremonies).\n pendingChallenge: PrivilegedReviewerReauthChallengeV1Schema.optional(),\n // Active reauth grant window (epoch ms). Absent/past = no open grant → privileged actions re-prompt.\n grantExpiresAt: z.number().optional(),\n // Which reviewer capabilities the current open grant covers (empty when no grant is open).\n twoStepReauthCapabilities: z.array(SafetyReviewerCapabilitySchema),\n createdAt: z.number(), // epoch ms\n updatedAt: z.number(), // epoch ms\n}).strict();\nexport type PrivilegedReviewerPasskeyProfileV1 = z.infer<typeof PrivilegedReviewerPasskeyProfileV1Schema>;\n\n// ===========================================================================\n// §A11 [M-6] / [M4] — privilegedReviewerCapabilityGrants/{uid}\n// = PrivilegedReviewerCapabilityGrantV1\n// ===========================================================================\n\n/** `privilegedReviewerCapabilityGrants/{uid}` — the reviewer capabilities THIS operator is granted\n * (the per-user grantable form of the §A11 [M4] reviewer-capability matrix). BACKEND-ONLY. Every\n * privileged safety command checks the SPECIFIC required SafetyReviewerCapability against this doc\n * (in addition to a fresh passkey grant). One solo operator holds all capabilities at launch; the\n * grant is an explicit authorization record so authority is data, not a hard-coded `isAdmin`. */\nexport const PrivilegedReviewerCapabilityGrantV1Schema = z.object({\n schemaVersion: z.literal(1),\n uid: z.string().min(1), // the operator this grant belongs to (= doc id)\n grantedCapabilities: z.array(SafetyReviewerCapabilitySchema),\n grantedByUid: z.string().min(1).optional(), // the operator who last modified this grant (authority trail)\n createdAt: z.number(), // epoch ms\n updatedAt: z.number(), // epoch ms\n}).strict();\nexport type PrivilegedReviewerCapabilityGrantV1 = z.infer<typeof PrivilegedReviewerCapabilityGrantV1Schema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sagas.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/sagas.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6CAA6C;AAC7C,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,iFAAiF;AACjF,2EAA2E;AAC3E,+EAA+E;AAC/E,EAAE;AACF,0EAA0E;AAC1E,kFAAkF;AAClF,gBAAgB;AAChB,EAAE;AACF,sEAAsE;AACtE,2EAA2E;AAC3E,4EAA4E;AAC5E,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,8EAA8E;AAC9E,4EAA4E;AAC5E,mCAAmC;AACnC,EAAE;AACF,2EAA2E;AAC3E,wEAAwE;AACxE,gFAAgF;AAChF,uDAAuD;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,8EAA8E;AAC9E,mCAAmC;AACnC,gFAAgF;AAChF,4DAA4D;AAC5D,8EAA8E;AAE9E,mDAAmD;AACnD,MAAM,CAA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Ac,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,8EAA8E;AAC9E,uEAAuE;AACvE,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,2FAA2F;AAC3F,uGAAuG;AACvG,0CAA0C;AAC1C,mGAAmG;AACnG,uDAAuD;AACvD,EAAE;AACF,mEAAmE;AACnE,6EAA6E;AAC7E,iFAAiF;AACjF,8DAA8D;AAC9D,oEAAoE;AACpE,8EAA8E","sourcesContent":["// Trust & Safety — three independent durable sagas + the closure coordinator\n// (Appendix A §A5, Finding-H5 / Finding-H6).\n//\n// Quarantine, NCMEC reporting, and account action are THREE independent durable\n// sagas. The quarantine job NEVER folds reporting or account action into its\n// phases — it can be `quarantineComplete` while the other two are still open, so\n// no doc ever lies about quarantine completion. Each saga is idempotent by\n// `commandId`; the reconciler verifies external state, never a prior response.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A5 — no invented values, no\n// 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// NcmecSubmissionStateSchema (the §A9 reporting lifecycle) from foundation.\n//\n// Collection note: this cluster introduces THREE NEW Firestore collections plus\n// one overflow subcollection under `quarantineSagaJobs`. Wiring collections.ts /\n// path-builders.ts / registry.ts is deferred to the app leg (the orchestrator\n// binds the schemas + path builders there); the composite doc-id shapes are\n// documented on each schema below.\n//\n// CLOSURE COORDINATOR — there is NO doc for it. The case is \"operationally\n// resolvable\" via a PROJECTION computed on the case root from the three\n// independent statuses (see the closure predicate comment at the bottom of this\n// file). Do NOT create a closure-coordinator document.\n\nimport { z } from 'zod';\nimport { NcmecSubmissionStateSchema } from './foundation.js';\n\n// ===========================================================================\n// A5 — quarantineSagaJobs/{caseId}\n// Quarantine ONLY (hold → serving-deny → evidence → active-byte removal). Never\n// folds reporting / account action. Doc id is the `caseId`.\n// ===========================================================================\n\n/** Top-level run status of the quarantine saga. */\nexport const QuarantineStatusSchema = z.enum([\n 'running',\n 'quarantineComplete',\n 'deadLetter',\n]);\nexport type QuarantineStatus = z.infer<typeof QuarantineStatusSchema>;\n\n/** The FULL quarantine phase enum. `servingDeny*` precede `evidenceCopying`;\n * `activeCopiesRemoval*` require `evidenceVerified`. */\nexport const QuarantinePhaseSchema = z.enum([\n 'holdCommitted',\n 'sourceManifestCaptured',\n 'servingDenyRequested',\n 'servingDenyVerified',\n 'evidenceCopying',\n 'evidenceVerified',\n 'activeCopiesRemovalRequested',\n 'activeCopiesRemovalVerified',\n 'quarantineComplete',\n]);\nexport type QuarantinePhase = z.infer<typeof QuarantinePhaseSchema>;\n\n/** `quarantineSagaJobs/{caseId}` — quarantine-only durable saga. Doc id is the\n * `caseId`. `commandId` is deterministic per `(caseId, phase)`. `relatedAssetIds`\n * is bounded at MAX 256; overflow → `…/relatedAssets/{assetId}`. */\nexport const QuarantineSagaJobV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n quarantineStatus: QuarantineStatusSchema,\n phase: QuarantinePhaseSchema,\n phaseVersion: z.number(),\n commandId: z.string().min(1), // deterministic per (caseId, phase)\n relatedAssetIds: z.array(z.string().min(1)).max(256), // bounded; overflow → …/relatedAssets/{assetId}\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n lastError: z.string().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n completedAt: z.number().optional(),\n}).strict();\nexport type QuarantineSagaJobV1 = z.infer<typeof QuarantineSagaJobV1Schema>;\n\n/** `quarantineSagaJobs/{caseId}/relatedAssets/{assetId}` — overflow beyond\n * `relatedAssetIds` MAX 256. Doc id is the `assetId`. */\nexport const QuarantineSagaRelatedAssetV1Schema = z.object({\n rootIngestId: z.string().min(1),\n addedAt: z.number(),\n}).strict();\nexport type QuarantineSagaRelatedAssetV1 = z.infer<typeof QuarantineSagaRelatedAssetV1Schema>;\n\n// ===========================================================================\n// A5 — ncmecSubmissionJobs/{caseId}__{submissionId}\n// The API/manual reporting lifecycle. Drives the …/ncmecSubmissions/{submissionId}\n// records + …/attempts; owns retries, ambiguity reconciliation, manual-portal\n// fallback, supplemental/correction. Doc id is the deterministic composite\n// `{caseId}__{submissionId}`.\n// ===========================================================================\n\n/** `ncmecSubmissionJobs/{caseId}__{submissionId}` — reporting-lifecycle durable\n * saga. Doc id is the deterministic composite `{caseId}__{submissionId}`.\n * `commandId` is the saga's idempotency key. `state` is the §A9\n * NcmecSubmissionState (NO `notRequired` — that lives on ReportDisposition). */\nexport const NcmecSubmissionJobV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n submissionId: z.string().min(1),\n state: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState\n commandId: z.string().min(1),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n lastErrorCode: z.string().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n completedAt: z.number().optional(),\n}).strict();\nexport type NcmecSubmissionJobV1 = z.infer<typeof NcmecSubmissionJobV1Schema>;\n\n// ===========================================================================\n// A5 — accountActionCommands/{caseId}__{uid}\n// The per-account safety-action lifecycle. Doc id is the deterministic composite\n// `{caseId}__{uid}`. A dead-letter replay never re-issues a second ban\n// (idempotent `commandId` + merge-generation check).\n// ===========================================================================\n\n/** The per-account safety action this command applies. `reinstate` is the inverse of a\n * restriction: it restores `status:'active'`, clears `privateData.safetyLocked`, and\n * re-enables a disabled Auth account (used to lift a safety-lock / ban when a case is\n * closed as a false positive). The case's safety HOLDS are released separately by the\n * case-close path, not by this action. */\nexport const AccountActionSchema = z.enum([\n 'ban',\n 'suspend',\n 'watch',\n 'safetyLocked',\n 'reinstate',\n 'none',\n]);\nexport type AccountAction = z.infer<typeof AccountActionSchema>;\n\n/** Where the action originated. */\nexport const AccountActionSourceSchema = z.enum(['autoHash', 'operator']);\nexport type AccountActionSource = z.infer<typeof AccountActionSourceSchema>;\n\n/** Command lifecycle status. `deadLetter` parks a command whose attempt budget is\n * exhausted (the drain query stops matching it); an operator replays it via\n * `adminReplayDeadLetter` (generic reset to `pending`). */\nexport const AccountActionStatusSchema = z.enum(['pending', 'applied', 'reverted', 'deadLetter']);\nexport type AccountActionStatus = z.infer<typeof AccountActionStatusSchema>;\n\n/** `accountActionCommands/{caseId}__{uid}` — per-account safety-action durable\n * saga. Doc id is the deterministic composite `{caseId}__{uid}`. `commandId` is\n * the saga's idempotency key. */\nexport const AccountActionCommandV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n targetUid: z.string().min(1),\n action: AccountActionSchema,\n source: AccountActionSourceSchema,\n status: AccountActionStatusSchema,\n commandId: z.string().min(1),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n lastError: z.string().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n completedAt: z.number().optional(),\n}).strict();\nexport type AccountActionCommandV1 = z.infer<typeof AccountActionCommandV1Schema>;\n\n// ===========================================================================\n// A5 — CLOSURE COORDINATOR (a PROJECTION on the case root, NOT a doc).\n//\n// There is NO closure-coordinator document. The case is OPERATIONALLY RESOLVABLE\n// only when ALL THREE independent statuses agree:\n//\n// 1. quarantine : QuarantineSagaJobV1.quarantineStatus === 'quarantineComplete'\n// 2. account action : case-root accountActionStatus ∈ { 'noAccountActionRequired', 'resolved' }\n// 3. reporting predicate (Finding-H6):\n// ( case-root reportDisposition === 'notRequired' AND no NCMEC submission was ever opened )\n// OR ( the submission's state === 'completed' )\n//\n// Reporting closure keys on the case-root `reportDisposition` (§A9\n// ReportDisposition), NOT on a `notRequired` submission state (that value no\n// longer exists on NcmecSubmissionState). A `notRequired`-disposed case is never\n// blocked on a non-existent report; a human-review case stays\n// `operatorDecisionPending` until the operator commands the action.\n// ===========================================================================\n"]}