@ttt-productions/ttt-core 0.78.23 → 0.78.25

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 (131) hide show
  1. package/dist/constants/app-mode.d.ts +1 -0
  2. package/dist/constants/app-mode.d.ts.map +1 -1
  3. package/dist/constants/app-mode.js +11 -0
  4. package/dist/constants/app-mode.js.map +1 -1
  5. package/dist/constants/business-user.d.ts +1 -1
  6. package/dist/constants/business-user.js +1 -1
  7. package/dist/constants/business-user.js.map +1 -1
  8. package/dist/constants/release-flags.d.ts +2 -2
  9. package/dist/constants/release-flags.d.ts.map +1 -1
  10. package/dist/constants/release-flags.js +2 -2
  11. package/dist/constants/release-flags.js.map +1 -1
  12. package/dist/doc-schemas/chat-sync.d.ts.map +1 -1
  13. package/dist/doc-schemas/chat-sync.js +3 -2
  14. package/dist/doc-schemas/chat-sync.js.map +1 -1
  15. package/dist/doc-schemas/commissions.d.ts +14 -11
  16. package/dist/doc-schemas/commissions.d.ts.map +1 -1
  17. package/dist/doc-schemas/commissions.js +14 -4
  18. package/dist/doc-schemas/commissions.js.map +1 -1
  19. package/dist/doc-schemas/media-activation-jobs.d.ts.map +1 -1
  20. package/dist/doc-schemas/media-activation-jobs.js +4 -3
  21. package/dist/doc-schemas/media-activation-jobs.js.map +1 -1
  22. package/dist/doc-schemas/media-assets.d.ts +2 -2
  23. package/dist/doc-schemas/media-assets.d.ts.map +1 -1
  24. package/dist/doc-schemas/media-assets.js +5 -4
  25. package/dist/doc-schemas/media-assets.js.map +1 -1
  26. package/dist/doc-schemas/messaging.d.ts.map +1 -1
  27. package/dist/doc-schemas/messaging.js +3 -2
  28. package/dist/doc-schemas/messaging.js.map +1 -1
  29. package/dist/doc-schemas/ncii/allegations.js +3 -3
  30. package/dist/doc-schemas/ncii/allegations.js.map +1 -1
  31. package/dist/doc-schemas/ncii/cases.d.ts.map +1 -1
  32. package/dist/doc-schemas/ncii/cases.js +4 -3
  33. package/dist/doc-schemas/ncii/cases.js.map +1 -1
  34. package/dist/doc-schemas/ncii/config.d.ts.map +1 -1
  35. package/dist/doc-schemas/ncii/config.js +4 -3
  36. package/dist/doc-schemas/ncii/config.js.map +1 -1
  37. package/dist/doc-schemas/ncii/holds.js +3 -3
  38. package/dist/doc-schemas/ncii/holds.js.map +1 -1
  39. package/dist/doc-schemas/ncii/removal.js +3 -3
  40. package/dist/doc-schemas/ncii/removal.js.map +1 -1
  41. package/dist/doc-schemas/ncii/requests.d.ts.map +1 -1
  42. package/dist/doc-schemas/ncii/requests.js +4 -3
  43. package/dist/doc-schemas/ncii/requests.js.map +1 -1
  44. package/dist/doc-schemas/notification-ledger.d.ts.map +1 -1
  45. package/dist/doc-schemas/notification-ledger.js +3 -1
  46. package/dist/doc-schemas/notification-ledger.js.map +1 -1
  47. package/dist/doc-schemas/payments.d.ts.map +1 -1
  48. package/dist/doc-schemas/payments.js +2 -1
  49. package/dist/doc-schemas/payments.js.map +1 -1
  50. package/dist/doc-schemas/registry.d.ts +108 -35
  51. package/dist/doc-schemas/registry.d.ts.map +1 -1
  52. package/dist/doc-schemas/registry.js +4 -0
  53. package/dist/doc-schemas/registry.js.map +1 -1
  54. package/dist/doc-schemas/safety/age.d.ts.map +1 -1
  55. package/dist/doc-schemas/safety/age.js +4 -3
  56. package/dist/doc-schemas/safety/age.js.map +1 -1
  57. package/dist/doc-schemas/safety/case-aliases.d.ts.map +1 -1
  58. package/dist/doc-schemas/safety/case-aliases.js +5 -4
  59. package/dist/doc-schemas/safety/case-aliases.js.map +1 -1
  60. package/dist/doc-schemas/safety/case.d.ts.map +1 -1
  61. package/dist/doc-schemas/safety/case.js +4 -3
  62. package/dist/doc-schemas/safety/case.js.map +1 -1
  63. package/dist/doc-schemas/safety/evidence.js +3 -3
  64. package/dist/doc-schemas/safety/evidence.js.map +1 -1
  65. package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
  66. package/dist/doc-schemas/safety/foundation.js +5 -3
  67. package/dist/doc-schemas/safety/foundation.js.map +1 -1
  68. package/dist/doc-schemas/safety/holds.d.ts.map +1 -1
  69. package/dist/doc-schemas/safety/holds.js +4 -3
  70. package/dist/doc-schemas/safety/holds.js.map +1 -1
  71. package/dist/doc-schemas/safety/monitors.d.ts.map +1 -1
  72. package/dist/doc-schemas/safety/monitors.js +5 -3
  73. package/dist/doc-schemas/safety/monitors.js.map +1 -1
  74. package/dist/doc-schemas/safety/provenance.js +3 -3
  75. package/dist/doc-schemas/safety/provenance.js.map +1 -1
  76. package/dist/doc-schemas/safety/report.d.ts.map +1 -1
  77. package/dist/doc-schemas/safety/report.js +4 -3
  78. package/dist/doc-schemas/safety/report.js.map +1 -1
  79. package/dist/doc-schemas/safety/sagas.js +3 -3
  80. package/dist/doc-schemas/safety/sagas.js.map +1 -1
  81. package/dist/doc-schemas/social.d.ts +130 -0
  82. package/dist/doc-schemas/social.d.ts.map +1 -1
  83. package/dist/doc-schemas/social.js +91 -2
  84. package/dist/doc-schemas/social.js.map +1 -1
  85. package/dist/doc-schemas/square-announcement-jobs.d.ts +306 -14
  86. package/dist/doc-schemas/square-announcement-jobs.d.ts.map +1 -1
  87. package/dist/doc-schemas/square-announcement-jobs.js +15 -2
  88. package/dist/doc-schemas/square-announcement-jobs.js.map +1 -1
  89. package/dist/doc-schemas/user.js +3 -3
  90. package/dist/doc-schemas/user.js.map +1 -1
  91. package/dist/doc-schemas/work-project.js +2 -2
  92. package/dist/doc-schemas/work-project.js.map +1 -1
  93. package/dist/ids/chat-ids.d.ts +3 -2
  94. package/dist/ids/chat-ids.d.ts.map +1 -1
  95. package/dist/ids/chat-ids.js +3 -2
  96. package/dist/ids/chat-ids.js.map +1 -1
  97. package/dist/media/domain-events-admin.d.ts +0 -7
  98. package/dist/media/domain-events-admin.d.ts.map +1 -1
  99. package/dist/media/domain-events-admin.js +0 -11
  100. package/dist/media/domain-events-admin.js.map +1 -1
  101. package/dist/media/domain-events.d.ts +0 -6
  102. package/dist/media/domain-events.d.ts.map +1 -1
  103. package/dist/media/domain-events.js +1 -2
  104. package/dist/media/domain-events.js.map +1 -1
  105. package/dist/media/hall-library-target-fields.js +1 -1
  106. package/dist/media/hall-library-target-fields.js.map +1 -1
  107. package/dist/media/pending-media.d.ts +0 -54
  108. package/dist/media/pending-media.d.ts.map +1 -1
  109. package/dist/media/photodna-coverage.d.ts.map +1 -1
  110. package/dist/media/photodna-coverage.js +5 -3
  111. package/dist/media/photodna-coverage.js.map +1 -1
  112. package/dist/paths/related-ids.js +1 -1
  113. package/dist/paths/related-ids.js.map +1 -1
  114. package/dist/safety/ncii-intake-derivations.d.ts.map +1 -1
  115. package/dist/safety/ncii-intake-derivations.js +4 -2
  116. package/dist/safety/ncii-intake-derivations.js.map +1 -1
  117. package/dist/safety/resource-keys.d.ts.map +1 -1
  118. package/dist/safety/resource-keys.js +2 -1
  119. package/dist/safety/resource-keys.js.map +1 -1
  120. package/dist/schemas/chat.js +3 -3
  121. package/dist/schemas/chat.js.map +1 -1
  122. package/dist/schemas/ncii.js +1 -1
  123. package/dist/schemas/ncii.js.map +1 -1
  124. package/dist/schemas/notification.d.ts +8 -8
  125. package/dist/schemas/notification.d.ts.map +1 -1
  126. package/dist/schemas/notification.js +17 -11
  127. package/dist/schemas/notification.js.map +1 -1
  128. package/dist/types/social.d.ts +1 -45
  129. package/dist/types/social.d.ts.map +1 -1
  130. package/dist/types/social.js.map +1 -1
  131. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"case-aliases.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case-aliases.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,sFAAsF;AACtF,gFAAgF;AAChF,6EAA6E;AAC7E,kFAAkF;AAClF,kEAAkE;AAClE,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,oFAAoF;AACpF,kFAAkF;AAClF,oFAAoF;AACpF,6BAA6B;AAC7B,EAAE;AACF,0EAA0E;AAC1E,+EAA+E;AAC/E,4EAA4E;AAC5E,2CAA2C;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,gFAAgF;AAChF,2DAA2D;AAC3D,8EAA8E;AAE9E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,8EAA8E;AAC9E,4BAA4B;AAC5B,8EAA8E;AAE9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,IAAI,CAAC;IACrD,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,cAAc;CACf,CAAC,CAAC;AAGH,8EAA8E;AAC9E,2DAA2D;AAC3D,wFAAwF;AACxF,yEAAyE;AACzE,mFAAmF;AACnF,8EAA8E;AAE9E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,SAAS,EAAE,gCAAgC;IAC3C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — child-safety case OWNING ALIASES (§A2, Finding-H2/H3).\n//\n// The owning-alias registry is a 1:1 claim map: `childSafetyOwningAliases/{aliasId}`.\n// Intake READS this registry inside the case-open transaction; an alias already\n// claimed by a DIFFERENT case is NOT a `tx.create` throw — the two cases are\n// cross-linked instead (a `relatedCaseIds` reference stamped on both cases so the\n// operator sees they're related), and the ORIGINAL owner is kept.\n//\n// The \"one case per incident\" MERGE protocol (merge jobs, correlations, mergeState)\n// was ripped out (DJ 2026-07-02): it existed only as schema, nothing ever created a\n// merge job or wrote a correlation. PhotoDNA is pre-publication, so the report+hash\n// collision only arises via the rare operator NCII-crossover re-scan; two console\n// rows for one rare incident is acceptable, and cross-linking covers the operator's\n// need to see related cases.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A2 — no invented values,\n// no placeholders. Deterministic IDs are documented as comments; the server\n// computes them (never this schema layer).\n\nimport { z } from 'zod';\n\n// ===========================================================================\n// Canonical-key version token (folded into the deterministic id formula below).\n// Bump if its formula input set or hashing scheme changes.\n// ===========================================================================\n\n/** Version token folded into `aliasId` and `incidentKey`. */\nexport const SAFETY_ALIAS_VERSION = 'v1';\n\n// ===========================================================================\n// Cluster-local enum (§A2).\n// ===========================================================================\n\n/** OWNING alias types — ONLY these four. */\nexport const ChildSafetyOwningAliasTypeSchema = z.enum([\n 'incidentKey',\n 'rootIngest',\n 'canonicalTarget',\n 'messageRange',\n]);\nexport type ChildSafetyOwningAliasType = z.infer<typeof ChildSafetyOwningAliasTypeSchema>;\n\n// ===========================================================================\n// §A2 — OWNING aliases: childSafetyOwningAliases/{aliasId}\n// aliasId = sha256(SAFETY_ALIAS_VERSION + ':' + aliasType + ':' + canonicalValueHash)\n// incidentKey = sha256('incident-v1:' + normalizedRootIngestId + ':' +\n// normalizedOriginatingUploaderUid) (Finding-H3 hard key)\n// ===========================================================================\n\nexport const ChildSafetyOwningAliasV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n aliasType: ChildSafetyOwningAliasTypeSchema,\n canonicalValueHash: z.string(),\n createdAt: z.number(),\n}).strict();\nexport type ChildSafetyOwningAliasV1 = z.infer<typeof ChildSafetyOwningAliasV1Schema>;\n"]}
