@ttt-productions/ttt-core 0.79.36 → 0.79.37

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 (49) hide show
  1. package/dist/doc-schemas/chat-sync.d.ts +1 -0
  2. package/dist/doc-schemas/chat-sync.d.ts.map +1 -1
  3. package/dist/doc-schemas/chat-sync.js +3 -0
  4. package/dist/doc-schemas/chat-sync.js.map +1 -1
  5. package/dist/doc-schemas/commissions.d.ts +2 -0
  6. package/dist/doc-schemas/commissions.d.ts.map +1 -1
  7. package/dist/doc-schemas/commissions.js +2 -0
  8. package/dist/doc-schemas/commissions.js.map +1 -1
  9. package/dist/doc-schemas/content.d.ts +9 -0
  10. package/dist/doc-schemas/content.d.ts.map +1 -1
  11. package/dist/doc-schemas/content.js +14 -0
  12. package/dist/doc-schemas/content.js.map +1 -1
  13. package/dist/doc-schemas/moderation.d.ts +1 -1
  14. package/dist/doc-schemas/moderation.d.ts.map +1 -1
  15. package/dist/doc-schemas/moderation.js +6 -2
  16. package/dist/doc-schemas/moderation.js.map +1 -1
  17. package/dist/doc-schemas/ncii/requests.d.ts +1 -0
  18. package/dist/doc-schemas/ncii/requests.d.ts.map +1 -1
  19. package/dist/doc-schemas/ncii/requests.js +4 -0
  20. package/dist/doc-schemas/ncii/requests.js.map +1 -1
  21. package/dist/doc-schemas/registry.d.ts +208 -3
  22. package/dist/doc-schemas/registry.d.ts.map +1 -1
  23. package/dist/doc-schemas/registry.js +5 -2
  24. package/dist/doc-schemas/registry.js.map +1 -1
  25. package/dist/doc-schemas/safety/case-aliases.d.ts +2 -0
  26. package/dist/doc-schemas/safety/case-aliases.d.ts.map +1 -1
  27. package/dist/doc-schemas/safety/case-aliases.js +4 -0
  28. package/dist/doc-schemas/safety/case-aliases.js.map +1 -1
  29. package/dist/doc-schemas/safety/evidence.d.ts +375 -0
  30. package/dist/doc-schemas/safety/evidence.d.ts.map +1 -1
  31. package/dist/doc-schemas/safety/evidence.js +61 -0
  32. package/dist/doc-schemas/safety/evidence.js.map +1 -1
  33. package/dist/doc-schemas/safety/report.d.ts +89 -1
  34. package/dist/doc-schemas/safety/report.d.ts.map +1 -1
  35. package/dist/doc-schemas/safety/report.js +71 -1
  36. package/dist/doc-schemas/safety/report.js.map +1 -1
  37. package/dist/doc-schemas/user.d.ts +3 -0
  38. package/dist/doc-schemas/user.d.ts.map +1 -1
  39. package/dist/doc-schemas/user.js +7 -0
  40. package/dist/doc-schemas/user.js.map +1 -1
  41. package/dist/paths/collections.d.ts +1 -0
  42. package/dist/paths/collections.d.ts.map +1 -1
  43. package/dist/paths/collections.js +4 -0
  44. package/dist/paths/collections.js.map +1 -1
  45. package/dist/paths/path-builders.d.ts +1 -0
  46. package/dist/paths/path-builders.d.ts.map +1 -1
  47. package/dist/paths/path-builders.js +3 -0
  48. package/dist/paths/path-builders.js.map +1 -1
  49. package/package.json +1 -1
@@ -16,6 +16,7 @@ export declare const ChatChannelAuthProjectionSchema: z.ZodObject<{
16
16
  channelAuthVersion: z.ZodNumber;
17
17
  inputFingerprint: z.ZodString;
18
18
  updatedAt: z.ZodNumber;
19
+ lastReconciledAt: z.ZodOptional<z.ZodNumber>;
19
20
  }, z.core.$strip>;
20
21
  export type ChatChannelAuthProjection = z.infer<typeof ChatChannelAuthProjectionSchema>;
21
22
  export declare const ChatScopeDegradedSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"chat-sync.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;iBAW1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAUlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,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AK5F,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;iBAQtD,CAAC;AACH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC"}
@@ -23,6 +23,9 @@ export const ChatChannelAuthProjectionSchema = z.object({
23
23
  channelAuthVersion: z.number(),
24
24
  inputFingerprint: z.string(),
25
25
  updatedAt: z.number(),
26
+ // Reconcile cursor — advanced on every reconciler visit, including a no-op one, so a stuck
27
+ // window rotates. Absent until the reconciler first reaches the projection.
28
+ lastReconciledAt: z.number().optional(),
26
29
  });
27
30
  // ── chatScopeDegraded/{scopeKey} (+ causes/{causeId}) ───────────────────────
28
31
  // Exists IFF unresolvedCauseCount > 0. Grant mints fail closed while it exists.