1
+ {"version":3,"file":"case-aliases.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case-aliases.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,sFAAsF;AACtF,gFAAgF;AAChF,6EAA6E;AAC7E,kFAAkF;AAClF,kEAAkE;AAClE,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,oFAAoF;AACpF,kFAAkF;AAClF,oFAAoF;AACpF,6BAA6B;AAC7B,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,UAAU;AAEV,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,gFAAgF;AAChF,2DAA2D;AAC3D,8EAA8E;AAE9E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,8EAA8E;AAC9E,4BAA4B;AAC5B,8EAA8E;AAE9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,IAAI,CAAC;IACrD,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,cAAc;CACf,CAAC,CAAC;AAGH,8EAA8E;AAC9E,2DAA2D;AAC3D,wFAAwF;AACxF,yEAAyE;AACzE,mFAAmF;AACnF,8EAA8E;AAE9E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,SAAS,EAAE,gCAAgC;IAC3C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Trust & Safety — child-safety case OWNING ALIASES (§A2, Finding-H2/H3).\n//\n// The owning-alias registry is a 1:1 claim map: `childSafetyOwningAliases/{aliasId}`.\n// Intake READS this registry inside the case-open transaction; an alias already\n// claimed by a DIFFERENT case is NOT a `tx.create` throw — the two cases are\n// cross-linked instead (a `relatedCaseIds` reference stamped on both cases so the\n// operator sees they're related), and the ORIGINAL owner is kept.\n//\n// The \"one case per incident\" MERGE protocol (merge jobs, correlations, mergeState)\n// was ripped out (DJ 2026-07-02): it existed only as schema, nothing ever created a\n// merge job or wrote a correlation. PhotoDNA is pre-publication, so the report+hash\n// collision only arises via the rare operator NCII-crossover re-scan; two console\n// rows for one rare incident is acceptable, and cross-linking covers the operator's\n// need to see related cases.\n//\n// Every shape here is transcribed verbatim from the frozen Trust & Safety spec\n// (Appendix A §A2) — no invented values, no placeholders; the durable design\n// owner is ttt-prod docs/design/csam-detection-and-response.md. Deterministic\n// IDs are documented as comments; the server computes them (never this schema\n// layer).\n\nimport { z } from 'zod';\n\n// ===========================================================================\n// Canonical-key version token (folded into the deterministic id formula below).\n// Bump if its formula input set or hashing scheme changes.\n// ===========================================================================\n\n/** Version token folded into `aliasId` and `incidentKey`. */\nexport const SAFETY_ALIAS_VERSION = 'v1';\n\n// ===========================================================================\n// Cluster-local enum (§A2).\n// ===========================================================================\n\n/** OWNING alias types — ONLY these four. */\nexport const ChildSafetyOwningAliasTypeSchema = z.enum([\n 'incidentKey',\n 'rootIngest',\n 'canonicalTarget',\n 'messageRange',\n]);\nexport type ChildSafetyOwningAliasType = z.infer<typeof ChildSafetyOwningAliasTypeSchema>;\n\n// ===========================================================================\n// §A2 — OWNING aliases: childSafetyOwningAliases/{aliasId}\n// aliasId = sha256(SAFETY_ALIAS_VERSION + ':' + aliasType + ':' + canonicalValueHash)\n// incidentKey = sha256('incident-v1:' + normalizedRootIngestId + ':' +\n// normalizedOriginatingUploaderUid) (Finding-H3 hard key)\n// ===========================================================================\n\nexport const ChildSafetyOwningAliasV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n aliasType: ChildSafetyOwningAliasTypeSchema,\n canonicalValueHash: z.string(),\n createdAt: z.number(),\n}).strict();\nexport type ChildSafetyOwningAliasV1 = z.infer<typeof ChildSafetyOwningAliasV1Schema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case.ts"],"names":[],"mappings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AC;AAM5F,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;kBAID,CAAC;AACpD,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC"}
@@ -7,9 +7,10 @@
7
7
  // in subcollections (NEVER arrays), each enforced by writing to the