@@ -1 +1 @@
1
- {"version":3,"file":"chat-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,+EAA+E;AAC/E,gFAAgF;AAChF,mFAAmF;AACnF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,gEAAgE;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,6GAA6G;AAC7G,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE7C,+EAA+E;AAC/E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC9C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAA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AAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC;AAGH,gFAAgF;AAChF,iFAAiF;AACjF,yFAAyF;AACzF,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,CAAC,MAAM,CAAC;IAClE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACzC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACzC,CAAC,CAAC","sourcesContent":["// Chat realtime SYNC / projection / command Firestore schemas (chat-edge-rebuild P1).\n// The chat sync / projection / command (Firestore-side) field lists are FROZEN\n// here — this file is their single source; the durable design owner is ttt-prod\n// docs/design/chat-realtime-system.md. All of these collections are Admin-SDK-only\n// (`allow read, write: if false`). Per the TTT timestamp convention every time\n// field is epoch-ms `number`; the SINGLE exception is the native-TTL `expireAt`,\n// which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check\n// does not false-flag a Timestamp object against `z.number()`).\n\nimport { z } from 'zod';\nimport { systemRoleSchema } from '../schemas/atoms.js';\n\n/** Native-TTL field — a real Firestore Timestamp (NOT epoch-ms). Absent until the terminal that sets TTL. */\nconst expireAtField = z.unknown().optional();\n\n// ── chatChannelAuthProjections/{authPairKey} ────────────────────────────────\n// Per-(user, channel) authorization FACT. Absent ⇒ removed/deny (fail-closed).\nexport const ChatChannelAuthProjectionSchema = z.object({\n channelRefScope: z.enum(['channel', 'invite']),\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string(),\n channelKey: z.string(),\n channelAuthState: z.enum(['authorized', 'removed']),\n channelAuthVersion: z.number(),\n inputFingerprint: z.string(),\n updatedAt: z.number(),\n});\nexport type ChatChannelAuthProjection = z.infer<typeof ChatChannelAuthProjectionSchema>;\n\n// ── chatScopeDegraded/{scopeKey} (+ causes/{causeId}) ───────────────────────\n// Exists IFF unresolvedCauseCount > 0. Grant mints fail closed while it exists.\nexport const ChatScopeDegradedSchema = z.object({\n scopeKey: z.string(),\n scopeKind: z.enum(['channel', 'memberInWork']),\n // channel scope carries the channelRef tuple; memberInWork carries {uid, workProjectId}.\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string().nullable(),\n unresolvedCauseCount: z.number(),\n updatedAt: z.number(),\n});\nexport type ChatScopeDegraded = z.infer<typeof ChatScopeDegradedSchema>;\n\nexport const ChatScopeDegradedCauseSchema = z.object({\n causeId: z.string(),\n kind: z.enum(['syncEvent', 'fanoutJob']),\n ref: z.string(),\n deadLetteredAt: z.number(),\n});\nexport type ChatScopeDegradedCause = z.infer<typeof ChatScopeDegradedCauseSchema>;\n\n// ── chatSyncEvents/{eventId} ────────────────────────────────────────────────\nexport const ChatSyncEventSchema = z.object({\n eventId: z.string(),\n targetDo: z.string(),\n kind: z.enum(['channelAuth', 'accountAccess', 'config', 'serverMessage']),\n version: z.number(),\n payload: z.record(z.string(), z.unknown()).nullable(),\n tombstone: z.boolean().optional(),\n payloadHash: z.string(),\n status: z.enum(['pending', 'delivered', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deliveredResult: z.record(z.string(), z.unknown()).nullable(),\n deliveredAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncEvent = z.infer<typeof ChatSyncEventSchema>;\n\n// ── chatSyncFanoutJobs/{jobId} ──────────────────────────────────────────────\nexport const ChatSyncFanoutJobSchema = z.object({\n jobId: z.string(),\n selectorKind: z.enum(['channelMembers', 'workChannelsForUser', 'policyEditAffectedUsers']),\n selectorArgs: z.object({\n workProjectId: z.string().optional(),\n channelKey: z.string().optional(),\n uid: z.string().optional(),\n }),\n causeVersion: z.number(),\n cursor: z.object({ pageIndex: z.number(), lastDocId: z.string().nullable() }),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncFanoutJob = z.infer<typeof ChatSyncFanoutJobSchema>;\n\n// ── chatMessageOutbox/{commandId} ───────────────────────────────────────────\nexport const ChatMessageOutboxSchema = z.object({\n commandId: z.string(),\n kind: z.enum(['userMsg', 'systemMsg']),\n threadRef: z.string(),\n payload: z.record(z.string(), z.unknown()),\n payloadVersion: z.number(),\n status: z.enum(['pending', 'applied', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatMessageOutbox = z.infer<typeof ChatMessageOutboxSchema>;\n\n// ── chatAdminActionCommands/{requestId} ─────────────────────────────────────\n// `requestId` IS the doc id + DO dedup key. `delivering` is NOT a lease (it sets\n// nextAttemptAt = now + DELIVERY_TIMEOUT). terminalFailureGeneration default 0.\nexport const ChatAdminActionCommandSchema = z.object({\n requestId: z.string(),\n actorUid: z.string(),\n actorMode: z.enum(['adminReview', 'adminOverride']),\n systemRole: systemRoleSchema,\n channelRef: z.record(z.string(), z.unknown()),\n messageSeq: z.number(),\n action: z.enum(['hide', 'delete']),\n caseId: z.string(),\n reason: z.string(),\n expectedMessageRevision: z.number(),\n payloadHash: z.string(),\n // `safetyRepair` is the NONTERMINAL stall loop: a RESERVED command whose reconcile\n // leg (PROBE → FINALIZE) failed past ADMIN_COMMAND_MAX_ATTEMPTS. Drained like\n // `delivering`; never dead-letters.\n state: z.enum(['queued', 'delivering', 'safetyRepair', 'applied', 'failed', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n result: z.record(z.string(), z.unknown()).nullable(),\n doRevisionId: z.string().nullable(),\n terminalFailureGeneration: z.number(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n failedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n reconciled: z.boolean(),\n reconciledAt: z.number().nullable(),\n safetyRepair: z.boolean(),\n // Monotonic counter of distinct entries into the safety-repair loop — keys the\n // per-entry idempotent failure audit.\n safetyRepairGeneration: z.number(),\n // Failed reconcile passes on an already-reserved command. Separate from\n // `attemptCount` (delivery attempts, which dead-letter); at the cap it escalates\n // once into `safetyRepair` instead of dead-lettering.\n reconcileAttemptCount: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatAdminActionCommand = z.infer<typeof ChatAdminActionCommandSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId} ────────────────────────────────────\n// Account-deletion history anonymization (Contract F; P8). Resumable + crash-safe:\n// the recorded source-manifest identity (key/hash/generation) + the three cursors\n// (scan/rewrite/delete) make every boundary restartable. jobId =\n// hash('chat-anonymize', channelDoId, epoch, anonymizedUid). `expireAt` (native TTL)\n// is set ONLY when the job reaches `done`.\n//\n// C-B1: the replacement generation is DO-OWNED — the Channel DO (single-threaded per\n// channel) allocates a DISTINCT monotonic generation per erasure off the epoch row and\n// rewrites against the CURRENT live manifest, so two erasures on one epoch chain instead\n// of colliding on a shared `anon-1` keyspace. These four fields are therefore RECORDED AT\n// SCAN (null until the DO reports/allocates them), not pinned at enqueue; if a concurrent\n// anonymization supersedes the source between scan and swap, the job resets to `scanning`\n// to re-derive against the new current manifest (keeping its own allocated generation).\nexport const ChatHistoryAnonymizationJobSchema = z.object({\n jobId: z.string(),\n channelDoId: z.string(),\n epoch: z.number(),\n anonymizedUid: z.string(),\n sourceManifestKey: z.string().nullable(),\n sourceManifestHash: z.string().nullable(),\n sourceGeneration: z.number().nullable(),\n replacementGeneration: z.number().nullable(),\n newManifestKey: z.string().nullable(),\n scanCursor: z.number(),\n rewriteCursor: z.number(),\n deleteCursor: z.number(),\n swappedAt: z.number().nullable(),\n state: z.enum(['scanning', 'rewriting', 'swapping', 'deleting', 'done', 'failed']),\n legalHoldPaused: z.boolean(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatHistoryAnonymizationJob = z.infer<typeof ChatHistoryAnonymizationJobSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal} ───────\n// The non-contiguous affected-chunk set (round-16 finding 7) — a crash after the\n// manifest swap resumes deletion from these rows + `deleteCursor` without re-listing R2.\nexport const ChatHistoryAnonymizationAffectedChunkSchema = z.object({\n chunkOrdinal: z.number(),\n sourceChunkKey: z.string(),\n sourceSha256: z.string(),\n replacementChunkKey: z.string().nullable(),\n replacementSha256: z.string().nullable(),\n rewriteState: z.enum(['pending', 'done']),\n deleteState: z.enum(['pending', 'done']),\n});\nexport type ChatHistoryAnonymizationAffectedChunk = z.infer<typeof ChatHistoryAnonymizationAffectedChunkSchema>;\n"]}
1
+ {"version":3,"file":"chat-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,+EAA+E;AAC/E,gFAAgF;AAChF,mFAAmF;AACnF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,gEAAgE;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAA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-rebuild P1).\n// The chat sync / projection / command (Firestore-side) field lists are FROZEN\n// here — this file is their single source; the durable design owner is ttt-prod\n// docs/design/chat-realtime-system.md. All of these collections are Admin-SDK-only\n// (`allow read, write: if false`). Per the TTT timestamp convention every time\n// field is epoch-ms `number`; the SINGLE exception is the native-TTL `expireAt`,\n// which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check\n// does not false-flag a Timestamp object against `z.number()`).\n\nimport { z } from 'zod';\nimport { systemRoleSchema } from '../schemas/atoms.js';\n\n/** Native-TTL field — a real Firestore Timestamp (NOT epoch-ms). Absent until the terminal that sets TTL. */\nconst expireAtField = z.unknown().optional();\n\n// ── chatChannelAuthProjections/{authPairKey} ────────────────────────────────\n// Per-(user, channel) authorization FACT. Absent ⇒ removed/deny (fail-closed).\nexport const ChatChannelAuthProjectionSchema = z.object({\n channelRefScope: z.enum(['channel', 'invite']),\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string(),\n channelKey: z.string(),\n channelAuthState: z.enum(['authorized', 'removed']),\n channelAuthVersion: z.number(),\n inputFingerprint: z.string(),\n updatedAt: z.number(),\n // Reconcile cursor — advanced on every reconciler visit, including a no-op one, so a stuck\n // window rotates. Absent until the reconciler first reaches the projection.\n lastReconciledAt: z.number().optional(),\n});\nexport type ChatChannelAuthProjection = z.infer<typeof ChatChannelAuthProjectionSchema>;\n\n// ── chatScopeDegraded/{scopeKey} (+ causes/{causeId}) ───────────────────────\n// Exists IFF unresolvedCauseCount > 0. Grant mints fail closed while it exists.\nexport const ChatScopeDegradedSchema = z.object({\n scopeKey: z.string(),\n scopeKind: z.enum(['channel', 'memberInWork']),\n // channel scope carries the channelRef tuple; memberInWork carries {uid, workProjectId}.\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string().nullable(),\n unresolvedCauseCount: z.number(),\n updatedAt: z.number(),\n});\nexport type ChatScopeDegraded = z.infer<typeof ChatScopeDegradedSchema>;\n\nexport const ChatScopeDegradedCauseSchema = z.object({\n causeId: z.string(),\n kind: z.enum(['syncEvent', 'fanoutJob']),\n ref: z.string(),\n deadLetteredAt: z.number(),\n});\nexport type ChatScopeDegradedCause = z.infer<typeof ChatScopeDegradedCauseSchema>;\n\n// ── chatSyncEvents/{eventId} ────────────────────────────────────────────────\nexport const ChatSyncEventSchema = z.object({\n eventId: z.string(),\n targetDo: z.string(),\n kind: z.enum(['channelAuth', 'accountAccess', 'config', 'serverMessage']),\n version: z.number(),\n payload: z.record(z.string(), z.unknown()).nullable(),\n tombstone: z.boolean().optional(),\n payloadHash: z.string(),\n status: z.enum(['pending', 'delivered', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deliveredResult: z.record(z.string(), z.unknown()).nullable(),\n deliveredAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncEvent = z.infer<typeof ChatSyncEventSchema>;\n\n// ── chatSyncFanoutJobs/{jobId} ──────────────────────────────────────────────\nexport const ChatSyncFanoutJobSchema = z.object({\n jobId: z.string(),\n selectorKind: z.enum(['channelMembers', 'workChannelsForUser', 'policyEditAffectedUsers']),\n selectorArgs: z.object({\n workProjectId: z.string().optional(),\n channelKey: z.string().optional(),\n uid: z.string().optional(),\n }),\n causeVersion: z.number(),\n cursor: z.object({ pageIndex: z.number(), lastDocId: z.string().nullable() }),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncFanoutJob = z.infer<typeof ChatSyncFanoutJobSchema>;\n\n// ── chatMessageOutbox/{commandId} ───────────────────────────────────────────\nexport const ChatMessageOutboxSchema = z.object({\n commandId: z.string(),\n kind: z.enum(['userMsg', 'systemMsg']),\n threadRef: z.string(),\n payload: z.record(z.string(), z.unknown()),\n payloadVersion: z.number(),\n status: z.enum(['pending', 'applied', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatMessageOutbox = z.infer<typeof ChatMessageOutboxSchema>;\n\n// ── chatAdminActionCommands/{requestId} ─────────────────────────────────────\n// `requestId` IS the doc id + DO dedup key. `delivering` is NOT a lease (it sets\n// nextAttemptAt = now + DELIVERY_TIMEOUT). terminalFailureGeneration default 0.\nexport const ChatAdminActionCommandSchema = z.object({\n requestId: z.string(),\n actorUid: z.string(),\n actorMode: z.enum(['adminReview', 'adminOverride']),\n systemRole: systemRoleSchema,\n channelRef: z.record(z.string(), z.unknown()),\n messageSeq: z.number(),\n action: z.enum(['hide', 'delete']),\n caseId: z.string(),\n reason: z.string(),\n expectedMessageRevision: z.number(),\n payloadHash: z.string(),\n // `safetyRepair` is the NONTERMINAL stall loop: a RESERVED command whose reconcile\n // leg (PROBE → FINALIZE) failed past ADMIN_COMMAND_MAX_ATTEMPTS. Drained like\n // `delivering`; never dead-letters.\n state: z.enum(['queued', 'delivering', 'safetyRepair', 'applied', 'failed', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n result: z.record(z.string(), z.unknown()).nullable(),\n doRevisionId: z.string().nullable(),\n terminalFailureGeneration: z.number(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n failedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n reconciled: z.boolean(),\n reconciledAt: z.number().nullable(),\n safetyRepair: z.boolean(),\n // Monotonic counter of distinct entries into the safety-repair loop — keys the\n // per-entry idempotent failure audit.\n safetyRepairGeneration: z.number(),\n // Failed reconcile passes on an already-reserved command. Separate from\n // `attemptCount` (delivery attempts, which dead-letter); at the cap it escalates\n // once into `safetyRepair` instead of dead-lettering.\n reconcileAttemptCount: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatAdminActionCommand = z.infer<typeof ChatAdminActionCommandSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId} ────────────────────────────────────\n// Account-deletion history anonymization (Contract F; P8). Resumable + crash-safe:\n// the recorded source-manifest identity (key/hash/generation) + the three cursors\n// (scan/rewrite/delete) make every boundary restartable. jobId =\n// hash('chat-anonymize', channelDoId, epoch, anonymizedUid). `expireAt` (native TTL)\n// is set ONLY when the job reaches `done`.\n//\n// C-B1: the replacement generation is DO-OWNED — the Channel DO (single-threaded per\n// channel) allocates a DISTINCT monotonic generation per erasure off the epoch row and\n// rewrites against the CURRENT live manifest, so two erasures on one epoch chain instead\n// of colliding on a shared `anon-1` keyspace. These four fields are therefore RECORDED AT\n// SCAN (null until the DO reports/allocates them), not pinned at enqueue; if a concurrent\n// anonymization supersedes the source between scan and swap, the job resets to `scanning`\n// to re-derive against the new current manifest (keeping its own allocated generation).\nexport const ChatHistoryAnonymizationJobSchema = z.object({\n jobId: z.string(),\n channelDoId: z.string(),\n epoch: z.number(),\n anonymizedUid: z.string(),\n sourceManifestKey: z.string().nullable(),\n sourceManifestHash: z.string().nullable(),\n sourceGeneration: z.number().nullable(),\n replacementGeneration: z.number().nullable(),\n newManifestKey: z.string().nullable(),\n scanCursor: z.number(),\n rewriteCursor: z.number(),\n deleteCursor: z.number(),\n swappedAt: z.number().nullable(),\n state: z.enum(['scanning', 'rewriting', 'swapping', 'deleting', 'done', 'failed']),\n legalHoldPaused: z.boolean(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatHistoryAnonymizationJob = z.infer<typeof ChatHistoryAnonymizationJobSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal} ───────\n// The non-contiguous affected-chunk set (round-16 finding 7) — a crash after the\n// manifest swap resumes deletion from these rows + `deleteCursor` without re-listing R2.\nexport const ChatHistoryAnonymizationAffectedChunkSchema = z.object({\n chunkOrdinal: z.number(),\n sourceChunkKey: z.string(),\n sourceSha256: z.string(),\n replacementChunkKey: z.string().nullable(),\n replacementSha256: z.string().nullable(),\n rewriteState: z.enum(['pending', 'done']),\n deleteState: z.enum(['pending', 'done']),\n});\nexport type ChatHistoryAnonymizationAffectedChunk = z.infer<typeof ChatHistoryAnonymizationAffectedChunkSchema>;\n"]}
@@ -40,6 +40,7 @@ export declare const FullCommissionListingSchema: z.ZodObject<{
40
40
  open: "open";
41
41
  closed: "closed";
42
42
  }>;
43
+ closedAt: z.ZodOptional<z.ZodNumber>;
43
44
  savedProposalArtisans: z.ZodArray<z.ZodString>;
44
45
  shortId: z.ZodOptional<z.ZodString>;
45
46
  shortUrl: z.ZodOptional<z.ZodString>;
@@ -143,6 +144,7 @@ export declare const AuditionSchema: z.ZodObject<{
143
144
  closed: "closed";
144
145
  pendingReview: "pendingReview";
145
146
  }>;
147
+ closedAt: z.ZodOptional<z.ZodNumber>;
146
148
  auditionEntryCount: z.ZodOptional<z.ZodNumber>;
147
149
  shortId: z.ZodOptional<z.ZodString>;
148
150
  shortUrl: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"commissions.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAUrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBtC,CAAC;AACH,MAAM,MAAM,qBAAqB,G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;;;;;;;;;;;;;;;;;;;;;;iBA0BtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;iBAkBnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAS1E,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMnD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G,eAAO,MAAM,kBAAkB;;;;EAAoE,CAAC;AACpG,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+CzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;iBAmB9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB;;;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -35,6 +35,7 @@ export const FullCommissionListingSchema = z.object({
35
35
  type: z.string(),
36
36
  }),
37
37
  status: z.enum(['open', 'closed']),
38
+ closedAt: z.number().optional(), // set by the close write, together with status 'closed'
38
39
  savedProposalArtisans: z.array(z.string()),
39
40
  shortId: z.string().optional(),
40
41
  shortUrl: z.string().optional(),