8
8
  // subcollection so there is no parent array to overflow.
9
9
  //
10
- // Every shape here is transcribed verbatim from docs/code_changes_needed/
11
- // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A1b + the §A9
12
- // state-transition rules — no invented values, no placeholders.
10
+ // Every shape here is transcribed verbatim from the frozen Trust & Safety spec
11
+ // (Appendix A §A1b + the §A9 state-transition rules) — no invented values, no
12
+ // placeholders; the durable design owner is ttt-prod
13
+ // docs/design/csam-detection-and-response.md.
13
14
  //
14
15
  // SHARED enums come from ./foundation.js (the single source for every
15
16
  // cross-cluster enum); they are NEVER redefined here. This cluster IMPORTS
@@ -1 +1 @@
1
- {"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,gEAAgE;AAChE,4EAA4E;AAC5E,6EAA6E;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,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,iCAAiC,EACjC,mCAAmC,EACnC,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AA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,CAAC;KACC,WAAW,CAAC,iCAAiC,CAAC;KAC9C,WAAW,CAAC,mCAAmC,CAAC,CAAC","sourcesContent":["// Trust & Safety — the child-safety CASE spine (Appendix A §A1b, §A9).\n//\n// The split-projection case model: a reviewer list/metadata doc\n// (`childSafetyCaseList/{caseId}` — NO content, NO reporter identity) and a\n// restricted root (`childSafetyCases/{caseId}` — adds the evidence manifest,\n// the internal reason, and the lease/fencing fields). Append-only detail lives\n// in subcollections (NEVER arrays), each enforced by writing to the\n// subcollection so there is no parent array to overflow.\n//\n// Every shape here is transcribed verbatim from docs/code_changes_needed/\n// trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A1b + the §A9\n// state-transition rules — no invented values, no placeholders.\n//\n// SHARED enums come from ./foundation.js (the single source for every\n// cross-cluster enum); they are NEVER redefined here. This cluster IMPORTS\n// ReportDispositionSchema, ReportDispositionReasonCodeSchema, and\n// NcmecSubmissionStateSchema from foundation.\n//\n// Collection note: this cluster introduces NEW Firestore collections; the app\n// leg (orchestrator) wires collections.ts / path-builders.ts / registry.ts.\n// The merge/alias/correlation cluster (§A2) lives in ./case-aliases.js.\n\nimport { z } from 'zod';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n NcmecSubmissionStateSchema,\n SafetyCaseClosureV1Schema,\n TargetLocatorV1Schema,\n SafetyCrossoverLegStatusSchema,\n} from './foundation.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from './evidence.js';\nimport { LEGAL_REPORTING_DISPOSITION_CONFIRMATION } from '../../constants/safety-confirmation-phrases.js';\n\n// ===========================================================================\n// Cluster-local enums (§A1b + §A9). These are case-spine-specific value sets,\n// NOT cross-cluster; they live here, not in foundation.\n// ===========================================================================\n\n/** Incident classification on the case (§A1b). */\nexport const ChildSafetyIncidentClassSchema = z.enum([\n 'apparentCsam',\n 'enticement',\n 'minorSexTrafficking',\n 'sextortion',\n 'csamSolicitation',\n 'imminentCsea',\n 'nonReportableSafety',\n]);\nexport type ChildSafetyIncidentClass = z.infer<typeof ChildSafetyIncidentClassSchema>;\n\n/** Source-signal kind (shared by the case `sourceSignalSummary` projection and\n * the `…/sourceSignals/{signalId}` append-only rows). */\nexport const ChildSafetySignalKindSchema = z.enum([\n 'hashMatch',\n 'report',\n 'aiFlag',\n 'manual',\n 'copyMatch',\n]);\nexport type ChildSafetySignalKind = z.infer<typeof ChildSafetySignalKindSchema>;\n\n/** §A9 workStatus FSM: new → triaged → reporting → actioning → operationallyResolved.\n * `operationallyResolved` NEVER deletes the case (preservation continues).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * it is NEVER cleared on the click. The WORKER (quarantine saga / NCII removal / edge\n * serving-deny) flips the case to the terminal `operationallyResolved` ONLY on VERIFIED\n * completion (which clears the time-sensitive pin via onSafetyCaseClosed). If the saga\n * exhausts its retries (dead-letter), the case moves to `failed` — kept pinned, surfaced in\n * the Safety Console failed-jobs view, with a Restart that re-arms the job. Both are explicit\n * values (never derived). */\nexport const ChildSafetyWorkStatusSchema = z.enum([\n 'new',\n 'triaged',\n 'reporting',\n 'actioning',\n 'processing',\n 'failed',\n 'operationallyResolved',\n]);\nexport type ChildSafetyWorkStatus = z.infer<typeof ChildSafetyWorkStatusSchema>;\n\n/** §A9 preservationStatus FSM: preReportHold → statutoryHold → extendedHold? →\n * dispositionPending → destroyed. `statutoryHold` is set only at verified\n * completion; deletion is eligible only when every hold ref is released AND a\n * reviewed disposition job runs (no auto-delete at exactly one year). */\nexport const ChildSafetyPreservationStatusSchema = z.enum([\n 'preReportHold',\n 'statutoryHold',\n 'extendedHold',\n 'dispositionPending',\n 'destroyed',\n]);\nexport type ChildSafetyPreservationStatus = z.infer<typeof ChildSafetyPreservationStatusSchema>;\n\n/** §A9 accountActionStatus — the closure projection over `accountActionCommands`\n * (Finding-H5). A report-required case may not operationally close while\n * `pending`/`operatorDecisionPending`. */\nexport const ChildSafetyAccountActionStatusSchema = z.enum([\n 'noAccountActionRequired',\n 'operatorDecisionPending',\n 'pending',\n 'resolved',\n]);\nexport type ChildSafetyAccountActionStatus = z.infer<typeof ChildSafetyAccountActionStatusSchema>;\n\n/** §A1b reportState — derived list-projection of (reportDisposition + latest\n * submission.state) for admin-list rendering ONLY; NOT the source of truth for\n * whether a report is required (that is reportDisposition, §A9). */\nexport const ChildSafetyReportStateSchema = z.enum([\n 'reportAsSoonAsReasonablyPossible',\n 'submissionInProgress',\n 'completed',\n]);\nexport type ChildSafetyReportState = z.infer<typeof ChildSafetyReportStateSchema>;\n\n/** §A1b decisions[].kind — the append-only decision-log kind. `caseClosed` [EUAS-008]\n * is the terminal close decision carrying the structured closure record. */\nexport const ChildSafetyDecisionKindSchema = z.enum([\n 'workStatus',\n 'accountAction',\n 'reportDisposition',\n 'reasonUpdate',\n 'caseClosed',\n]);\nexport type ChildSafetyDecisionKind = z.infer<typeof ChildSafetyDecisionKindSchema>;\n\n/** §A1b accounts[].role on a case. */\nexport const ChildSafetyAccountRoleSchema = z.enum([\n 'uploader',\n 'requester',\n 'distributor',\n 'questionable',\n]);\nexport type ChildSafetyAccountRole = z.infer<typeof ChildSafetyAccountRoleSchema>;\n\n/** §A1b accounts[].subjectDisposition (per-account; distinct from the case-level\n * `reportDisposition`/ReportDisposition). */\nexport const ChildSafetyAccountSubjectDispositionSchema = z.enum([\n 'subject',\n 'questionable',\n 'excluded',\n]);\nexport type ChildSafetyAccountSubjectDisposition = z.infer<\n typeof ChildSafetyAccountSubjectDispositionSchema\n>;\n\n/** §A1b accounts[].platformAction. */\nexport const ChildSafetyAccountPlatformActionSchema = z.enum([\n 'none',\n 'watch',\n 'suspend',\n 'safetyLocked',\n 'ban',\n]);\nexport type ChildSafetyAccountPlatformAction = z.infer<\n typeof ChildSafetyAccountPlatformActionSchema\n>;\n\n/** §A1b ncmecSubmissions[].kind. */\nexport const ChildSafetyNcmecSubmissionKindSchema = z.enum([\n 'initial',\n 'supplemental',\n 'correction',\n]);\nexport type ChildSafetyNcmecSubmissionKind = z.infer<\n typeof ChildSafetyNcmecSubmissionKindSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionChannel — launch = MANUAL portal only (the automated ispws API\n * is a post-launch feature, not built; the speculative live-API client was removed). */\nexport const ChildSafetyNcmecCompletionChannelSchema = z.enum(['manualPortal']);\nexport type ChildSafetyNcmecCompletionChannel = z.infer<\n typeof ChildSafetyNcmecCompletionChannelSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionProofType — manual portal only at launch (no API /finish\n * reportDoneResponse; the proof is the operator-recorded portal confirmation). */\nexport const ChildSafetyNcmecCompletionProofTypeSchema = z.enum([\n 'portalConfirmation',\n]);\nexport type ChildSafetyNcmecCompletionProofType = z.infer<\n typeof ChildSafetyNcmecCompletionProofTypeSchema\n>;\n\n/** §A1b ncmecSubmissions/{id}/files[].fileInfoState. */\nexport const ChildSafetyNcmecFileInfoStateSchema = z.enum(['pending', 'sent', 'ack']);\nexport type ChildSafetyNcmecFileInfoState = z.infer<\n typeof ChildSafetyNcmecFileInfoStateSchema\n>;\n\n/** §A1b legalProcess[].kind. */\nexport const ChildSafetyLegalProcessKindSchema = z.enum([\n 'leWatch',\n 'leDataRequest',\n 'leShutdown',\n 'leDestruction',\n 'disclosure',\n]);\nexport type ChildSafetyLegalProcessKind = z.infer<typeof ChildSafetyLegalProcessKindSchema>;\n\n// ===========================================================================\n// §A1b — sourceSignalSummary (embedded privacy-safe projection on the list doc)\n// ===========================================================================\n\n/** Embedded latest-signal summary on `childSafetyCaseList` — NO content. */\nexport const ChildSafetySourceSignalSummarySchema = z.object({\n count: z.number(),\n latestKind: ChildSafetySignalKindSchema,\n latestAt: z.number(),\n}).strict();\nexport type ChildSafetySourceSignalSummary = z.infer<\n typeof ChildSafetySourceSignalSummarySchema\n>;\n\n// ===========================================================================\n// §A1b — childSafetyCaseList/{caseId} (reviewer list/metadata; NO content, NO\n// reporter identity)\n// ===========================================================================\n\nexport const ChildSafetyCaseListV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n revision: z.number(),\n canonicalIncidentKey: z.string(),\n incidentClass: ChildSafetyIncidentClassSchema,\n sourceSignalSummary: ChildSafetySourceSignalSummarySchema,\n workStatus: ChildSafetyWorkStatusSchema,\n preservationStatus: ChildSafetyPreservationStatusSchema,\n ncmecStatus: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState (no `notRequired`)\n accountActionStatus: ChildSafetyAccountActionStatusSchema,\n reportDisposition: ReportDispositionSchema, // §A9 case-level reporting determination\n reviewDueAt: z.number(),\n actualKnowledgeAt: z.number().optional(),\n reportState: ChildSafetyReportStateSchema.optional(), // derived list-projection only\n submissionCompletedAt: z.number().optional(),\n preserveUntil: z.number().optional(),\n openHoldCount: z.number(),\n // Cross-links to other cases that claimed the same owning alias (a rare operator NCII-crossover\n // re-scan collision). arrayUnion'd on both cases in the intake transaction that detected the claim;\n // the console renders these as plain links on the case view. The original alias owner is kept — the\n // colliding case never `tx.create`-throws (see childSafetyOwningAliases intake). Additive/optional.\n relatedCaseIds: z.array(z.string().min(1)).optional(),\n // [H-04 V1] Set to true when a protected-reason chat report's Worker context could not be\n // resolved at intake (text-only / Worker-down / attachment-not-ready). The case is still a\n // fully-valid protected case; context resolution is retried async. Absent = false (no pending\n // context). Cleared once context is attached. Surfaced in the safety console so the reviewer\n // knows to trigger a manual re-fetch if the async retry hasn't landed yet.\n contextResolutionPending: z.boolean().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseListV1 = z.infer<typeof ChildSafetyCaseListV1Schema>;\n\n// ===========================================================================\n// §A1b — childSafetyCases/{caseId} (restricted root; childSafetyReviewer only;\n// adds the evidence manifest, the internal reason, and the lease/fencing fields)\n// ===========================================================================\n\nexport const ChildSafetyCaseV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n evidenceManifestId: z.string().min(1),\n currentReasonInternal: z.string(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n fencingOwnerToken: z.string().min(1).optional(),\n fencingGeneration: z.number().optional(),\n // [H-04 V1] Immutable channel/message locator stored at case open when the Worker context\n // could not be resolved at intake. This is the AUTHORITATIVE source-of-truth locator that\n // the best-effort async re-fetch (and the operator's manual re-fetch) use to retrieve the\n // message text/sender. NEVER updated after creation — if context resolves, the resolved\n // context is ATTACHED to the case; this field stays unchanged as the permanent intake record.\n // Uses TargetLocatorV1 (a `guildChatMessage` or `chatAttachment` kind); absent on media-resolved\n // cases that went through the normal protected path with a ready attachment.\n chatMessageLocator: TargetLocatorV1Schema.optional(),\n // [H-04 V1] Mirror of the list-doc field — kept in sync so the restricted root can be\n // independently queried/checked without a join against childSafetyCaseList.\n contextResolutionPending: z.boolean().optional(),\n // [H-2] Per-leg persisted state for the two POST-COMMIT possible-minor crossover side-effects\n // (serving-deny + PhotoDNA) that `setNciiMinorAssessment` fans out when it opens/links this\n // parallel crossover case. Written via dotted-path update() (`crossoverLegs.servingDeny` etc.)\n // AFTER the case root is created in-tx, so an operator/reconciler can see which leg is\n // pending/done/failed and drive a replay — a leg failure never rolls back the committed\n // assessment, and the NCII removal clock is never touched. ABSENT on non-crossover cases (this\n // object exists only on a crossover child-safety case), and each leg field is absent when that\n // leg never applied (external / no-media target). The app also writes an in-transaction initial\n // `pending` marker, so the status enum includes `pending`.\n crossoverLegs: z.object({\n // Serving-deny leg: `pending` (in-tx marker) → `done` | `failed`.\n servingDeny: SafetyCrossoverLegStatusSchema.optional(),\n servingDeniedAt: z.number().optional(), // epoch ms; set when servingDeny → done\n servingDenyFailedAt: z.number().optional(), // epoch ms; set when servingDeny → failed\n servingDenyLastError: z.string().optional(), // error name captured on failure (never raw bytes/PII)\n // PhotoDNA leg: `pending` (in-tx marker) → `done` | `failed`.\n photoDna: SafetyCrossoverLegStatusSchema.optional(),\n photoDnaScannedAt: z.number().optional(), // epoch ms; set when photoDna → done\n photoDnaFailedAt: z.number().optional(), // epoch ms; set when photoDna → failed\n photoDnaLastError: z.string().optional(), // error name captured on failure\n }).strict().optional(),\n}).strict();\nexport type ChildSafetyCaseV1 = z.infer<typeof ChildSafetyCaseV1Schema>;\n\n// ===========================================================================\n// §A1b subcollections (append-only, NEVER arrays)\n// ===========================================================================\n\n/** …/sourceSignals/{signalId} — append-only source-signal row. */\nexport const ChildSafetySourceSignalV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetySignalKindSchema,\n detector: z.string().min(1).optional(),\n sourceRef: z.string(),\n actorId: z.string().min(1).optional(),\n}).strict();\nexport type ChildSafetySourceSignalV1 = z.infer<typeof ChildSafetySourceSignalV1Schema>;\n\n/** …/decisions/{decisionId} — append-only decision-log row. The actual\n * viewed-evidence ids live in …/decisions/{decisionId}/views/{viewId}. */\nexport const ChildSafetyDecisionV1Schema = z.object({\n at: z.number(),\n actorId: z.string().min(1),\n kind: ChildSafetyDecisionKindSchema,\n from: z.string(),\n to: z.string(),\n reasonInternal: z.string(),\n reasonUserFacing: z.string().optional(),\n evidenceItemsViewedCount: z.number(),\n // [EUAS-008] present only on a `caseClosed` row — the structured operator closure record\n // (outcome / summary / note + actor / timestamp) persisted when the case is closed.\n closure: SafetyCaseClosureV1Schema.optional(),\n}).strict();\nexport type ChildSafetyDecisionV1 = z.infer<typeof ChildSafetyDecisionV1Schema>;\n\n/** …/decisions/{decisionId}/views/{viewId} — the actual viewed-evidence ids\n * (kept off the decision row itself). */\nexport const ChildSafetyDecisionViewV1Schema = z.object({\n evidenceItemId: z.string().min(1),\n at: z.number(),\n}).strict();\nexport type ChildSafetyDecisionViewV1 = z.infer<typeof ChildSafetyDecisionViewV1Schema>;\n\n/** …/accounts/{uid} — per-account case record. The per-account\n * `subjectDisposition` is distinct from the case-level `reportDisposition`. */\nexport const ChildSafetyCaseAccountV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountV1 = z.infer<typeof ChildSafetyCaseAccountV1Schema>;\n\n/** …/accounts/{uid}/history/{historyId} — append-only per-account history. */\nexport const ChildSafetyCaseAccountHistoryV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n at: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountHistoryV1 = z.infer<\n typeof ChildSafetyCaseAccountHistoryV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId} — one NCMEC submission record. */\nexport const ChildSafetyNcmecSubmissionV1Schema = z.object({\n kind: ChildSafetyNcmecSubmissionKindSchema,\n state: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState\n completionChannel: ChildSafetyNcmecCompletionChannelSchema.optional(),\n submissionCompletedAt: z.number().optional(),\n completionProofType: ChildSafetyNcmecCompletionProofTypeSchema.optional(),\n completionProofRef: z.string().min(1).optional(),\n reportId: z.string().min(1).optional(),\n responseCode: z.number().optional(),\n}).strict();\nexport type ChildSafetyNcmecSubmissionV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId}/files/{fileId} — per-evidence-item file row. */\nexport const ChildSafetyNcmecSubmissionFileV1Schema = z.object({\n localEvidenceItemId: z.string().min(1),\n ncmecFileId: z.string().min(1).optional(),\n md5: z.string().min(1).optional(),\n fileInfoState: ChildSafetyNcmecFileInfoStateSchema,\n}).strict();\nexport type ChildSafetyNcmecSubmissionFileV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionFileV1Schema\n>;\n\n/** …/legalProcess/{eventId} — append-only legal-process event. */\nexport const ChildSafetyLegalProcessEventV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetyLegalProcessKindSchema,\n verifiedBy: z.string().min(1),\n instruction: z.string(),\n handedOver: z.boolean().optional(),\n}).strict();\nexport type ChildSafetyLegalProcessEventV1 = z.infer<\n typeof ChildSafetyLegalProcessEventV1Schema\n>;\n\n// ===========================================================================\n// §A9 — setReportDisposition privileged-command input (NON-DOC embedded shape).\n// Authority = `legalDispositionAuthority` (§A11 matrix); requires fresh two-step\n// reauth. Appends to …/decisions/{decisionId} with kind:'reportDisposition'.\n// `evidenceRefs` is an array capped at MAX; it MAY be empty EXCEPT for disposition\n// 'reportRequired', which requires ≥1 (enforced by the shared\n// refineReportDispositionEvidenceRefs cross-field rule, not a field-level min).\n// ===========================================================================\n\n// The base object shape (kept as a ZodObject so the callable input can `.extend` it); the exported\n// schema below adds the TWO canonical cross-field refinements (disposition↔reason pairing +\n// reportRequired⇒evidence-present).\nconst SetReportDispositionInputV1ObjectSchema = z.object({\n caseId: z.string().min(1),\n expectedRevision: z.number(),\n disposition: ReportDispositionSchema,\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // MAX derives from the ONE receipts cap (evidence.ts) — the callable + admin.ts use the same. No\n // field-level min: the reportRequired⇒non-empty rule lives in the shared cross-field refinement so\n // every other disposition may legally leave this empty.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n}).strict();\nexport const SetReportDispositionInputV1Schema = SetReportDispositionInputV1ObjectSchema\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionInputV1 = z.infer<typeof SetReportDispositionInputV1Schema>;\n\n// The PRIVILEGED CALLABLE input (`setReportDisposition`) — extends the embedded shape with the\n// interim explicit typed confirmation (stands in for the passkey two-step until [H-17]), then applies\n// the SAME shared cross-field refinements. evidenceRefs is inherited from the base (MAX-bounded,\n// empty allowed except when disposition is 'reportRequired'). Lives beside the base shape it extends.\nexport const SetReportDispositionCallableInputSchema = SetReportDispositionInputV1ObjectSchema.extend({\n confirmation: z.literal(LEGAL_REPORTING_DISPOSITION_CONFIRMATION),\n})\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionCallableInput = z.infer<typeof SetReportDispositionCallableInputSchema>;\n"]}
1
+ {"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/case.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,gEAAgE;AAChE,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,oEAAoE;AACpE,yDAAyD;AACzD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,qDAAqD;AACrD,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,2EAA2E;AAC3E,kEAAkE;AAClE,8CAA8C;AAC9C,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,iCAAiC,EACjC,mCAAmC,EACnC,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,wCAAwC,EAAE,MAAM,gDAAgD,CAAC;AAE1G,8EAA8E;AAC9E,8EAA8E;AAC9E,wDAAwD;AACxD,8EAA8E;AAE9E,kDAAkD;AAClD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC;IACnD,cAAc;IACd,YAAY;IACZ,qBAAqB;IACrB,YAAY;IACZ,kBAAkB;IAClB,cAAc;IACd,qBAAqB;CACtB,CAAC,CAAC;AAGH;yDACyD;AACzD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC;IAChD,WAAW;IAC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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 the frozen Trust & Safety spec\n// (Appendix A §A1b + the §A9 state-transition rules) — no invented values, no\n// placeholders; the durable design owner is ttt-prod\n// docs/design/csam-detection-and-response.md.\n//\n// SHARED enums come from ./foundation.js (the single source for every\n// cross-cluster enum); they are NEVER redefined here. This cluster IMPORTS\n// ReportDispositionSchema, ReportDispositionReasonCodeSchema, and\n// NcmecSubmissionStateSchema from foundation.\n//\n// Collection note: this cluster introduces NEW Firestore collections; the app\n// leg (orchestrator) wires collections.ts / path-builders.ts / registry.ts.\n// The merge/alias/correlation cluster (§A2) lives in ./case-aliases.js.\n\nimport { z } from 'zod';\nimport {\n ReportDispositionSchema,\n ReportDispositionReasonCodeSchema,\n refineReportDispositionReasonCode,\n refineReportDispositionEvidenceRefs,\n NcmecSubmissionStateSchema,\n SafetyCaseClosureV1Schema,\n TargetLocatorV1Schema,\n SafetyCrossoverLegStatusSchema,\n} from './foundation.js';\nimport { MAX_MANIFEST_NCMEC_RECEIPTS } from './evidence.js';\nimport { LEGAL_REPORTING_DISPOSITION_CONFIRMATION } from '../../constants/safety-confirmation-phrases.js';\n\n// ===========================================================================\n// Cluster-local enums (§A1b + §A9). These are case-spine-specific value sets,\n// NOT cross-cluster; they live here, not in foundation.\n// ===========================================================================\n\n/** Incident classification on the case (§A1b). */\nexport const ChildSafetyIncidentClassSchema = z.enum([\n 'apparentCsam',\n 'enticement',\n 'minorSexTrafficking',\n 'sextortion',\n 'csamSolicitation',\n 'imminentCsea',\n 'nonReportableSafety',\n]);\nexport type ChildSafetyIncidentClass = z.infer<typeof ChildSafetyIncidentClassSchema>;\n\n/** Source-signal kind (shared by the case `sourceSignalSummary` projection and\n * the `…/sourceSignals/{signalId}` append-only rows). */\nexport const ChildSafetySignalKindSchema = z.enum([\n 'hashMatch',\n 'report',\n 'aiFlag',\n 'manual',\n 'copyMatch',\n]);\nexport type ChildSafetySignalKind = z.infer<typeof ChildSafetySignalKindSchema>;\n\n/** §A9 workStatus FSM: new → triaged → reporting → actioning → operationallyResolved.\n * `operationallyResolved` NEVER deletes the case (preservation continues).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * it is NEVER cleared on the click. The WORKER (quarantine saga / NCII removal / edge\n * serving-deny) flips the case to the terminal `operationallyResolved` ONLY on VERIFIED\n * completion (which clears the time-sensitive pin via onSafetyCaseClosed). If the saga\n * exhausts its retries (dead-letter), the case moves to `failed` — kept pinned, surfaced in\n * the Safety Console failed-jobs view, with a Restart that re-arms the job. Both are explicit\n * values (never derived). */\nexport const ChildSafetyWorkStatusSchema = z.enum([\n 'new',\n 'triaged',\n 'reporting',\n 'actioning',\n 'processing',\n 'failed',\n 'operationallyResolved',\n]);\nexport type ChildSafetyWorkStatus = z.infer<typeof ChildSafetyWorkStatusSchema>;\n\n/** §A9 preservationStatus FSM: preReportHold → statutoryHold → extendedHold? →\n * dispositionPending → destroyed. `statutoryHold` is set only at verified\n * completion; deletion is eligible only when every hold ref is released AND a\n * reviewed disposition job runs (no auto-delete at exactly one year). */\nexport const ChildSafetyPreservationStatusSchema = z.enum([\n 'preReportHold',\n 'statutoryHold',\n 'extendedHold',\n 'dispositionPending',\n 'destroyed',\n]);\nexport type ChildSafetyPreservationStatus = z.infer<typeof ChildSafetyPreservationStatusSchema>;\n\n/** §A9 accountActionStatus — the closure projection over `accountActionCommands`\n * (Finding-H5). A report-required case may not operationally close while\n * `pending`/`operatorDecisionPending`. */\nexport const ChildSafetyAccountActionStatusSchema = z.enum([\n 'noAccountActionRequired',\n 'operatorDecisionPending',\n 'pending',\n 'resolved',\n]);\nexport type ChildSafetyAccountActionStatus = z.infer<typeof ChildSafetyAccountActionStatusSchema>;\n\n/** §A1b reportState — derived list-projection of (reportDisposition + latest\n * submission.state) for admin-list rendering ONLY; NOT the source of truth for\n * whether a report is required (that is reportDisposition, §A9). */\nexport const ChildSafetyReportStateSchema = z.enum([\n 'reportAsSoonAsReasonablyPossible',\n 'submissionInProgress',\n 'completed',\n]);\nexport type ChildSafetyReportState = z.infer<typeof ChildSafetyReportStateSchema>;\n\n/** §A1b decisions[].kind — the append-only decision-log kind. `caseClosed` [EUAS-008]\n * is the terminal close decision carrying the structured closure record. */\nexport const ChildSafetyDecisionKindSchema = z.enum([\n 'workStatus',\n 'accountAction',\n 'reportDisposition',\n 'reasonUpdate',\n 'caseClosed',\n]);\nexport type ChildSafetyDecisionKind = z.infer<typeof ChildSafetyDecisionKindSchema>;\n\n/** §A1b accounts[].role on a case. */\nexport const ChildSafetyAccountRoleSchema = z.enum([\n 'uploader',\n 'requester',\n 'distributor',\n 'questionable',\n]);\nexport type ChildSafetyAccountRole = z.infer<typeof ChildSafetyAccountRoleSchema>;\n\n/** §A1b accounts[].subjectDisposition (per-account; distinct from the case-level\n * `reportDisposition`/ReportDisposition). */\nexport const ChildSafetyAccountSubjectDispositionSchema = z.enum([\n 'subject',\n 'questionable',\n 'excluded',\n]);\nexport type ChildSafetyAccountSubjectDisposition = z.infer<\n typeof ChildSafetyAccountSubjectDispositionSchema\n>;\n\n/** §A1b accounts[].platformAction. */\nexport const ChildSafetyAccountPlatformActionSchema = z.enum([\n 'none',\n 'watch',\n 'suspend',\n 'safetyLocked',\n 'ban',\n]);\nexport type ChildSafetyAccountPlatformAction = z.infer<\n typeof ChildSafetyAccountPlatformActionSchema\n>;\n\n/** §A1b ncmecSubmissions[].kind. */\nexport const ChildSafetyNcmecSubmissionKindSchema = z.enum([\n 'initial',\n 'supplemental',\n 'correction',\n]);\nexport type ChildSafetyNcmecSubmissionKind = z.infer<\n typeof ChildSafetyNcmecSubmissionKindSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionChannel — launch = MANUAL portal only (the automated ispws API\n * is a post-launch feature, not built; the speculative live-API client was removed). */\nexport const ChildSafetyNcmecCompletionChannelSchema = z.enum(['manualPortal']);\nexport type ChildSafetyNcmecCompletionChannel = z.infer<\n typeof ChildSafetyNcmecCompletionChannelSchema\n>;\n\n/** §A1b ncmecSubmissions[].completionProofType — manual portal only at launch (no API /finish\n * reportDoneResponse; the proof is the operator-recorded portal confirmation). */\nexport const ChildSafetyNcmecCompletionProofTypeSchema = z.enum([\n 'portalConfirmation',\n]);\nexport type ChildSafetyNcmecCompletionProofType = z.infer<\n typeof ChildSafetyNcmecCompletionProofTypeSchema\n>;\n\n/** §A1b ncmecSubmissions/{id}/files[].fileInfoState. */\nexport const ChildSafetyNcmecFileInfoStateSchema = z.enum(['pending', 'sent', 'ack']);\nexport type ChildSafetyNcmecFileInfoState = z.infer<\n typeof ChildSafetyNcmecFileInfoStateSchema\n>;\n\n/** §A1b legalProcess[].kind. */\nexport const ChildSafetyLegalProcessKindSchema = z.enum([\n 'leWatch',\n 'leDataRequest',\n 'leShutdown',\n 'leDestruction',\n 'disclosure',\n]);\nexport type ChildSafetyLegalProcessKind = z.infer<typeof ChildSafetyLegalProcessKindSchema>;\n\n// ===========================================================================\n// §A1b — sourceSignalSummary (embedded privacy-safe projection on the list doc)\n// ===========================================================================\n\n/** Embedded latest-signal summary on `childSafetyCaseList` — NO content. */\nexport const ChildSafetySourceSignalSummarySchema = z.object({\n count: z.number(),\n latestKind: ChildSafetySignalKindSchema,\n latestAt: z.number(),\n}).strict();\nexport type ChildSafetySourceSignalSummary = z.infer<\n typeof ChildSafetySourceSignalSummarySchema\n>;\n\n// ===========================================================================\n// §A1b — childSafetyCaseList/{caseId} (reviewer list/metadata; NO content, NO\n// reporter identity)\n// ===========================================================================\n\nexport const ChildSafetyCaseListV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n revision: z.number(),\n canonicalIncidentKey: z.string(),\n incidentClass: ChildSafetyIncidentClassSchema,\n sourceSignalSummary: ChildSafetySourceSignalSummarySchema,\n workStatus: ChildSafetyWorkStatusSchema,\n preservationStatus: ChildSafetyPreservationStatusSchema,\n ncmecStatus: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState (no `notRequired`)\n accountActionStatus: ChildSafetyAccountActionStatusSchema,\n reportDisposition: ReportDispositionSchema, // §A9 case-level reporting determination\n reviewDueAt: z.number(),\n actualKnowledgeAt: z.number().optional(),\n reportState: ChildSafetyReportStateSchema.optional(), // derived list-projection only\n submissionCompletedAt: z.number().optional(),\n preserveUntil: z.number().optional(),\n openHoldCount: z.number(),\n // Cross-links to other cases that claimed the same owning alias (a rare operator NCII-crossover\n // re-scan collision). arrayUnion'd on both cases in the intake transaction that detected the claim;\n // the console renders these as plain links on the case view. The original alias owner is kept — the\n // colliding case never `tx.create`-throws (see childSafetyOwningAliases intake). Additive/optional.\n relatedCaseIds: z.array(z.string().min(1)).optional(),\n // [H-04 V1] Set to true when a protected-reason chat report's Worker context could not be\n // resolved at intake (text-only / Worker-down / attachment-not-ready). The case is still a\n // fully-valid protected case; context resolution is retried async. Absent = false (no pending\n // context). Cleared once context is attached. Surfaced in the safety console so the reviewer\n // knows to trigger a manual re-fetch if the async retry hasn't landed yet.\n contextResolutionPending: z.boolean().optional(),\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseListV1 = z.infer<typeof ChildSafetyCaseListV1Schema>;\n\n// ===========================================================================\n// §A1b — childSafetyCases/{caseId} (restricted root; childSafetyReviewer only;\n// adds the evidence manifest, the internal reason, and the lease/fencing fields)\n// ===========================================================================\n\nexport const ChildSafetyCaseV1Schema = z.object({\n schemaVersion: z.literal(1),\n caseId: z.string().min(1),\n evidenceManifestId: z.string().min(1),\n currentReasonInternal: z.string(),\n leaseOwner: z.string().min(1).optional(),\n leaseExpiresAt: z.number().optional(),\n fencingOwnerToken: z.string().min(1).optional(),\n fencingGeneration: z.number().optional(),\n // [H-04 V1] Immutable channel/message locator stored at case open when the Worker context\n // could not be resolved at intake. This is the AUTHORITATIVE source-of-truth locator that\n // the best-effort async re-fetch (and the operator's manual re-fetch) use to retrieve the\n // message text/sender. NEVER updated after creation — if context resolves, the resolved\n // context is ATTACHED to the case; this field stays unchanged as the permanent intake record.\n // Uses TargetLocatorV1 (a `guildChatMessage` or `chatAttachment` kind); absent on media-resolved\n // cases that went through the normal protected path with a ready attachment.\n chatMessageLocator: TargetLocatorV1Schema.optional(),\n // [H-04 V1] Mirror of the list-doc field — kept in sync so the restricted root can be\n // independently queried/checked without a join against childSafetyCaseList.\n contextResolutionPending: z.boolean().optional(),\n // [H-2] Per-leg persisted state for the two POST-COMMIT possible-minor crossover side-effects\n // (serving-deny + PhotoDNA) that `setNciiMinorAssessment` fans out when it opens/links this\n // parallel crossover case. Written via dotted-path update() (`crossoverLegs.servingDeny` etc.)\n // AFTER the case root is created in-tx, so an operator/reconciler can see which leg is\n // pending/done/failed and drive a replay — a leg failure never rolls back the committed\n // assessment, and the NCII removal clock is never touched. ABSENT on non-crossover cases (this\n // object exists only on a crossover child-safety case), and each leg field is absent when that\n // leg never applied (external / no-media target). The app also writes an in-transaction initial\n // `pending` marker, so the status enum includes `pending`.\n crossoverLegs: z.object({\n // Serving-deny leg: `pending` (in-tx marker) → `done` | `failed`.\n servingDeny: SafetyCrossoverLegStatusSchema.optional(),\n servingDeniedAt: z.number().optional(), // epoch ms; set when servingDeny → done\n servingDenyFailedAt: z.number().optional(), // epoch ms; set when servingDeny → failed\n servingDenyLastError: z.string().optional(), // error name captured on failure (never raw bytes/PII)\n // PhotoDNA leg: `pending` (in-tx marker) → `done` | `failed`.\n photoDna: SafetyCrossoverLegStatusSchema.optional(),\n photoDnaScannedAt: z.number().optional(), // epoch ms; set when photoDna → done\n photoDnaFailedAt: z.number().optional(), // epoch ms; set when photoDna → failed\n photoDnaLastError: z.string().optional(), // error name captured on failure\n }).strict().optional(),\n}).strict();\nexport type ChildSafetyCaseV1 = z.infer<typeof ChildSafetyCaseV1Schema>;\n\n// ===========================================================================\n// §A1b subcollections (append-only, NEVER arrays)\n// ===========================================================================\n\n/** …/sourceSignals/{signalId} — append-only source-signal row. */\nexport const ChildSafetySourceSignalV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetySignalKindSchema,\n detector: z.string().min(1).optional(),\n sourceRef: z.string(),\n actorId: z.string().min(1).optional(),\n}).strict();\nexport type ChildSafetySourceSignalV1 = z.infer<typeof ChildSafetySourceSignalV1Schema>;\n\n/** …/decisions/{decisionId} — append-only decision-log row. The actual\n * viewed-evidence ids live in …/decisions/{decisionId}/views/{viewId}. */\nexport const ChildSafetyDecisionV1Schema = z.object({\n at: z.number(),\n actorId: z.string().min(1),\n kind: ChildSafetyDecisionKindSchema,\n from: z.string(),\n to: z.string(),\n reasonInternal: z.string(),\n reasonUserFacing: z.string().optional(),\n evidenceItemsViewedCount: z.number(),\n // [EUAS-008] present only on a `caseClosed` row — the structured operator closure record\n // (outcome / summary / note + actor / timestamp) persisted when the case is closed.\n closure: SafetyCaseClosureV1Schema.optional(),\n}).strict();\nexport type ChildSafetyDecisionV1 = z.infer<typeof ChildSafetyDecisionV1Schema>;\n\n/** …/decisions/{decisionId}/views/{viewId} — the actual viewed-evidence ids\n * (kept off the decision row itself). */\nexport const ChildSafetyDecisionViewV1Schema = z.object({\n evidenceItemId: z.string().min(1),\n at: z.number(),\n}).strict();\nexport type ChildSafetyDecisionViewV1 = z.infer<typeof ChildSafetyDecisionViewV1Schema>;\n\n/** …/accounts/{uid} — per-account case record. The per-account\n * `subjectDisposition` is distinct from the case-level `reportDisposition`. */\nexport const ChildSafetyCaseAccountV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n updatedAt: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountV1 = z.infer<typeof ChildSafetyCaseAccountV1Schema>;\n\n/** …/accounts/{uid}/history/{historyId} — append-only per-account history. */\nexport const ChildSafetyCaseAccountHistoryV1Schema = z.object({\n role: ChildSafetyAccountRoleSchema,\n subjectDisposition: ChildSafetyAccountSubjectDispositionSchema,\n platformAction: ChildSafetyAccountPlatformActionSchema,\n reasonUserFacing: z.string(),\n reasonInternal: z.string(),\n at: z.number(),\n}).strict();\nexport type ChildSafetyCaseAccountHistoryV1 = z.infer<\n typeof ChildSafetyCaseAccountHistoryV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId} — one NCMEC submission record. */\nexport const ChildSafetyNcmecSubmissionV1Schema = z.object({\n kind: ChildSafetyNcmecSubmissionKindSchema,\n state: NcmecSubmissionStateSchema, // §A9 NcmecSubmissionState\n completionChannel: ChildSafetyNcmecCompletionChannelSchema.optional(),\n submissionCompletedAt: z.number().optional(),\n completionProofType: ChildSafetyNcmecCompletionProofTypeSchema.optional(),\n completionProofRef: z.string().min(1).optional(),\n reportId: z.string().min(1).optional(),\n responseCode: z.number().optional(),\n}).strict();\nexport type ChildSafetyNcmecSubmissionV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionV1Schema\n>;\n\n/** …/ncmecSubmissions/{submissionId}/files/{fileId} — per-evidence-item file row. */\nexport const ChildSafetyNcmecSubmissionFileV1Schema = z.object({\n localEvidenceItemId: z.string().min(1),\n ncmecFileId: z.string().min(1).optional(),\n md5: z.string().min(1).optional(),\n fileInfoState: ChildSafetyNcmecFileInfoStateSchema,\n}).strict();\nexport type ChildSafetyNcmecSubmissionFileV1 = z.infer<\n typeof ChildSafetyNcmecSubmissionFileV1Schema\n>;\n\n/** …/legalProcess/{eventId} — append-only legal-process event. */\nexport const ChildSafetyLegalProcessEventV1Schema = z.object({\n at: z.number(),\n kind: ChildSafetyLegalProcessKindSchema,\n verifiedBy: z.string().min(1),\n instruction: z.string(),\n handedOver: z.boolean().optional(),\n}).strict();\nexport type ChildSafetyLegalProcessEventV1 = z.infer<\n typeof ChildSafetyLegalProcessEventV1Schema\n>;\n\n// ===========================================================================\n// §A9 — setReportDisposition privileged-command input (NON-DOC embedded shape).\n// Authority = `legalDispositionAuthority` (§A11 matrix); requires fresh two-step\n// reauth. Appends to …/decisions/{decisionId} with kind:'reportDisposition'.\n// `evidenceRefs` is an array capped at MAX; it MAY be empty EXCEPT for disposition\n// 'reportRequired', which requires ≥1 (enforced by the shared\n// refineReportDispositionEvidenceRefs cross-field rule, not a field-level min).\n// ===========================================================================\n\n// The base object shape (kept as a ZodObject so the callable input can `.extend` it); the exported\n// schema below adds the TWO canonical cross-field refinements (disposition↔reason pairing +\n// reportRequired⇒evidence-present).\nconst SetReportDispositionInputV1ObjectSchema = z.object({\n caseId: z.string().min(1),\n expectedRevision: z.number(),\n disposition: ReportDispositionSchema,\n dispositionReasonCode: ReportDispositionReasonCodeSchema,\n // MAX derives from the ONE receipts cap (evidence.ts) — the callable + admin.ts use the same. No\n // field-level min: the reportRequired⇒non-empty rule lives in the shared cross-field refinement so\n // every other disposition may legally leave this empty.\n evidenceRefs: z.array(z.string().min(1)).max(MAX_MANIFEST_NCMEC_RECEIPTS),\n}).strict();\nexport const SetReportDispositionInputV1Schema = SetReportDispositionInputV1ObjectSchema\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionInputV1 = z.infer<typeof SetReportDispositionInputV1Schema>;\n\n// The PRIVILEGED CALLABLE input (`setReportDisposition`) — extends the embedded shape with the\n// interim explicit typed confirmation (stands in for the passkey two-step until [H-17]), then applies\n// the SAME shared cross-field refinements. evidenceRefs is inherited from the base (MAX-bounded,\n// empty allowed except when disposition is 'reportRequired'). Lives beside the base shape it extends.\nexport const SetReportDispositionCallableInputSchema = SetReportDispositionInputV1ObjectSchema.extend({\n confirmation: z.literal(LEGAL_REPORTING_DISPOSITION_CONFIRMATION),\n})\n .superRefine(refineReportDispositionReasonCode)\n .superRefine(refineReportDispositionEvidenceRefs);\nexport type SetReportDispositionCallableInput = z.infer<typeof SetReportDispositionCallableInputSchema>;\n"]}
@@ -12,9 +12,9 @@
12
12
  // status) with two subcollections: …/items/{itemId} and
13
13
  // …/disposition/{locationId}.
14
14
  //
15
- // Every shape here is transcribed verbatim from docs/code_changes_needed/
16
- // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A4 — no invented values, no
17
- // placeholders.
15
+ // Every shape here is transcribed verbatim from the frozen Trust & Safety spec
16
+ // (Appendix A §A4) — no invented values, no placeholders; the durable design owner
17
+ // is ttt-prod docs/design/safety-evidence-control-profile.md.
18
18
  //
19
19
  // SHARED media lineage comes from ../media-assets.js (the single canonical lineage
20
20
  // used by media, CSAM, and safety); it is NEVER redefined here.
@@ -1 +1 @@
1
- {"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/evidence.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,EAAE;AACF,mBAAmB;AACnB,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,iFAAiF;AACjF,uCAAuC;AACvC,+EAA+E;AAC/E,+EAA+E;AAC/E,iFAAiF;AACjF,4DAA4D;AAC5D,kCAAkC;AAClC,EAAE;AACF,0EAA0E;AAC1E,kFAAkF;AAClF,gBAAgB;AAChB,EAAE;AACF,mFAAmF;AACnF,gEAAgE;AAChE,EAAE;AACF,kFAAkF;AAClF,qEAAqE;AACrE,oFAAoF;AACpF,0EAA0E;AAC1E,mCAAmC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,8EAA8E;AAC9E,kFAAkF;AAClF,gFAAgF;AAChF,sFAAsF;AACtF,mDAAmD;AACnD,8EAA8E;AAE9E,gDAAgD;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,kDAAkD;AAClD,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAC9C,iEAAiE;AACjE,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEjD,8EAA8E;AAC9E,wEAAwE;AACxE,mFAAmF;AACnF,8EAA8E;AAE9E;;qEAEqE;AACrE,MAAM,CAAC,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AAE;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 (ARCH-102).\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
+ {"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/evidence.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,EAAE;AACF,mBAAmB;AACnB,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,iFAAiF;AACjF,uCAAuC;AACvC,+EAA+E;AAC/E,+EAA+E;AAC/E,iFAAiF;AACjF,4DAA4D;AAC5D,kCAAkC;AAClC,EAAE;AACF,+EAA+E;AAC/E,mFAAmF;AACnF,8DAA8D;AAC9D,EAAE;AACF,mFAAmF;AACnF,gEAAgE;AAChE,EAAE;AACF,kFAAkF;AAClF,qEAAqE;AACrE,oFAAoF;AACpF,0EAA0E;AAC1E,mCAAmC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,8EAA8E;AAC9E,kFAAkF;AAClF,gFAAgF;AAChF,sFAAsF;AACtF,mDAAmD;AACnD,8EAA8E;AAE9E,gDAAgD;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,kDAAkD;AAClD,MAAM,C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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 the frozen Trust & Safety spec\n// (Appendix A §A4) — no invented values, no placeholders; the durable design owner\n// is ttt-prod docs/design/safety-evidence-control-profile.md.\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 (ARCH-102).\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.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB;gFACgF;AAChF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;EAa7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,0EAGO,CAAC;AAE7C,gEAAgE;AAChE,eAAO,MAAM,mBAAmB;;;EAA0C,CAAC;AAC3E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;qEAEqE;AACrE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;EA2BnC,CAAC;AACH,MAAM,MAAM,kBAAkB,G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AAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,wBAAwB;;;;;EAKnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;kBAMhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;;0CAK0C;AAC1C,eAAO,MAAM,8BAA8B;;;;EAAwC,CAAC;AACpF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -4,9 +4,11 @@
4
4
  // than one T&S cluster (report spine, case spine, holds, evidence, sagas,
5
5
  // NCMEC, NCII). Cluster document-schema files import their value sets from
6
6
  // HERE so two clusters can never define the same enum with drifting values.
7
- // Every value is transcribed verbatim from docs/code_changes_needed/
8
- // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A (the frozen spec) — no
9
- // invented values, no placeholders.
7
+ // Every value is transcribed verbatim from the frozen Trust & Safety spec
8
+ // (Appendix A) — no invented values, no placeholders; the durable design owners
9
+ // are ttt-prod docs/design/csam-detection-and-response.md,
10
+ // docs/design/content-moderation-and-reporting.md, and
11
+ // docs/design/nonconsensual-intimate-imagery-and-take-it-down.md.
10
12
  //
11
13
  // Cross-boundary: these types are consumed by both functions/src and src/ in
12
14
  // ttt-prod, so they live in ttt-core (the single source of truth for the