@@ -116,6 +117,7 @@ export const AuditionSchema = z.object({
116
117
  sponsoredAuditionAmountUSD: z.number().optional(),
117
118
  stakeSharesOffered: z.number().optional(),
118
119
  status: z.enum(['open', 'closed', 'pendingReview']),
120
+ closedAt: z.number().optional(), // set by the close write, together with status 'closed'
119
121
  auditionEntryCount: z.number().optional(),
120
122
  shortId: z.string().optional(),
121
123
  shortUrl: z.string().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"commissions.js","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qFAAqF;AACrF,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,+EAA+E;IAC/E,yFAAyF;IACzF,wFAAwF;IACxF,8CAA8C;IAC9C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,oBAAoB,EAAE,0BAA0B,CAAC,QAAQ,EAAE;IAC3D,w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,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,gFAAgF;IAChF,+CAA+C;IAC/C,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,wFAAwF;IACxF,gFAAgF;IAChF,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,kFAAkF;IAClF,+FAA+F;IAC/F,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,iFAAiF;IACjF,kDAAkD;IAClD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,2BAA2B,EAAE,aAAa;CAC3C,CAAC,CAAC","sourcesContent":["// Commission + Audition Firestore document SCHEMAS — commissionListings/{id} and its\n// commissionProposals, auditionBoard/{id} and its auditionEntries, plus the per-user\n// auditionVotes doc. Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { CommissionProposalStatusSchema } from '../schemas/commissions.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\nexport const CommissionAttachmentSchema = z.object({\n pendingMediaId: z.string().optional(),\n name: z.string(),\n mediaAssetId: z.string(),\n // The stored content kind (image/video/audio). Set once by the upload pipeline\n // (getSimplifiedMediaType) and written by the commissionListingMedia publication adapter\n // as z.enum(['image','video','audio']); derived here from the ONE canonical stored-kind\n // union (ARCH-102), never a widened `string`.\n type: ContentMediaKindSchema,\n size: z.number(),\n});\nexport type CommissionAttachment = z.infer<typeof CommissionAttachmentSchema>;\n\nexport const FullCommissionListingSchema = z.object({\n commissionListingId: z.string(),\n title: z.string(),\n description: z.string(),\n commissionAttachment: CommissionAttachmentSchema.optional(),\n requiredTradeProfessions: z.array(z.string()),\n stakeSharesOffered: z.number(),\n createdAt: z.number(),\n createdBy: userRefSchema,\n // Work reference only — title/description are NOT snapshotted (Display Identity Invariant:\n // resolve at render from publicWorkProjects by id, fallback label if the work is gone).\n // `type` (Tales/Tunes/Television) is an immutable classification, not display text, and IS\n // consumed by a commission-board type filter/index, so it stays — mirroring the\n // GuildInviteConversation `workProject: { workProjectId, type }` precedent.\n workProjectAssociatedWith: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n status: z.enum(['open', 'closed']),\n savedProposalArtisans: z.array(z.string()),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the listing is suppressed from\n // the commission board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type FullCommissionListing = z.infer<typeof FullCommissionListingSchema>;\n\nexport const CommissionProposalSchema = z.object({\n commissionProposalId: z.string(),\n commissionListingId: z.string(),\n workProjectId: z.string(),\n proposalText: z.string(),\n proposalFileAssetId: z.string().optional(),\n proposalFileType: z.string().optional(),\n createdBy: userRefSchema,\n createdOn: z.number(),\n status: CommissionProposalStatusSchema,\n guildInviteId: z.string().optional(),\n invitedOn: z.number().optional(),\n acceptedOn: z.number().optional(),\n rejectedAt: z.number().optional(),\n // [EUAS-006] Admin moderation hide (reversible) — matches the listing/audition/entry pattern. When\n // true the proposal's TEXT is suppressed from the board (tombstoned for ordinary viewers); restored\n // by clearing it. Optional so existing/seeded proposals don't need backfilling pre-launch.\n hidden: z.boolean().optional(),\n});\nexport type CommissionProposal = z.infer<typeof CommissionProposalSchema>;\n\n// Authoritative result of the createCommissionProposalText callable — the created item,\n// exactly as the transaction committed it; the client seeds its proposal caches from this\n// instead of refetching. Declared HERE (not schemas/commissions.ts) because it composes\n// CommissionProposalSchema and this module already imports schemas/commissions.js\n// (CommissionProposalStatusSchema) — the reverse runtime import would be a module cycle.\n// Re-exported on the ./schemas subpath via schemas/index.ts. Non-strict (server → client\n// result posture).\nexport const CreateCommissionProposalTextResultSchema = z.object({\n success: z.literal(true),\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n /** The proposal doc exactly as committed. */\n proposal: CommissionProposalSchema,\n});\nexport type CreateCommissionProposalTextResult = z.infer<typeof CreateCommissionProposalTextResultSchema>;\n\nexport const AuditionTypeSchema = z.enum(['platformAudition', 'sponsoredAudition', 'workAudition']);\nexport type AuditionType = z.infer<typeof AuditionTypeSchema>;\n\nexport const AuditionSchema = z.object({\n auditionId: z.string(),\n type: AuditionTypeSchema,\n title: z.string(),\n description: z.string(),\n videoAssetId: z.string(),\n // Auditions are VIDEO ONLY (DJ ruling). Paired with the required videoAssetId (both\n // always present — the MEDIA-101 shape, not a required-asset/optional-kind mismatch),\n // derived from the ONE canonical stored-kind union narrowed to video — never an inline\n // re-declared union (ARCH-102).\n mediaType: ContentMediaKindSchema.extract(['video']),\n openTill: z.number(),\n createdOn: z.number(),\n createdBy: userRefSchema,\n workProjectId: z.string().optional(),\n // Curated vs open. 'open' (default when absent — existing auditions): anyone may post reply\n // entries AND vote. 'curated': the creating work posts the option entries itself (min 2, max 8,\n // each `isCreatorOption: true`) and users may ONLY vote — community reply entries are rejected.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated atomic-reveal state (only meaningful when mode === 'curated'). The prompt + all N option\n // videos upload as ONE fixed batch; the audition stays non-votable + off the public board until the\n // WHOLE batch is live and every video passed moderation:\n // 'assembling' — batch still processing/moderating; not votable, not on the board (status stays\n // 'pendingReview'), only the creator sees a \"preparing…\" state.\n // 'ready' — all N+1 landed and approved; app flips status → 'open' and the audition reveals.\n // 'failed' — any video in the batch was rejected by moderation; the whole audition fails.\n // status stays non-open; only the creator sees it (on the project page) to Edit &\n // resubmit or Discard.\n // 'closed' — a curated audition that was closed (by its creator or an admin) after reveal;\n // terminal, kept for record. Distinct from the pre-reveal assembly states above.\n curatedAssemblyStatus: z.enum(['assembling', 'ready', 'failed', 'closed']).optional(),\n // The fixed number of creator option videos submitted at create-time (2..8). Used to know when the\n // whole batch has landed (all expected entries approved → reveal).\n expectedOptionCount: z.number().int().optional(),\n // Set when curatedAssemblyStatus === 'failed': which video was rejected, for the creator-only\n // failed-audition surface on the project page.\n curatedFailureReason: z.string().optional(),\n sponsoredAuditionAmountUSD: z.number().optional(),\n stakeSharesOffered: z.number().optional(),\n status: z.enum(['open', 'closed', 'pendingReview']),\n auditionEntryCount: z.number().optional(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the audition is suppressed from\n // the audition board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type Audition = z.infer<typeof AuditionSchema>;\n\nexport const AuditionEntrySchema = z.object({\n auditionEntryId: z.string(),\n auditionId: z.string(),\n workProjectId: z.string().optional(),\n videoAssetId: z.string(),\n // Audition entries are VIDEO ONLY (DJ ruling) — same video-only pairing as the audition\n // prompt above; derived from the canonical stored-kind union narrowed to video.\n mediaType: ContentMediaKindSchema.extract(['video']),\n createdBy: userRefSchema,\n createdAt: z.number(),\n votes: z.number(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Curated-mode option: true when this entry is a work-authored voting option on a\n // `mode: 'curated'` audition (posted by the creating work at creation), not a community reply.\n isCreatorOption: z.boolean().optional(),\n // Admin moderation hide (reversible). When true the entry is suppressed from the\n // audition's entry list; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type AuditionEntry = z.infer<typeof AuditionEntrySchema>;\n\nexport const UserAuditionVoteSchema = z.object({\n votedForAuditionEntryId: z.string(),\n votedOn: z.number(),\n auditionEntryArtisanCreator: userRefSchema,\n});\nexport type UserAuditionVote = z.infer<typeof UserAuditionVoteSchema>;\n"]}
1
+ {"version":3,"file":"commissions.js","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qFAAqF;AACrF,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,+EAA+E;IAC/E,yFAAyF;IACzF,wFAAwF;IACxF,8CAA8C;IAC9C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAA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M,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,2BAA2B,EAAE,aAAa;CAC3C,CAAC,CAAC","sourcesContent":["// Commission + Audition Firestore document SCHEMAS — commissionListings/{id} and its\n// commissionProposals, auditionBoard/{id} and its auditionEntries, plus the per-user\n// auditionVotes doc. Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { CommissionProposalStatusSchema } from '../schemas/commissions.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\nexport const CommissionAttachmentSchema = z.object({\n pendingMediaId: z.string().optional(),\n name: z.string(),\n mediaAssetId: z.string(),\n // The stored content kind (image/video/audio). Set once by the upload pipeline\n // (getSimplifiedMediaType) and written by the commissionListingMedia publication adapter\n // as z.enum(['image','video','audio']); derived here from the ONE canonical stored-kind\n // union (ARCH-102), never a widened `string`.\n type: ContentMediaKindSchema,\n size: z.number(),\n});\nexport type CommissionAttachment = z.infer<typeof CommissionAttachmentSchema>;\n\nexport const FullCommissionListingSchema = z.object({\n commissionListingId: z.string(),\n title: z.string(),\n description: z.string(),\n commissionAttachment: CommissionAttachmentSchema.optional(),\n requiredTradeProfessions: z.array(z.string()),\n stakeSharesOffered: z.number(),\n createdAt: z.number(),\n createdBy: userRefSchema,\n // Work reference only — title/description are NOT snapshotted (Display Identity Invariant:\n // resolve at render from publicWorkProjects by id, fallback label if the work is gone).\n // `type` (Tales/Tunes/Television) is an immutable classification, not display text, and IS\n // consumed by a commission-board type filter/index, so it stays — mirroring the\n // GuildInviteConversation `workProject: { workProjectId, type }` precedent.\n workProjectAssociatedWith: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n status: z.enum(['open', 'closed']),\n closedAt: z.number().optional(), // set by the close write, together with status 'closed'\n savedProposalArtisans: z.array(z.string()),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the listing is suppressed from\n // the commission board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type FullCommissionListing = z.infer<typeof FullCommissionListingSchema>;\n\nexport const CommissionProposalSchema = z.object({\n commissionProposalId: z.string(),\n commissionListingId: z.string(),\n workProjectId: z.string(),\n proposalText: z.string(),\n proposalFileAssetId: z.string().optional(),\n proposalFileType: z.string().optional(),\n createdBy: userRefSchema,\n createdOn: z.number(),\n status: CommissionProposalStatusSchema,\n guildInviteId: z.string().optional(),\n invitedOn: z.number().optional(),\n acceptedOn: z.number().optional(),\n rejectedAt: z.number().optional(),\n // [EUAS-006] Admin moderation hide (reversible) — matches the listing/audition/entry pattern. When\n // true the proposal's TEXT is suppressed from the board (tombstoned for ordinary viewers); restored\n // by clearing it. Optional so existing/seeded proposals don't need backfilling pre-launch.\n hidden: z.boolean().optional(),\n});\nexport type CommissionProposal = z.infer<typeof CommissionProposalSchema>;\n\n// Authoritative result of the createCommissionProposalText callable — the created item,\n// exactly as the transaction committed it; the client seeds its proposal caches from this\n// instead of refetching. Declared HERE (not schemas/commissions.ts) because it composes\n// CommissionProposalSchema and this module already imports schemas/commissions.js\n// (CommissionProposalStatusSchema) — the reverse runtime import would be a module cycle.\n// Re-exported on the ./schemas subpath via schemas/index.ts. Non-strict (server → client\n// result posture).\nexport const CreateCommissionProposalTextResultSchema = z.object({\n success: z.literal(true),\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n /** The proposal doc exactly as committed. */\n proposal: CommissionProposalSchema,\n});\nexport type CreateCommissionProposalTextResult = z.infer<typeof CreateCommissionProposalTextResultSchema>;\n\nexport const AuditionTypeSchema = z.enum(['platformAudition', 'sponsoredAudition', 'workAudition']);\nexport type AuditionType = z.infer<typeof AuditionTypeSchema>;\n\nexport const AuditionSchema = z.object({\n auditionId: z.string(),\n type: AuditionTypeSchema,\n title: z.string(),\n description: z.string(),\n videoAssetId: z.string(),\n // Auditions are VIDEO ONLY (DJ ruling). Paired with the required videoAssetId (both\n // always present — the MEDIA-101 shape, not a required-asset/optional-kind mismatch),\n // derived from the ONE canonical stored-kind union narrowed to video — never an inline\n // re-declared union (ARCH-102).\n mediaType: ContentMediaKindSchema.extract(['video']),\n openTill: z.number(),\n createdOn: z.number(),\n createdBy: userRefSchema,\n workProjectId: z.string().optional(),\n // Curated vs open. 'open' (default when absent — existing auditions): anyone may post reply\n // entries AND vote. 'curated': the creating work posts the option entries itself (min 2, max 8,\n // each `isCreatorOption: true`) and users may ONLY vote — community reply entries are rejected.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated atomic-reveal state (only meaningful when mode === 'curated'). The prompt + all N option\n // videos upload as ONE fixed batch; the audition stays non-votable + off the public board until the\n // WHOLE batch is live and every video passed moderation:\n // 'assembling' — batch still processing/moderating; not votable, not on the board (status stays\n // 'pendingReview'), only the creator sees a \"preparing…\" state.\n // 'ready' — all N+1 landed and approved; app flips status → 'open' and the audition reveals.\n // 'failed' — any video in the batch was rejected by moderation; the whole audition fails.\n // status stays non-open; only the creator sees it (on the project page) to Edit &\n // resubmit or Discard.\n // 'closed' — a curated audition that was closed (by its creator or an admin) after reveal;\n // terminal, kept for record. Distinct from the pre-reveal assembly states above.\n curatedAssemblyStatus: z.enum(['assembling', 'ready', 'failed', 'closed']).optional(),\n // The fixed number of creator option videos submitted at create-time (2..8). Used to know when the\n // whole batch has landed (all expected entries approved → reveal).\n expectedOptionCount: z.number().int().optional(),\n // Set when curatedAssemblyStatus === 'failed': which video was rejected, for the creator-only\n // failed-audition surface on the project page.\n curatedFailureReason: z.string().optional(),\n sponsoredAuditionAmountUSD: z.number().optional(),\n stakeSharesOffered: z.number().optional(),\n status: z.enum(['open', 'closed', 'pendingReview']),\n closedAt: z.number().optional(), // set by the close write, together with status 'closed'\n auditionEntryCount: z.number().optional(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the audition is suppressed from\n // the audition board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type Audition = z.infer<typeof AuditionSchema>;\n\nexport const AuditionEntrySchema = z.object({\n auditionEntryId: z.string(),\n auditionId: z.string(),\n workProjectId: z.string().optional(),\n videoAssetId: z.string(),\n // Audition entries are VIDEO ONLY (DJ ruling) — same video-only pairing as the audition\n // prompt above; derived from the canonical stored-kind union narrowed to video.\n mediaType: ContentMediaKindSchema.extract(['video']),\n createdBy: userRefSchema,\n createdAt: z.number(),\n votes: z.number(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Curated-mode option: true when this entry is a work-authored voting option on a\n // `mode: 'curated'` audition (posted by the creating work at creation), not a community reply.\n isCreatorOption: z.boolean().optional(),\n // Admin moderation hide (reversible). When true the entry is suppressed from the\n // audition's entry list; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type AuditionEntry = z.infer<typeof AuditionEntrySchema>;\n\nexport const UserAuditionVoteSchema = z.object({\n votedForAuditionEntryId: z.string(),\n votedOn: z.number(),\n auditionEntryArtisanCreator: userRefSchema,\n});\nexport type UserAuditionVote = z.infer<typeof UserAuditionVoteSchema>;\n"]}
@@ -136,6 +136,15 @@ export declare const ThresholdItemSchema: z.ZodObject<{
136
136
  reviewedAt: z.ZodOptional<z.ZodNumber>;
137
137
  reviewedBy: z.ZodOptional<z.ZodString>;
138
138
  hasRealPeople: z.ZodBoolean;
139
+ attestConsistentFormat: z.ZodLiteral<true>;
140
+ attestNoCredits: z.ZodLiteral<true>;
141
+ attestNoBegging: z.ZodLiteral<true>;
142
+ attestHumanMadeOriginal: z.ZodLiteral<true>;
143
+ attestedAt: z.ZodNumber;
144
+ confirmedNoBegging: z.ZodOptional<z.ZodLiteral<true>>;
145
+ confirmedNoCredits: z.ZodOptional<z.ZodLiteral<true>>;
146
+ confirmedConsistentFormat: z.ZodOptional<z.ZodLiteral<true>>;
147
+ confirmedRealPeopleAttestation: z.ZodOptional<z.ZodLiteral<true>>;
139
148
  }, z.core.$strip>;
140
149
  export type ThresholdItem = z.infer<typeof ThresholdItemSchema>;
141
150
  /** The published hall-content surfaces whose TEXT fields a change request (and the
@@ -1 +1 @@
1
- {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wBAAwB,CAAC,CAAC;AAE1E,+GAA+G;AAC/G,eAAO,MAAM,uBAAuB;;;;;;;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -116,6 +116,20 @@ export const ThresholdItemSchema = z.object({
116
116
  // published items is the ONE standard platform message
117
117
  // (REAL_PEOPLE_DISCLAIMER_MESSAGE) — there is no free-text disclaimer anywhere.
118
118
  hasRealPeople: z.boolean(),
119
+ // Submission attestations — REQUIRED. The submit core refuses a submission unless the artisan
120
+ // ticks all four, then stores each as the literal `true` with the moment they were given. A
121
+ // threshold item without them is not a valid submission.
122
+ attestConsistentFormat: z.literal(true),
123
+ attestNoCredits: z.literal(true),
124
+ attestNoBegging: z.literal(true),
125
+ attestHumanMadeOriginal: z.literal(true),
126
+ attestedAt: z.number(),
127
+ // Reviewer confirmations — stamped `true` together by the APPROVAL write and never otherwise,
128
+ // so their presence means the item was approved with all four checks confirmed.
129
+ confirmedNoBegging: z.literal(true).optional(),
130
+ confirmedNoCredits: z.literal(true).optional(),
131
+ confirmedConsistentFormat: z.literal(true).optional(),
132
+ confirmedRealPeopleAttestation: z.literal(true).optional(),
119
133
  });
120
134
  // --- Published change requests (launch: text-only) ---
121
135
  /** The published hall-content surfaces whose TEXT fields a change request (and the
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/doc-schemas/content.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+EAA+E;AAC/E,qFAAqF;AACrF,sFAAsF;AACtF,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,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,EAAE;CAC/B,CAAC,CAAC;AAGH,+FAA+F;AAC/F,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,2EAA2E;AAC3E,+EAA+E;AAC/E,uEAAuE;AACvE,oEAAoE;AAEpE,8FAA8F;AAC9F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,mDAAmD;IACnD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAGH,+GAA+G;AAC/G,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAC5C,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["// Content Firestore document SCHEMAS — Tales/Tunes/Television sub-documents, the\n// Threshold + Hall library item shapes, Hall library user preferences, and the\n// `_config` singleton docs (futurePlans, rulesAndAgreements). Types are inferred via\n// z.infer. The enum-key consts (HALL_WING_TYPE_KEYS / WORK_PROJECT_TYPE_KEYS) and the\n// UI-only filter/view types remain in ../types/content.ts.\n\nimport { z } from 'zod';\nimport { HALL_WING_TYPE_KEYS, WORK_PROJECT_TYPE_KEYS } from '../types/content.js';\n\nconst contentStatusSchema = z.enum(['unpublished', 'pending_approval', 'published']);\n\n// Per-field moderation text-clear remedy (shared shape across the content family — Tale/Tune/\n// Television details, their chapter/track/episode sub-items, and the published Hall projections of\n// both). `moderationClearedFields` lists which text fields (e.g. 'title', 'description', 'content')\n// an admin cleared to a neutral placeholder and which now await steward re-entry; empty/absent when\n// nothing was cleared. `moderationClearedReason` is the operator's reason, surfaced on the member's\n// edit surface. Extends the workProject/workRealm placeholder remedy per-field. Backend-only-writable.\nconst moderationClearedFieldsShape = {\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n};\n\nexport const ItemsKeySchema = z.enum(['tuneTracks', 'chapters', 'televisionEpisodes']);\nexport type ItemsKey = z.infer<typeof ItemsKeySchema>;\n\n// --- WorkProject content sub-docs ---\n\nexport const FullTaleSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string(),\n createdOn: z.number(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()).optional(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTale = z.infer<typeof FullTaleSchema>;\n\nexport const FullChapterSchema = z.object({\n uid: z.string(),\n title: z.string(),\n content: z.string(),\n description: z.string(),\n order: z.number(),\n photoAssetId: z.string().optional(),\n status: contentStatusSchema,\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullChapter = z.infer<typeof FullChapterSchema>;\n\nexport const FullTuneSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()),\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTune = z.infer<typeof FullTuneSchema>;\n\nexport const FullTuneTrackSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string().optional(),\n audioAssetId: z.string().optional(),\n mediaType: z.string().optional(),\n order: z.number(),\n photoAssetId: z.string().optional(),\n status: contentStatusSchema,\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTuneTrack = z.infer<typeof FullTuneTrackSchema>;\n\nexport const FullTelevisionSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string(),\n createdOn: z.number(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()),\n ...moderationClearedFieldsShape,\n});\nexport type FullTelevision = z.infer<typeof FullTelevisionSchema>;\n\nexport const FullTelevisionEpisodeSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string().optional(),\n videoAssetId: z.string(),\n mediaType: z.string().optional(),\n order: z.number(),\n photoAssetId: z.string().optional(),\n status: contentStatusSchema,\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTelevisionEpisode = z.infer<typeof FullTelevisionEpisodeSchema>;\n\n// --- Threshold + Hall library items ---\n\n/** `allWorkProjects/{workProjectId}/hallSubmissionReservation/reservation` — the Work's ONE\n * hall-entry reservation, created (never updated) inside the first threshold submit's\n * transaction; every later submit converges on its `hallItemId`. Backend-only. */\nexport const HallSubmissionReservationSchema = z.object({\n hallItemId: z.string().min(1),\n createdAt: z.number(),\n}).strict();\nexport type HallSubmissionReservation = z.infer<typeof HallSubmissionReservationSchema>;\n\nexport const ThresholdItemSchema = z.object({\n thresholdItemId: z.string(),\n hallItemId: z.string(),\n workProjectId: z.string(),\n workProjectType: z.enum(WORK_PROJECT_TYPE_KEYS),\n itemId: z.string(),\n itemsKey: ItemsKeySchema,\n order: z.number(),\n hallWingType: z.enum(HALL_WING_TYPE_KEYS),\n submittedAt: z.number(),\n reviewStatus: z.enum(['pending', 'needs_revision', 'approved']),\n adminNotes: z.string().optional(),\n reviewedAt: z.number().optional(),\n reviewedBy: z.string().optional(),\n // Parody / real-people AUTHOR ATTESTATION (R3, 2026-07-12). The submitting artisan\n // attests at threshold SUBMIT time that this work depicts real people (parody /\n // satire / commentary); stored with the submission and displayed READ-ONLY to the\n // reviewer. Admins never set or edit it — a reviewer who believes the flag is\n // needed and missing sends the item back needs-revision. The disclaimer shown on\n // published items is the ONE standard platform message\n // (REAL_PEOPLE_DISCLAIMER_MESSAGE) — there is no free-text disclaimer anywhere.\n hasRealPeople: z.boolean(),\n});\nexport type ThresholdItem = z.infer<typeof ThresholdItemSchema>;\n\n// --- Published change requests (launch: text-only) ---\n\n/** The published hall-content surfaces whose TEXT fields a change request (and the\n * moderation text-clear remedy) can target. Detail surfaces live on the hall parent;\n * sub-item surfaces on the published chapter/track/episode doc; the `workRealm`\n * surface targets the single `workRealms/{id}` doc (the realm grain of the one\n * text-change pipeline — R1, 2026-07-12). */\nexport const HallContentTextSurfaceSchema = z.enum([\n 'tale',\n 'tune',\n 'television',\n 'chapter',\n 'tuneTrack',\n 'televisionEpisode',\n 'workRealm',\n]);\nexport type HallContentTextSurface = z.infer<typeof HallContentTextSurfaceSchema>;\n\n/** The ONE canonical hall sub-item kind (a Tale chapter / Tune track / Television\n * episode) as carried on notification metadata and Streetz post payloads. Distinct\n * from `HallContentTextSurfaceSchema` (which keys text-change surfaces and uses the\n * compound `tuneTrack`/`televisionEpisode` identifiers). Never re-declare inline. */\nexport const HallSubItemTypeSchema = z.enum(['chapter', 'track', 'episode']);\nexport type HallSubItemType = z.infer<typeof HallSubItemTypeSchema>;\n\n/** The ONE canonical published-hall-item lifecycle status. */\nexport const PublishedHallItemStatusSchema = z.enum(['published', 'paused', 'banned']);\nexport type PublishedHallItemStatus = z.infer<typeof PublishedHallItemStatusSchema>;\n\n// A member's proposal to change TEXT fields on a PUBLISHED hall item (Ruling 2 of the\n// admin-work-correspondence order). The live published item is NEVER unlocked and never\n// edited by the member — this doc carries the PROPOSED values only; OLD values render\n// live from the published docs. Approve = server writes the values onto the published\n// item + its live in-Work source doc; deny = nothing changes, `resolutionReason` shown\n// to the member. Writes are callable-only; reads are the owning work's active guildmates\n// + admins. `requestKind` future-proofs a media variant (new kind, no schema break).\nexport const HallContentChangeRequestSchema = z.object({\n changeRequestId: z.string(),\n requestKind: z.literal('text'),\n // One-open-per-target enforcement/query key. Hall grains:\n // `${hallItemId}_${subItemId ?? 'detail'}`; realm grain: `realm_${workRealmId}`.\n targetKey: z.string(),\n // null ⇒ the workRealm grain (no hall item involved).\n hallItemId: z.string().nullable(),\n // Always set. On the workRealm grain this is the realm's foundingWorkProjectId\n // (server-derived) so the owner list read, rules, and admin-task fields keep\n // one uniform key across all grains.\n workProjectId: z.string(),\n // null ⇒ the workRealm grain (a realm has no work-project type).\n workProjectType: z.enum(WORK_PROJECT_TYPE_KEYS).nullable(),\n surface: HallContentTextSurfaceSchema,\n // Set ⇒ the workRealm grain; null on the hall grains.\n workRealmId: z.string().nullable(),\n // null ⇒ the hall parent DETAIL (or the workRealm grain); set ⇒ a\n // chapter/track/episode sub-item.\n subItemId: z.string().nullable(),\n proposerUid: z.string(),\n // Raw doc field name → proposed new text. Allowlist + per-field caps enforced by the\n // submit runner against HALL_CONTENT_TEXT_FIELDS / HALL_CONTENT_TEXT_FIELD_MAX.\n proposedFields: z.record(z.string(), z.string()),\n status: z.enum(['requested', 'approved', 'denied']),\n createdAt: z.number(),\n lastUpdatedAt: z.number(),\n resolvedAt: z.number().optional(),\n resolvedBy: z.string().optional(),\n // Admin's reason, surfaced to the member (required on a deny).\n resolutionReason: z.string().optional(),\n});\nexport type HallContentChangeRequest = z.infer<typeof HallContentChangeRequestSchema>;\n\nexport const PublishedHallItemSchema = z.object({\n hallItemId: z.string(),\n workProjectId: z.string(),\n workProjectType: z.enum(WORK_PROJECT_TYPE_KEYS),\n status: PublishedHallItemStatusSchema,\n createdOn: z.number(),\n publishedAt: z.number().optional(),\n hallWingType: z.enum(HALL_WING_TYPE_KEYS),\n title: z.string().optional(),\n description: z.string().optional(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()).optional(),\n followerCount: z.number().optional(),\n hidden: z.boolean(),\n // Whether the current hide was applied DIRECTly to this item or propagated by a moderation\n // CASCADE from a parent (realm/work). Absent when not hidden. Backend-only-writable.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Moderation text-clear remedy (extends the workProject/workRealm placeholder family, per-field):\n // which text fields an admin cleared to a neutral placeholder and now await steward re-entry\n // (e.g. ['title', 'description']). Empty/absent when nothing was cleared. `moderationClearedReason`\n // is the operator's reason (shown on the steward's edit surface). Backend-only-writable.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n // Parody / real-people flag (carried from the approved ThresholdItem's AUTHOR\n // attestation — R3, 2026-07-12). When true, display surfaces render the ONE\n // standard platform message (REAL_PEOPLE_DISCLAIMER_MESSAGE) prominently on the\n // published Work — never a stored free-text disclaimer. Backend-written at publish.\n hasRealPeople: z.boolean().optional(),\n});\nexport type PublishedHallItem = z.infer<typeof PublishedHallItemSchema>;\n\nexport const PublishedTuneTrackSchema = z.object({\n uid: z.string(),\n title: z.string(),\n order: z.number(),\n description: z.string().optional(),\n audioAssetId: z.string(),\n photoAssetId: z.string().optional(),\n hidden: z.boolean(),\n // Direct hide vs cascade-from-parent (see PublishedHallItemSchema). Absent when not hidden.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Per-field moderation text-clear remedy (see PublishedHallItemSchema): which text fields were\n // cleared to a neutral placeholder and await steward re-entry, plus the operator's reason.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n});\nexport type PublishedTuneTrack = z.infer<typeof PublishedTuneTrackSchema>;\n\nexport const PublishedChapterSchema = z.object({\n uid: z.string(),\n title: z.string(),\n order: z.number(),\n description: z.string().optional(),\n content: z.string(),\n photoAssetId: z.string().optional(),\n hidden: z.boolean(),\n // Direct hide vs cascade-from-parent (see PublishedHallItemSchema). Absent when not hidden.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Per-field moderation text-clear remedy (see PublishedHallItemSchema): which text fields were\n // cleared to a neutral placeholder and await steward re-entry, plus the operator's reason.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n});\nexport type PublishedChapter = z.infer<typeof PublishedChapterSchema>;\n\nexport const PublishedTelevisionEpisodeSchema = z.object({\n uid: z.string(),\n title: z.string(),\n order: z.number(),\n description: z.string().optional(),\n videoAssetId: z.string(),\n photoAssetId: z.string().optional(),\n hidden: z.boolean(),\n // Direct hide vs cascade-from-parent (see PublishedHallItemSchema). Absent when not hidden.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Per-field moderation text-clear remedy (see PublishedHallItemSchema): which text fields were\n // cleared to a neutral placeholder and await steward re-entry, plus the operator's reason.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n});\nexport type PublishedTelevisionEpisode = z.infer<typeof PublishedTelevisionEpisodeSchema>;\n\n// --- Hall library user preferences (per-user Hall viewing-state doc) ---\n\n// One per-user home, server-synced from day 1 (hall-viewing-experience Area 2, ruled\n// 2026-07-04): `userProfiles/{uid}/privateData/hallLibraryPreferences` (see\n// PATH_BUILDERS.hallLibraryPreferences). Writes are CALLABLE-ONLY — one core owns this\n// doc; heartbeat throttling for playback progress is client-side before the callable\n// fires. Every list on this doc is capped for launch (see HALL_LIBRARY_PREFS_CAPS) —\n// no unbounded per-user lists.\nexport const HallLibraryInProgressEntrySchema = z.object({\n itemId: z.string(),\n positionSeconds: z.number(),\n durationSeconds: z.number().optional(),\n updatedAt: z.number(),\n});\nexport type HallLibraryInProgressEntry = z.infer<typeof HallLibraryInProgressEntrySchema>;\n\nexport const HallLibraryRecentlyViewedEntrySchema = z.object({\n hallItemId: z.string(),\n itemId: z.string().optional(),\n viewedAt: z.number(),\n});\nexport type HallLibraryRecentlyViewedEntry = z.infer<typeof HallLibraryRecentlyViewedEntrySchema>;\n\nexport const HallLibrarySettingsSchema = z.object({\n tunesAutoplay: z.boolean(),\n});\nexport type HallLibrarySettings = z.infer<typeof HallLibrarySettingsSchema>;\n\nexport const HallLibraryPreferencesSchema = z.object({\n userId: z.string(),\n // Hall items the user personally hid (view filter only — see Area 6 ruling 5). Capped\n // ~200: oldest-pruned, or the hide is rejected with a friendly message once full.\n hiddenWorkIds: z.array(z.string()),\n // The \"Inked\" save-for-later watchlist (My Playbill Area 7). Capped ~200.\n inkedWorkIds: z.array(z.string()),\n // Resume position per hallItemId, LRU-capped ~50 (see HALL_LIBRARY_PREFS_CAPS.inProgress).\n // Cap enforcement is the backend core's job on write; this schema only models the shape.\n inProgress: z.record(z.string(), HallLibraryInProgressEntrySchema),\n // Server-side Keep-going/History rail source, capped ~20.\n recentlyViewed: z.array(HallLibraryRecentlyViewedEntrySchema),\n settings: HallLibrarySettingsSchema,\n lastUpdated: z.number(),\n});\nexport type HallLibraryPreferences = z.infer<typeof HallLibraryPreferencesSchema>;\n\n// --- _config singleton docs ---\n\nexport const FuturePlanItemSchema = z.object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n order: z.number(),\n videoUrl: z.string().optional(),\n mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),\n});\nexport type FuturePlanItem = z.infer<typeof FuturePlanItemSchema>;\n\nexport const FuturePlansDocumentSchema = z.object({\n lastUpdated: z.number(),\n plans: z.array(FuturePlanItemSchema),\n // Content version — bumped by the update callable on EVERY save (content-pages\n // migration, DJ ruling 2026-07-06). Optional because pre-migration docs lack\n // it; readers treat absence as version 1.\n version: z.number().optional(),\n});\nexport type FuturePlansDocument = z.infer<typeof FuturePlansDocumentSchema>;\n\nexport const RuleGroupSchema = z.enum(['generic', 'workProjectType', 'hallWingType', 'workRealm', 'merchandising']);\nexport type RuleGroup = z.infer<typeof RuleGroupSchema>;\n\nexport const RuleSubgroupSchema = z.enum(['Tales', 'Tunes', 'Television', 'entertainment', 'educational', 'newsPolitical']);\nexport type RuleSubgroup = z.infer<typeof RuleSubgroupSchema>;\n\nexport const RuleSchema = z.object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n videoUrl: z.string().optional(),\n group: RuleGroupSchema.optional(),\n subgroup: RuleSubgroupSchema.optional(),\n order: z.number(),\n});\nexport type Rule = z.infer<typeof RuleSchema>;\n\nexport const AgreementCategorySchema = z.object({\n points: z.array(z.string()),\n videoUrl: z.string().optional(),\n});\nexport type AgreementCategory = z.infer<typeof AgreementCategorySchema>;\n\nexport const RulesAndAgreementsSchema = z.object({\n rules: z.array(RuleSchema),\n agreements: z.object({\n tales: AgreementCategorySchema.optional(),\n tunes: AgreementCategorySchema.optional(),\n television: AgreementCategorySchema.optional(),\n }),\n // Content version — bumped by the update callable on EVERY save (content-pages\n // migration, DJ ruling 2026-07-06). Optional because pre-migration docs lack\n // it; readers treat absence as version 1.\n version: z.number().optional(),\n});\nexport type RulesAndAgreements = z.infer<typeof RulesAndAgreementsSchema>;\n\n// --- Editable content-page docs (content-pages Firestore migration, DJ ruling 2026-07-06) ---\n//\n// /terms, /privacy, and the /take-it-down page copy render EXCLUSIVELY from\n// these `_config` singletons — no hardcoded fallbacks anywhere (banned design).\n// Seed callables create them (strict seed-if-empty: doc exists ⇒ no-op); admin\n// editors are the only writers after that, and every save bumps `version`.\n// Acceptance records (e.g. privateData.agreements.termsVersion) read `version`\n// from the DOC server-side at acceptance time — never from a constant.\n// There is NO draft flag on any content doc (DJ ruling 2026-07-06).\n\n/** One section of a long-form content page. `level` 1 = section (h2), 2 = subsection (h3). */\nexport const ContentPageSectionSchema = z.object({\n id: z.string(),\n heading: z.string(),\n level: z.union([z.literal(1), z.literal(2)]),\n /** Plain text; blank-line-separated paragraphs. */\n body: z.string(),\n order: z.number(),\n});\nexport type ContentPageSection = z.infer<typeof ContentPageSectionSchema>;\n\n/** Long-form legal page doc — the shape of BOTH `_appConfig/termsOfService` and `_appConfig/privacyPolicy`. */\nexport const LegalPageDocumentSchema = z.object({\n version: z.number(),\n lastUpdated: z.number(),\n sections: z.array(ContentPageSectionSchema),\n});\nexport type LegalPageDocument = z.infer<typeof LegalPageDocumentSchema>;\n\n/**\n * `_appConfig/takeItDownPageCopy` — the /take-it-down page's user-facing language as\n * a keyed strings map (the page is a functional form, so its copy is discrete\n * labeled strings, not long-form sections). Keys are stable identifiers defined\n * by the page (e.g. `pageTitle`, `introBody`); the admin editor renders one\n * labeled text field per key.\n */\nexport const TakeItDownPageCopySchema = z.object({\n version: z.number(),\n lastUpdated: z.number(),\n strings: z.record(z.string(), z.string()),\n});\nexport type TakeItDownPageCopy = z.infer<typeof TakeItDownPageCopySchema>;\n"]}
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/doc-schemas/content.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+EAA+E;AAC/E,qFAAqF;AACrF,sFAAsF;AACtF,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElF,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC;AAErF,8FAA8F;AAC9F,mGAAmG;AACnG,oGAAoG;AACpG,oGAAoG;AACpG,oGAAoG;AACpG,uGAAuG;AACvG,MAAM,4BAA4B,GAAG;IACnC,uBAAuB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvD,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,G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C,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["// Content Firestore document SCHEMAS — Tales/Tunes/Television sub-documents, the\n// Threshold + Hall library item shapes, Hall library user preferences, and the\n// `_config` singleton docs (futurePlans, rulesAndAgreements). Types are inferred via\n// z.infer. The enum-key consts (HALL_WING_TYPE_KEYS / WORK_PROJECT_TYPE_KEYS) and the\n// UI-only filter/view types remain in ../types/content.ts.\n\nimport { z } from 'zod';\nimport { HALL_WING_TYPE_KEYS, WORK_PROJECT_TYPE_KEYS } from '../types/content.js';\n\nconst contentStatusSchema = z.enum(['unpublished', 'pending_approval', 'published']);\n\n// Per-field moderation text-clear remedy (shared shape across the content family — Tale/Tune/\n// Television details, their chapter/track/episode sub-items, and the published Hall projections of\n// both). `moderationClearedFields` lists which text fields (e.g. 'title', 'description', 'content')\n// an admin cleared to a neutral placeholder and which now await steward re-entry; empty/absent when\n// nothing was cleared. `moderationClearedReason` is the operator's reason, surfaced on the member's\n// edit surface. Extends the workProject/workRealm placeholder remedy per-field. Backend-only-writable.\nconst moderationClearedFieldsShape = {\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n};\n\nexport const ItemsKeySchema = z.enum(['tuneTracks', 'chapters', 'televisionEpisodes']);\nexport type ItemsKey = z.infer<typeof ItemsKeySchema>;\n\n// --- WorkProject content sub-docs ---\n\nexport const FullTaleSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string(),\n createdOn: z.number(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()).optional(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTale = z.infer<typeof FullTaleSchema>;\n\nexport const FullChapterSchema = z.object({\n uid: z.string(),\n title: z.string(),\n content: z.string(),\n description: z.string(),\n order: z.number(),\n photoAssetId: z.string().optional(),\n status: contentStatusSchema,\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullChapter = z.infer<typeof FullChapterSchema>;\n\nexport const FullTuneSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()),\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTune = z.infer<typeof FullTuneSchema>;\n\nexport const FullTuneTrackSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string().optional(),\n audioAssetId: z.string().optional(),\n mediaType: z.string().optional(),\n order: z.number(),\n photoAssetId: z.string().optional(),\n status: contentStatusSchema,\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTuneTrack = z.infer<typeof FullTuneTrackSchema>;\n\nexport const FullTelevisionSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string(),\n createdOn: z.number(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()),\n ...moderationClearedFieldsShape,\n});\nexport type FullTelevision = z.infer<typeof FullTelevisionSchema>;\n\nexport const FullTelevisionEpisodeSchema = z.object({\n uid: z.string(),\n title: z.string(),\n description: z.string().optional(),\n videoAssetId: z.string(),\n mediaType: z.string().optional(),\n order: z.number(),\n photoAssetId: z.string().optional(),\n status: contentStatusSchema,\n createdOn: z.number(),\n ...moderationClearedFieldsShape,\n});\nexport type FullTelevisionEpisode = z.infer<typeof FullTelevisionEpisodeSchema>;\n\n// --- Threshold + Hall library items ---\n\n/** `allWorkProjects/{workProjectId}/hallSubmissionReservation/reservation` — the Work's ONE\n * hall-entry reservation, created (never updated) inside the first threshold submit's\n * transaction; every later submit converges on its `hallItemId`. Backend-only. */\nexport const HallSubmissionReservationSchema = z.object({\n hallItemId: z.string().min(1),\n createdAt: z.number(),\n}).strict();\nexport type HallSubmissionReservation = z.infer<typeof HallSubmissionReservationSchema>;\n\nexport const ThresholdItemSchema = z.object({\n thresholdItemId: z.string(),\n hallItemId: z.string(),\n workProjectId: z.string(),\n workProjectType: z.enum(WORK_PROJECT_TYPE_KEYS),\n itemId: z.string(),\n itemsKey: ItemsKeySchema,\n order: z.number(),\n hallWingType: z.enum(HALL_WING_TYPE_KEYS),\n submittedAt: z.number(),\n reviewStatus: z.enum(['pending', 'needs_revision', 'approved']),\n adminNotes: z.string().optional(),\n reviewedAt: z.number().optional(),\n reviewedBy: z.string().optional(),\n // Parody / real-people AUTHOR ATTESTATION (R3, 2026-07-12). The submitting artisan\n // attests at threshold SUBMIT time that this work depicts real people (parody /\n // satire / commentary); stored with the submission and displayed READ-ONLY to the\n // reviewer. Admins never set or edit it — a reviewer who believes the flag is\n // needed and missing sends the item back needs-revision. The disclaimer shown on\n // published items is the ONE standard platform message\n // (REAL_PEOPLE_DISCLAIMER_MESSAGE) — there is no free-text disclaimer anywhere.\n hasRealPeople: z.boolean(),\n // Submission attestations — REQUIRED. The submit core refuses a submission unless the artisan\n // ticks all four, then stores each as the literal `true` with the moment they were given. A\n // threshold item without them is not a valid submission.\n attestConsistentFormat: z.literal(true),\n attestNoCredits: z.literal(true),\n attestNoBegging: z.literal(true),\n attestHumanMadeOriginal: z.literal(true),\n attestedAt: z.number(),\n // Reviewer confirmations — stamped `true` together by the APPROVAL write and never otherwise,\n // so their presence means the item was approved with all four checks confirmed.\n confirmedNoBegging: z.literal(true).optional(),\n confirmedNoCredits: z.literal(true).optional(),\n confirmedConsistentFormat: z.literal(true).optional(),\n confirmedRealPeopleAttestation: z.literal(true).optional(),\n});\nexport type ThresholdItem = z.infer<typeof ThresholdItemSchema>;\n\n// --- Published change requests (launch: text-only) ---\n\n/** The published hall-content surfaces whose TEXT fields a change request (and the\n * moderation text-clear remedy) can target. Detail surfaces live on the hall parent;\n * sub-item surfaces on the published chapter/track/episode doc; the `workRealm`\n * surface targets the single `workRealms/{id}` doc (the realm grain of the one\n * text-change pipeline — R1, 2026-07-12). */\nexport const HallContentTextSurfaceSchema = z.enum([\n 'tale',\n 'tune',\n 'television',\n 'chapter',\n 'tuneTrack',\n 'televisionEpisode',\n 'workRealm',\n]);\nexport type HallContentTextSurface = z.infer<typeof HallContentTextSurfaceSchema>;\n\n/** The ONE canonical hall sub-item kind (a Tale chapter / Tune track / Television\n * episode) as carried on notification metadata and Streetz post payloads. Distinct\n * from `HallContentTextSurfaceSchema` (which keys text-change surfaces and uses the\n * compound `tuneTrack`/`televisionEpisode` identifiers). Never re-declare inline. */\nexport const HallSubItemTypeSchema = z.enum(['chapter', 'track', 'episode']);\nexport type HallSubItemType = z.infer<typeof HallSubItemTypeSchema>;\n\n/** The ONE canonical published-hall-item lifecycle status. */\nexport const PublishedHallItemStatusSchema = z.enum(['published', 'paused', 'banned']);\nexport type PublishedHallItemStatus = z.infer<typeof PublishedHallItemStatusSchema>;\n\n// A member's proposal to change TEXT fields on a PUBLISHED hall item (Ruling 2 of the\n// admin-work-correspondence order). The live published item is NEVER unlocked and never\n// edited by the member — this doc carries the PROPOSED values only; OLD values render\n// live from the published docs. Approve = server writes the values onto the published\n// item + its live in-Work source doc; deny = nothing changes, `resolutionReason` shown\n// to the member. Writes are callable-only; reads are the owning work's active guildmates\n// + admins. `requestKind` future-proofs a media variant (new kind, no schema break).\nexport const HallContentChangeRequestSchema = z.object({\n changeRequestId: z.string(),\n requestKind: z.literal('text'),\n // One-open-per-target enforcement/query key. Hall grains:\n // `${hallItemId}_${subItemId ?? 'detail'}`; realm grain: `realm_${workRealmId}`.\n targetKey: z.string(),\n // null ⇒ the workRealm grain (no hall item involved).\n hallItemId: z.string().nullable(),\n // Always set. On the workRealm grain this is the realm's foundingWorkProjectId\n // (server-derived) so the owner list read, rules, and admin-task fields keep\n // one uniform key across all grains.\n workProjectId: z.string(),\n // null ⇒ the workRealm grain (a realm has no work-project type).\n workProjectType: z.enum(WORK_PROJECT_TYPE_KEYS).nullable(),\n surface: HallContentTextSurfaceSchema,\n // Set ⇒ the workRealm grain; null on the hall grains.\n workRealmId: z.string().nullable(),\n // null ⇒ the hall parent DETAIL (or the workRealm grain); set ⇒ a\n // chapter/track/episode sub-item.\n subItemId: z.string().nullable(),\n proposerUid: z.string(),\n // Raw doc field name → proposed new text. Allowlist + per-field caps enforced by the\n // submit runner against HALL_CONTENT_TEXT_FIELDS / HALL_CONTENT_TEXT_FIELD_MAX.\n proposedFields: z.record(z.string(), z.string()),\n status: z.enum(['requested', 'approved', 'denied']),\n createdAt: z.number(),\n lastUpdatedAt: z.number(),\n resolvedAt: z.number().optional(),\n resolvedBy: z.string().optional(),\n // Admin's reason, surfaced to the member (required on a deny).\n resolutionReason: z.string().optional(),\n});\nexport type HallContentChangeRequest = z.infer<typeof HallContentChangeRequestSchema>;\n\nexport const PublishedHallItemSchema = z.object({\n hallItemId: z.string(),\n workProjectId: z.string(),\n workProjectType: z.enum(WORK_PROJECT_TYPE_KEYS),\n status: PublishedHallItemStatusSchema,\n createdOn: z.number(),\n publishedAt: z.number().optional(),\n hallWingType: z.enum(HALL_WING_TYPE_KEYS),\n title: z.string().optional(),\n description: z.string().optional(),\n coverSquareAssetId: z.string().optional(),\n coverPosterAssetId: z.string().optional(),\n coverCinematicAssetId: z.string().optional(),\n workGenres: z.array(z.string()).optional(),\n followerCount: z.number().optional(),\n hidden: z.boolean(),\n // Whether the current hide was applied DIRECTly to this item or propagated by a moderation\n // CASCADE from a parent (realm/work). Absent when not hidden. Backend-only-writable.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Moderation text-clear remedy (extends the workProject/workRealm placeholder family, per-field):\n // which text fields an admin cleared to a neutral placeholder and now await steward re-entry\n // (e.g. ['title', 'description']). Empty/absent when nothing was cleared. `moderationClearedReason`\n // is the operator's reason (shown on the steward's edit surface). Backend-only-writable.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n // Parody / real-people flag (carried from the approved ThresholdItem's AUTHOR\n // attestation — R3, 2026-07-12). When true, display surfaces render the ONE\n // standard platform message (REAL_PEOPLE_DISCLAIMER_MESSAGE) prominently on the\n // published Work — never a stored free-text disclaimer. Backend-written at publish.\n hasRealPeople: z.boolean().optional(),\n});\nexport type PublishedHallItem = z.infer<typeof PublishedHallItemSchema>;\n\nexport const PublishedTuneTrackSchema = z.object({\n uid: z.string(),\n title: z.string(),\n order: z.number(),\n description: z.string().optional(),\n audioAssetId: z.string(),\n photoAssetId: z.string().optional(),\n hidden: z.boolean(),\n // Direct hide vs cascade-from-parent (see PublishedHallItemSchema). Absent when not hidden.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Per-field moderation text-clear remedy (see PublishedHallItemSchema): which text fields were\n // cleared to a neutral placeholder and await steward re-entry, plus the operator's reason.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n});\nexport type PublishedTuneTrack = z.infer<typeof PublishedTuneTrackSchema>;\n\nexport const PublishedChapterSchema = z.object({\n uid: z.string(),\n title: z.string(),\n order: z.number(),\n description: z.string().optional(),\n content: z.string(),\n photoAssetId: z.string().optional(),\n hidden: z.boolean(),\n // Direct hide vs cascade-from-parent (see PublishedHallItemSchema). Absent when not hidden.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Per-field moderation text-clear remedy (see PublishedHallItemSchema): which text fields were\n // cleared to a neutral placeholder and await steward re-entry, plus the operator's reason.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n});\nexport type PublishedChapter = z.infer<typeof PublishedChapterSchema>;\n\nexport const PublishedTelevisionEpisodeSchema = z.object({\n uid: z.string(),\n title: z.string(),\n order: z.number(),\n description: z.string().optional(),\n videoAssetId: z.string(),\n photoAssetId: z.string().optional(),\n hidden: z.boolean(),\n // Direct hide vs cascade-from-parent (see PublishedHallItemSchema). Absent when not hidden.\n hiddenBy: z.enum(['direct', 'cascade']).optional(),\n // Per-field moderation text-clear remedy (see PublishedHallItemSchema): which text fields were\n // cleared to a neutral placeholder and await steward re-entry, plus the operator's reason.\n moderationClearedFields: z.array(z.string()).optional(),\n moderationClearedReason: z.string().optional(),\n});\nexport type PublishedTelevisionEpisode = z.infer<typeof PublishedTelevisionEpisodeSchema>;\n\n// --- Hall library user preferences (per-user Hall viewing-state doc) ---\n\n// One per-user home, server-synced from day 1 (hall-viewing-experience Area 2, ruled\n// 2026-07-04): `userProfiles/{uid}/privateData/hallLibraryPreferences` (see\n// PATH_BUILDERS.hallLibraryPreferences). Writes are CALLABLE-ONLY — one core owns this\n// doc; heartbeat throttling for playback progress is client-side before the callable\n// fires. Every list on this doc is capped for launch (see HALL_LIBRARY_PREFS_CAPS) —\n// no unbounded per-user lists.\nexport const HallLibraryInProgressEntrySchema = z.object({\n itemId: z.string(),\n positionSeconds: z.number(),\n durationSeconds: z.number().optional(),\n updatedAt: z.number(),\n});\nexport type HallLibraryInProgressEntry = z.infer<typeof HallLibraryInProgressEntrySchema>;\n\nexport const HallLibraryRecentlyViewedEntrySchema = z.object({\n hallItemId: z.string(),\n itemId: z.string().optional(),\n viewedAt: z.number(),\n});\nexport type HallLibraryRecentlyViewedEntry = z.infer<typeof HallLibraryRecentlyViewedEntrySchema>;\n\nexport const HallLibrarySettingsSchema = z.object({\n tunesAutoplay: z.boolean(),\n});\nexport type HallLibrarySettings = z.infer<typeof HallLibrarySettingsSchema>;\n\nexport const HallLibraryPreferencesSchema = z.object({\n userId: z.string(),\n // Hall items the user personally hid (view filter only — see Area 6 ruling 5). Capped\n // ~200: oldest-pruned, or the hide is rejected with a friendly message once full.\n hiddenWorkIds: z.array(z.string()),\n // The \"Inked\" save-for-later watchlist (My Playbill Area 7). Capped ~200.\n inkedWorkIds: z.array(z.string()),\n // Resume position per hallItemId, LRU-capped ~50 (see HALL_LIBRARY_PREFS_CAPS.inProgress).\n // Cap enforcement is the backend core's job on write; this schema only models the shape.\n inProgress: z.record(z.string(), HallLibraryInProgressEntrySchema),\n // Server-side Keep-going/History rail source, capped ~20.\n recentlyViewed: z.array(HallLibraryRecentlyViewedEntrySchema),\n settings: HallLibrarySettingsSchema,\n lastUpdated: z.number(),\n});\nexport type HallLibraryPreferences = z.infer<typeof HallLibraryPreferencesSchema>;\n\n// --- _config singleton docs ---\n\nexport const FuturePlanItemSchema = z.object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n order: z.number(),\n videoUrl: z.string().optional(),\n mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),\n});\nexport type FuturePlanItem = z.infer<typeof FuturePlanItemSchema>;\n\nexport const FuturePlansDocumentSchema = z.object({\n lastUpdated: z.number(),\n plans: z.array(FuturePlanItemSchema),\n // Content version — bumped by the update callable on EVERY save (content-pages\n // migration, DJ ruling 2026-07-06). Optional because pre-migration docs lack\n // it; readers treat absence as version 1.\n version: z.number().optional(),\n});\nexport type FuturePlansDocument = z.infer<typeof FuturePlansDocumentSchema>;\n\nexport const RuleGroupSchema = z.enum(['generic', 'workProjectType', 'hallWingType', 'workRealm', 'merchandising']);\nexport type RuleGroup = z.infer<typeof RuleGroupSchema>;\n\nexport const RuleSubgroupSchema = z.enum(['Tales', 'Tunes', 'Television', 'entertainment', 'educational', 'newsPolitical']);\nexport type RuleSubgroup = z.infer<typeof RuleSubgroupSchema>;\n\nexport const RuleSchema = z.object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n videoUrl: z.string().optional(),\n group: RuleGroupSchema.optional(),\n subgroup: RuleSubgroupSchema.optional(),\n order: z.number(),\n});\nexport type Rule = z.infer<typeof RuleSchema>;\n\nexport const AgreementCategorySchema = z.object({\n points: z.array(z.string()),\n videoUrl: z.string().optional(),\n});\nexport type AgreementCategory = z.infer<typeof AgreementCategorySchema>;\n\nexport const RulesAndAgreementsSchema = z.object({\n rules: z.array(RuleSchema),\n agreements: z.object({\n tales: AgreementCategorySchema.optional(),\n tunes: AgreementCategorySchema.optional(),\n television: AgreementCategorySchema.optional(),\n }),\n // Content version — bumped by the update callable on EVERY save (content-pages\n // migration, DJ ruling 2026-07-06). Optional because pre-migration docs lack\n // it; readers treat absence as version 1.\n version: z.number().optional(),\n});\nexport type RulesAndAgreements = z.infer<typeof RulesAndAgreementsSchema>;\n\n// --- Editable content-page docs (content-pages Firestore migration, DJ ruling 2026-07-06) ---\n//\n// /terms, /privacy, and the /take-it-down page copy render EXCLUSIVELY from\n// these `_config` singletons — no hardcoded fallbacks anywhere (banned design).\n// Seed callables create them (strict seed-if-empty: doc exists ⇒ no-op); admin\n// editors are the only writers after that, and every save bumps `version`.\n// Acceptance records (e.g. privateData.agreements.termsVersion) read `version`\n// from the DOC server-side at acceptance time — never from a constant.\n// There is NO draft flag on any content doc (DJ ruling 2026-07-06).\n\n/** One section of a long-form content page. `level` 1 = section (h2), 2 = subsection (h3). */\nexport const ContentPageSectionSchema = z.object({\n id: z.string(),\n heading: z.string(),\n level: z.union([z.literal(1), z.literal(2)]),\n /** Plain text; blank-line-separated paragraphs. */\n body: z.string(),\n order: z.number(),\n});\nexport type ContentPageSection = z.infer<typeof ContentPageSectionSchema>;\n\n/** Long-form legal page doc — the shape of BOTH `_appConfig/termsOfService` and `_appConfig/privacyPolicy`. */\nexport const LegalPageDocumentSchema = z.object({\n version: z.number(),\n lastUpdated: z.number(),\n sections: z.array(ContentPageSectionSchema),\n});\nexport type LegalPageDocument = z.infer<typeof LegalPageDocumentSchema>;\n\n/**\n * `_appConfig/takeItDownPageCopy` — the /take-it-down page's user-facing language as\n * a keyed strings map (the page is a functional form, so its copy is discrete\n * labeled strings, not long-form sections). Keys are stable identifiers defined\n * by the page (e.g. `pageTitle`, `introBody`); the admin editor renders one\n * labeled text field per key.\n */\nexport const TakeItDownPageCopySchema = z.object({\n version: z.number(),\n lastUpdated: z.number(),\n strings: z.record(z.string(), z.string()),\n});\nexport type TakeItDownPageCopy = z.infer<typeof TakeItDownPageCopySchema>;\n"]}
@@ -25,7 +25,7 @@ export declare const ContentViolationSchema: z.ZodObject<{
25
25
  }, z.core.$strip>>>;
26
26
  rejectedFilePath: z.ZodOptional<z.ZodString>;
27
27
  pendingFile: z.ZodOptional<z.ZodObject<{
28
- status: z.ZodOptional<z.ZodLiteral<"pending">>;
28
+ status: z.ZodOptional<z.ZodLiteral<"processing">>;
29
29
  id: z.ZodOptional<z.ZodString>;
30
30
  userId: z.ZodOptional<z.ZodString>;
31
31
  fileOrigin: z.ZodOptional<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/moderation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+BjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAItE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,6BAA6B;;;;;EAAmE,CAAC;AAC9G,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,6BAA6B;;;;EAA4C,CAAC;AACvF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,wCAAwC;;;;;;EAMnD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAI1G,eAAO,MAAM,yCAAyC;;;EAAuC,CAAC;AAC9F,MAAM,MAAM,mCAAmC,GAAG,CAAC,C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,CAAC,CAAC;AAI1G,eAAO,MAAM,yCAAyC;;;EAAuC,CAAC;AAC9F,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;iBAU1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;iBAQ5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  // admin task, and the moderationCascadeManifests/{id} (+ changedDocs) records.
3
3
  // Types inferred via z.infer.
4
4
  import { z } from 'zod';
5
- import { PendingMediaPendingSchema } from '../media/pending-media.js';
5
+ import { PendingMediaProcessingSchema } from '../media/pending-media.js';
6
6
  import { AdminTaskSchema } from './report-docs.js';
7
7
  export const ContentViolationSchema = z.object({
8
8
  id: z.string(),
@@ -27,7 +27,11 @@ export const ContentViolationSchema = z.object({
27
27
  // Internal GCS path of the preserved rejected file — never a serving contract.
28
28
  // Appeal viewing is owner/admin-gated (rules-gated SDK read or signed URL).
29
29
  rejectedFilePath: z.string().optional(),
30
- pendingFile: PendingMediaPendingSchema.partial().optional(),
30
+ // The pendingMedia row AS CLAIMED by the processor: logContentViolation snapshots the in-memory
31
+ // claimed row before the row is finalized `rejected`, so the stored status is `processing` —
32
+ // never `pending` and never `rejected`. An approved appeal re-queues a FRESH `pending` row built
33
+ // from these fields; it does not reuse this snapshot as a document.
34
+ pendingFile: PendingMediaProcessingSchema.partial().optional(),
31
35
  // Appeal lifecycle (submitContentAppeal / reviewContentAppeal).
32
36
  appealMessage: z.string().optional(),
33
37
  appealedAt: z.number().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"moderation.js","sourceRoot":"","sources":["../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AAC,CAAC,CAAC;AAGvF,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7D,aAAa;IACb,UAAU;IACV,mBAAmB;IACnB,WAAW;IACX,YAAY;CACb,CAAC,CAAC;AAGH,mGAAmG;AACnG,4FAA4F;AAC5F,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAG9F,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,6BAA6B;IACrC,UAAU,EAAE,yCAAyC;IACrD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,6BAA6B;CACtC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,wCAAwC;IACpD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC","sourcesContent":["// Moderation Firestore document SCHEMAS — contentViolations/{id}, the content-appeal\n// admin task, and the moderationCascadeManifests/{id} (+ changedDocs) records.\n// Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { PendingMediaPendingSchema } from '../media/pending-media.js';\nimport { AdminTaskSchema } from './report-docs.js';\n\nexport const ContentViolationSchema = z.object({\n id: z.string(),\n userId: z.string(),\n fileType: z.string(),\n violationType: z.enum(['text', 'media']).optional(),\n reason: z.string(),\n timestamp: z.number(),\n appealStatus: z.enum(['none', 'pending', 'approved', 'denied']),\n // Text violations (moderateTextOrThrow / media-result-handler 'text_rejected') write these and\n // omit the media-only fields below; media violations (logContentViolation) do the reverse.\n flaggedWords: z.array(z.string()).optional(),\n originalText: z.string().optional(),\n // Media-only fields. Optional because text violations omit them, and `scores` is nullable\n // because moderateTextOrThrow writes `scores: result.scores ?? null`.\n originalFileName: z.string().optional(),\n scores: z.object({\n adult: z.string(),\n violence: z.string(),\n racy: z.string(),\n }).nullable().optional(),\n // Internal GCS path of the preserved rejected file — never a serving contract.\n // Appeal viewing is owner/admin-gated (rules-gated SDK read or signed URL).\n rejectedFilePath: z.string().optional(),\n pendingFile: PendingMediaPendingSchema.partial().optional(),\n // Appeal lifecycle (submitContentAppeal / reviewContentAppeal).\n appealMessage: z.string().optional(),\n appealedAt: z.number().optional(),\n reviewedBy: z.string().optional(),\n reviewedAt: z.number().optional(),\n reviewDecision: z.enum(['approved', 'denied']).optional(),\n reviewNotes: z.string().optional(),\n});\nexport type ContentViolation = z.infer<typeof ContentViolationSchema>;\n\n// content-appeal admin task: the generic AdminTask specialized to 'content-appeal' plus\n// the appeal-specific denormalized fields used by the admin review view.\nexport const ContentAppealTaskSchema = AdminTaskSchema.extend({\n taskType: z.literal('content-appeal'),\n violationId: z.string(),\n userId: z.string(),\n fileType: z.string(),\n rejectionReason: z.string(),\n appealMessage: z.string(),\n rejectedFilePath: z.string(),\n});\nexport type ContentAppealTask = z.infer<typeof ContentAppealTaskSchema>;\n\nexport const ModerationCascadeActionSchema = z.enum(['hideRealm', 'restoreRealm', 'hideWork', 'restoreWork']);\nexport type ModerationCascadeAction = z.infer<typeof ModerationCascadeActionSchema>;\n\nexport const ModerationCascadeStatusSchema = z.enum(['pending', 'complete', 'failed']);\nexport type ModerationCascadeStatus = z.infer<typeof ModerationCascadeStatusSchema>;\n\nexport const ModerationCascadeChangedEntityTypeSchema = z.enum([\n 'workProject',\n 'hallItem',\n 'subItemProjection',\n 'workRealm',\n 'mediaAsset',\n]);\nexport type ModerationCascadeChangedEntityType = z.infer<typeof ModerationCascadeChangedEntityTypeSchema>;\n\n// The top-level entity a hide/restore cascade targets. Realm cascades fan out to many child Works;\n// a Work cascade targets one Work (its publicWorkProjects doc + that Work's Hall surfaces).\nexport const ModerationCascadeManifestEntityTypeSchema = z.enum(['workRealm', 'workProject']);\nexport type ModerationCascadeManifestEntityType = z.infer<typeof ModerationCascadeManifestEntityTypeSchema>;\n\nexport const ModerationCascadeManifestSchema = z.object({\n cascadeId: z.string(),\n action: ModerationCascadeActionSchema,\n entityType: ModerationCascadeManifestEntityTypeSchema,\n entityId: z.string(),\n actorUid: z.string(),\n reason: z.string(),\n createdAt: z.number(),\n completedAt: z.number().optional(),\n status: ModerationCascadeStatusSchema,\n});\nexport type ModerationCascadeManifest = z.infer<typeof ModerationCascadeManifestSchema>;\n\nexport const ModerationCascadeChangedDocSchema = z.object({\n docPath: z.string(),\n entityType: ModerationCascadeChangedEntityTypeSchema,\n fieldPath: z.string(),\n previousValue: z.boolean(),\n newValue: z.boolean(),\n restored: z.boolean(),\n restoredAt: z.number().optional(),\n});\nexport type ModerationCascadeChangedDoc = z.infer<typeof ModerationCascadeChangedDocSchema>;\n"]}
1
+ {"version":3,"file":"moderation.js","sourceRoot":"","sources":["../../src/doc-schemas/moderation.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,+EAA+E;AAC/E,8BAA8B;AAE9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CA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C5F,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAG9F,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,6BAA6B;IACrC,UAAU,EAAE,yCAAyC;IACrD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,6BAA6B;CACtC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,wCAAwC;IACpD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC","sourcesContent":["// Moderation Firestore document SCHEMAS — contentViolations/{id}, the content-appeal\n// admin task, and the moderationCascadeManifests/{id} (+ changedDocs) records.\n// Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { PendingMediaProcessingSchema } from '../media/pending-media.js';\nimport { AdminTaskSchema } from './report-docs.js';\n\nexport const ContentViolationSchema = z.object({\n id: z.string(),\n userId: z.string(),\n fileType: z.string(),\n violationType: z.enum(['text', 'media']).optional(),\n reason: z.string(),\n timestamp: z.number(),\n appealStatus: z.enum(['none', 'pending', 'approved', 'denied']),\n // Text violations (moderateTextOrThrow / media-result-handler 'text_rejected') write these and\n // omit the media-only fields below; media violations (logContentViolation) do the reverse.\n flaggedWords: z.array(z.string()).optional(),\n originalText: z.string().optional(),\n // Media-only fields. Optional because text violations omit them, and `scores` is nullable\n // because moderateTextOrThrow writes `scores: result.scores ?? null`.\n originalFileName: z.string().optional(),\n scores: z.object({\n adult: z.string(),\n violence: z.string(),\n racy: z.string(),\n }).nullable().optional(),\n // Internal GCS path of the preserved rejected file — never a serving contract.\n // Appeal viewing is owner/admin-gated (rules-gated SDK read or signed URL).\n rejectedFilePath: z.string().optional(),\n // The pendingMedia row AS CLAIMED by the processor: logContentViolation snapshots the in-memory\n // claimed row before the row is finalized `rejected`, so the stored status is `processing` —\n // never `pending` and never `rejected`. An approved appeal re-queues a FRESH `pending` row built\n // from these fields; it does not reuse this snapshot as a document.\n pendingFile: PendingMediaProcessingSchema.partial().optional(),\n // Appeal lifecycle (submitContentAppeal / reviewContentAppeal).\n appealMessage: z.string().optional(),\n appealedAt: z.number().optional(),\n reviewedBy: z.string().optional(),\n reviewedAt: z.number().optional(),\n reviewDecision: z.enum(['approved', 'denied']).optional(),\n reviewNotes: z.string().optional(),\n});\nexport type ContentViolation = z.infer<typeof ContentViolationSchema>;\n\n// content-appeal admin task: the generic AdminTask specialized to 'content-appeal' plus\n// the appeal-specific denormalized fields used by the admin review view.\nexport const ContentAppealTaskSchema = AdminTaskSchema.extend({\n taskType: z.literal('content-appeal'),\n violationId: z.string(),\n userId: z.string(),\n fileType: z.string(),\n rejectionReason: z.string(),\n appealMessage: z.string(),\n rejectedFilePath: z.string(),\n});\nexport type ContentAppealTask = z.infer<typeof ContentAppealTaskSchema>;\n\nexport const ModerationCascadeActionSchema = z.enum(['hideRealm', 'restoreRealm', 'hideWork', 'restoreWork']);\nexport type ModerationCascadeAction = z.infer<typeof ModerationCascadeActionSchema>;\n\nexport const ModerationCascadeStatusSchema = z.enum(['pending', 'complete', 'failed']);\nexport type ModerationCascadeStatus = z.infer<typeof ModerationCascadeStatusSchema>;\n\nexport const ModerationCascadeChangedEntityTypeSchema = z.enum([\n 'workProject',\n 'hallItem',\n 'subItemProjection',\n 'workRealm',\n 'mediaAsset',\n]);\nexport type ModerationCascadeChangedEntityType = z.infer<typeof ModerationCascadeChangedEntityTypeSchema>;\n\n// The top-level entity a hide/restore cascade targets. Realm cascades fan out to many child Works;\n// a Work cascade targets one Work (its publicWorkProjects doc + that Work's Hall surfaces).\nexport const ModerationCascadeManifestEntityTypeSchema = z.enum(['workRealm', 'workProject']);\nexport type ModerationCascadeManifestEntityType = z.infer<typeof ModerationCascadeManifestEntityTypeSchema>;\n\nexport const ModerationCascadeManifestSchema = z.object({\n cascadeId: z.string(),\n action: ModerationCascadeActionSchema,\n entityType: ModerationCascadeManifestEntityTypeSchema,\n entityId: z.string(),\n actorUid: z.string(),\n reason: z.string(),\n createdAt: z.number(),\n completedAt: z.number().optional(),\n status: ModerationCascadeStatusSchema,\n});\nexport type ModerationCascadeManifest = z.infer<typeof ModerationCascadeManifestSchema>;\n\nexport const ModerationCascadeChangedDocSchema = z.object({\n docPath: z.string(),\n entityType: ModerationCascadeChangedEntityTypeSchema,\n fieldPath: z.string(),\n previousValue: z.boolean(),\n newValue: z.boolean(),\n restored: z.boolean(),\n restoredAt: z.number().optional(),\n});\nexport type ModerationCascadeChangedDoc = z.infer<typeof ModerationCascadeChangedDocSchema>;\n"]}
@@ -77,6 +77,7 @@ export declare const TakeItDownRequestRootV1Schema: z.ZodObject<{
77
77
  completedWithApprovedException: "completedWithApprovedException";
78
78
  unableToComplete: "unableToComplete";
79
79
  }>>;
80
+ retentionCompletedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
80
81
  createdAt: z.ZodNumber;
81
82
  updatedAt: z.ZodNumber;
82
83
  }, z.core.$strict>;
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/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AC;IACvC,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAMD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,mBAAmB,EAAE,CAqBhF;AAED,wFAAwF;AACxF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,CAAC;IACnD,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,uBAAuB,CAOlF"}
@@ -66,6 +66,10 @@ export const TakeItDownRequestRootV1Schema = z.object({
66
66
  removalCompletionAt: z.number().optional(), // [M-01] set when removal verified-completes
67
67
  finalClosedAt: z.number().optional(), // [H-08] = requestClosedAt (no appeal window); arms for EVERY terminal disposition. The request's retention clocks (PII / evidence / status-token) count from here.
68
68
  removalCompletionOutcome: NciiRemovalCompletionOutcomeSchema.optional(), // [H4] honest derived completion — NEVER 'completed' for a partial technical failure
69
+ // Retention-sweep terminal marker. Seeded as an EXPLICIT null when the request closes — the sweep
70
+ // selects unfinished rows with `where('retentionCompletedAt', '==', null)`, which an absent field
71
+ // never matches — and set to the completion time once every retention obligation is discharged.
72
+ retentionCompletedAt: z.number().nullable().optional(),
69
73
  createdAt: z.number(),
70
74
  updatedAt: z.number(),
71
75
  }).strict();