@ttt-productions/ttt-core 0.79.66 → 0.79.68

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 (176) hide show
  1. package/dist/constants/app-mode.d.ts +3 -1
  2. package/dist/constants/app-mode.d.ts.map +1 -1
  3. package/dist/constants/app-mode.js +2 -0
  4. package/dist/constants/app-mode.js.map +1 -1
  5. package/dist/constants/business-admin.d.ts +6 -2
  6. package/dist/constants/business-admin.d.ts.map +1 -1
  7. package/dist/constants/business-admin.js +7 -2
  8. package/dist/constants/business-admin.js.map +1 -1
  9. package/dist/constants/business-content.d.ts +13 -14
  10. package/dist/constants/business-content.d.ts.map +1 -1
  11. package/dist/constants/business-content.js +14 -15
  12. package/dist/constants/business-content.js.map +1 -1
  13. package/dist/constants/business-platform.d.ts +6 -0
  14. package/dist/constants/business-platform.d.ts.map +1 -1
  15. package/dist/constants/business-platform.js +7 -1
  16. package/dist/constants/business-platform.js.map +1 -1
  17. package/dist/constants/business-user.d.ts +8 -2
  18. package/dist/constants/business-user.d.ts.map +1 -1
  19. package/dist/constants/business-user.js +4 -2
  20. package/dist/constants/business-user.js.map +1 -1
  21. package/dist/constants/business-work-project.d.ts +0 -8
  22. package/dist/constants/business-work-project.d.ts.map +1 -1
  23. package/dist/constants/business-work-project.js +3 -10
  24. package/dist/constants/business-work-project.js.map +1 -1
  25. package/dist/constants/center-stage-rooms.d.ts +5 -0
  26. package/dist/constants/center-stage-rooms.d.ts.map +1 -1
  27. package/dist/constants/center-stage-rooms.js +7 -0
  28. package/dist/constants/center-stage-rooms.js.map +1 -1
  29. package/dist/constants/index.d.ts +1 -0
  30. package/dist/constants/index.d.ts.map +1 -1
  31. package/dist/constants/index.js +1 -0
  32. package/dist/constants/index.js.map +1 -1
  33. package/dist/constants/storage-keys.d.ts +4 -1
  34. package/dist/constants/storage-keys.d.ts.map +1 -1
  35. package/dist/constants/storage-keys.js +4 -1
  36. package/dist/constants/storage-keys.js.map +1 -1
  37. package/dist/constants/text-fields.d.ts +484 -0
  38. package/dist/constants/text-fields.d.ts.map +1 -0
  39. package/dist/constants/text-fields.js +152 -0
  40. package/dist/constants/text-fields.js.map +1 -0
  41. package/dist/doc-schemas/content.d.ts +3 -15
  42. package/dist/doc-schemas/content.d.ts.map +1 -1
  43. package/dist/doc-schemas/content.js +23 -23
  44. package/dist/doc-schemas/content.js.map +1 -1
  45. package/dist/doc-schemas/notification-ledger.d.ts +3 -4
  46. package/dist/doc-schemas/notification-ledger.d.ts.map +1 -1
  47. package/dist/doc-schemas/notification-ledger.js +3 -2
  48. package/dist/doc-schemas/notification-ledger.js.map +1 -1
  49. package/dist/doc-schemas/registry.d.ts +9 -16
  50. package/dist/doc-schemas/registry.d.ts.map +1 -1
  51. package/dist/doc-schemas/system.d.ts +5 -0
  52. package/dist/doc-schemas/system.d.ts.map +1 -1
  53. package/dist/doc-schemas/system.js +4 -1
  54. package/dist/doc-schemas/system.js.map +1 -1
  55. package/dist/media/atoms.d.ts +2 -0
  56. package/dist/media/atoms.d.ts.map +1 -1
  57. package/dist/media/atoms.js +4 -0
  58. package/dist/media/atoms.js.map +1 -1
  59. package/dist/media/domain-events-admin.d.ts +2 -0
  60. package/dist/media/domain-events-admin.d.ts.map +1 -1
  61. package/dist/media/domain-events-admin.js +6 -3
  62. package/dist/media/domain-events-admin.js.map +1 -1
  63. package/dist/media/domain-events.d.ts +2 -0
  64. package/dist/media/domain-events.d.ts.map +1 -1
  65. package/dist/media/pending-media.d.ts +22 -0
  66. package/dist/media/pending-media.d.ts.map +1 -1
  67. package/dist/media/target-info.d.ts +9 -10
  68. package/dist/media/target-info.d.ts.map +1 -1
  69. package/dist/media/target-info.js +10 -15
  70. package/dist/media/target-info.js.map +1 -1
  71. package/dist/permissions/work-project-permissions-data.d.ts +0 -15
  72. package/dist/permissions/work-project-permissions-data.d.ts.map +1 -1
  73. package/dist/permissions/work-project-permissions-data.js +0 -15
  74. package/dist/permissions/work-project-permissions-data.js.map +1 -1
  75. package/dist/schemas/admin.d.ts +71 -54
  76. package/dist/schemas/admin.d.ts.map +1 -1
  77. package/dist/schemas/admin.js +51 -35
  78. package/dist/schemas/admin.js.map +1 -1
  79. package/dist/schemas/atoms.d.ts +1 -1
  80. package/dist/schemas/atoms.d.ts.map +1 -1
  81. package/dist/schemas/atoms.js +4 -4
  82. package/dist/schemas/atoms.js.map +1 -1
  83. package/dist/schemas/chat.d.ts +13 -13
  84. package/dist/schemas/chat.js +17 -16
  85. package/dist/schemas/chat.js.map +1 -1
  86. package/dist/schemas/commissions.d.ts +1 -1
  87. package/dist/schemas/commissions.d.ts.map +1 -1
  88. package/dist/schemas/commissions.js +3 -2
  89. package/dist/schemas/commissions.js.map +1 -1
  90. package/dist/schemas/hall-library.d.ts +11 -32
  91. package/dist/schemas/hall-library.d.ts.map +1 -1
  92. package/dist/schemas/hall-library.js +22 -35
  93. package/dist/schemas/hall-library.js.map +1 -1
  94. package/dist/schemas/index.d.ts +1 -0
  95. package/dist/schemas/index.d.ts.map +1 -1
  96. package/dist/schemas/index.js +1 -0
  97. package/dist/schemas/index.js.map +1 -1
  98. package/dist/schemas/ncii.d.ts +14 -14
  99. package/dist/schemas/ncii.d.ts.map +1 -1
  100. package/dist/schemas/ncii.js +14 -16
  101. package/dist/schemas/ncii.js.map +1 -1
  102. package/dist/schemas/notification.d.ts +4 -4
  103. package/dist/schemas/notification.d.ts.map +1 -1
  104. package/dist/schemas/notification.js +14 -11
  105. package/dist/schemas/notification.js.map +1 -1
  106. package/dist/schemas/payments.d.ts +1 -1
  107. package/dist/schemas/payments.d.ts.map +1 -1
  108. package/dist/schemas/payments.js +3 -1
  109. package/dist/schemas/payments.js.map +1 -1
  110. package/dist/schemas/public-documents.d.ts +18 -18
  111. package/dist/schemas/safety.d.ts +9 -5
  112. package/dist/schemas/safety.d.ts.map +1 -1
  113. package/dist/schemas/safety.js +18 -9
  114. package/dist/schemas/safety.js.map +1 -1
  115. package/dist/schemas/social.d.ts +1 -1
  116. package/dist/schemas/social.d.ts.map +1 -1
  117. package/dist/schemas/social.js +2 -3
  118. package/dist/schemas/social.js.map +1 -1
  119. package/dist/schemas/text-field.d.ts +12 -0
  120. package/dist/schemas/text-field.d.ts.map +1 -0
  121. package/dist/schemas/text-field.js +20 -0
  122. package/dist/schemas/text-field.js.map +1 -0
  123. package/dist/schemas/users.d.ts +9 -9
  124. package/dist/schemas/users.d.ts.map +1 -1
  125. package/dist/schemas/users.js +9 -11
  126. package/dist/schemas/users.js.map +1 -1
  127. package/dist/schemas/utility.d.ts +4 -4
  128. package/dist/schemas/utility.d.ts.map +1 -1
  129. package/dist/schemas/utility.js +11 -11
  130. package/dist/schemas/utility.js.map +1 -1
  131. package/dist/schemas/work-project-management.d.ts +24 -19
  132. package/dist/schemas/work-project-management.d.ts.map +1 -1
  133. package/dist/schemas/work-project-management.js +36 -37
  134. package/dist/schemas/work-project-management.js.map +1 -1
  135. package/dist/types/audit.d.ts +1 -1
  136. package/dist/types/audit.d.ts.map +1 -1
  137. package/dist/types/audit.js.map +1 -1
  138. package/dist/upload-variables/apply-to-commission-variables.d.ts +1 -1
  139. package/dist/upload-variables/apply-to-commission-variables.d.ts.map +1 -1
  140. package/dist/upload-variables/apply-to-commission-variables.js +3 -2
  141. package/dist/upload-variables/apply-to-commission-variables.js.map +1 -1
  142. package/dist/upload-variables/create-admin-audition-variables.d.ts +4 -4
  143. package/dist/upload-variables/create-admin-audition-variables.js +5 -3
  144. package/dist/upload-variables/create-admin-audition-variables.js.map +1 -1
  145. package/dist/upload-variables/create-commission-variables.d.ts +2 -2
  146. package/dist/upload-variables/create-commission-variables.d.ts.map +1 -1
  147. package/dist/upload-variables/create-commission-variables.js +4 -3
  148. package/dist/upload-variables/create-commission-variables.js.map +1 -1
  149. package/dist/upload-variables/create-work-project-audition-variables.d.ts +2 -2
  150. package/dist/upload-variables/create-work-project-audition-variables.js +5 -3
  151. package/dist/upload-variables/create-work-project-audition-variables.js.map +1 -1
  152. package/dist/upload-variables/square-streetz-post-variables.d.ts +1 -1
  153. package/dist/upload-variables/square-streetz-post-variables.d.ts.map +1 -1
  154. package/dist/upload-variables/square-streetz-post-variables.js +2 -3
  155. package/dist/upload-variables/square-streetz-post-variables.js.map +1 -1
  156. package/dist/utils/hall-content.d.ts +10 -3
  157. package/dist/utils/hall-content.d.ts.map +1 -1
  158. package/dist/utils/hall-content.js +22 -13
  159. package/dist/utils/hall-content.js.map +1 -1
  160. package/dist/utils/index.d.ts +3 -0
  161. package/dist/utils/index.d.ts.map +1 -1
  162. package/dist/utils/index.js +3 -0
  163. package/dist/utils/index.js.map +1 -1
  164. package/dist/utils/text-field.d.ts +17 -0
  165. package/dist/utils/text-field.d.ts.map +1 -0
  166. package/dist/utils/text-field.js +36 -0
  167. package/dist/utils/text-field.js.map +1 -0
  168. package/dist/utils/work-publish-readiness.d.ts +69 -0
  169. package/dist/utils/work-publish-readiness.d.ts.map +1 -0
  170. package/dist/utils/work-publish-readiness.js +80 -0
  171. package/dist/utils/work-publish-readiness.js.map +1 -0
  172. package/dist/utils/work-realm-name.d.ts +8 -0
  173. package/dist/utils/work-realm-name.d.ts.map +1 -0
  174. package/dist/utils/work-realm-name.js +12 -0
  175. package/dist/utils/work-realm-name.js.map +1 -0
  176. package/package.json +4 -3
@@ -1,5 +1,7 @@
1
1
  import type { WorkProjectType } from '../types/content.js';
2
- export type AppMode = 'charter' | 'full';
2
+ /** The app's two modes: charter (the pre-funding limits) and full. */
3
+ export declare const APP_MODES: readonly ["charter", "full"];
4
+ export type AppMode = (typeof APP_MODES)[number];
3
5
  /** The deployed mode. Changing this constant (and publishing) IS the flip. */
4
6
  export declare const APP_MODE: AppMode;
5
7
  /** Pick the active value for a mode-varied limit. */
@@ -1 +1 @@
1
- {"version":3,"file":"app-mode.d.ts","sourceRoot":"","sources":["../../src/constants/app-mode.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,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E,cAAc,CAAC;QACvC,oBAAoB,EAAE,cAAc,CAAC;QACrC,sBAAsB,EAAE,cAAc,CAAC;QACvC,QAAQ,EAAE,cAAc,CAAC;QACzB,iBAAiB,EAAE,cAAc,CAAC;QAClC,aAAa,EAAE,cAAc,CAAC;QAC9B,kBAAkB,EAAE,cAAc,CAAC;QACnC,cAAc,EAAE,cAAc,CAAC;QAC/B,eAAe,EAAE,cAAc,CAAC;QAChC,UAAU,EAAE,cAAc,CAAC;QAC3B,eAAe,EAAE,cAAc,CAAC;QAChC,eAAe,EAAE,cAAc,CAAC;KACjC,CAAC;CACH;AAED,eAAO,MAAM,cAAc,EAAE,SAgI5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,SA4FzB,CAAC;AAEF;;;0DAG0D;AAC1D,eAAO,MAAM,aAAa,EAAE,SAA+C,CAAC;AAK5E;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAI3F,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EACf,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,OAAO,MAAM,KACZ,MAMF,CAAC"}
@@ -9,6 +9,8 @@
9
9
  // min/max are deliberately mode-invariant — with ONE ruled exception (DJ
10
10
  // 2026-07-13): chapter body content (maxChapterContentLength), because it
11
11
  // bounds threshold-review reading effort per item during charter season.
12
+ /** The app's two modes: charter (the pre-funding limits) and full. */
13
+ export const APP_MODES = ['charter', 'full'];
12
14
  /** The deployed mode. Changing this constant (and publishing) IS the flip. */
13
15
  export const APP_MODE = 'charter';
14
16
  /** Pick the active value for a mode-varied limit. */
@@ -1 +1 @@
1
- {"version":3,"file":"app-mode.js","sourceRoot":"","sources":["../../src/constants/app-mode.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wEAAwE;AACxE,yEAAyE;AACzE,+DAA+D;AAC/D,2DAA2D;AAC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C,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC;CACnF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAe,EACf,KAAa,EACb,IAAY,EACZ,IAAa,EACL,EAAE;IACV,MAAM,IAAI,GAAG,MAAM,CACjB,GAAG,OAAO,8CAA8C,KAAK,IAAI,IAAI,0CAA0C,EAC/G,GAAG,OAAO,+BAA+B,KAAK,IAAI,IAAI,GAAG,CAC1D,CAAC;IACF,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACzC,CAAC,CAAC","sourcesContent":["// App mode + the charter/full limit sets — the single published constant that\n// drives the whole app's cost posture. The flip to full-live is: change\n// APP_MODE → publish ttt-core → install in ttt-prod (root + functions) →\n// deploy. There is NO runtime mode flag and NO console toggle.\n// See ttt-prod docs/design/charter-season-and-app-mode.md.\n//\n// Only real cost/abuse drivers vary by mode: media specs (ttt-media-specs.ts),\n// rate-limit values, count caps, batch sizes. Text-length limits and payment\n// min/max are deliberately mode-invariant — with ONE ruled exception (DJ\n// 2026-07-13): chapter body content (maxChapterContentLength), because it\n// bounds threshold-review reading effort per item during charter season.\n\nimport type { WorkProjectType } from '../types/content.js';\n\nexport type AppMode = 'charter' | 'full';\n\n/** The deployed mode. Changing this constant (and publishing) IS the flip. */\nexport const APP_MODE: AppMode = 'charter';\n\n/** Pick the active value for a mode-varied limit. */\nexport const byMode = <T>(charter: T, full: T): T =>\n (APP_MODE as AppMode) === 'charter' ? charter : full;\n\n/** Upstash-style sliding-window duration, e.g. '1 h'. */\nexport type RateLimitWindow = `${number} ${'ms' | 's' | 'm' | 'h' | 'd'}`;\n\nexport interface RateLimitValue {\n maxRequests: number;\n window: RateLimitWindow;\n}\n\nexport interface TttLimits {\n mode: AppMode;\n user: {\n maxCraftSkills: number;\n maxOwnedWorkProjects: number;\n maxAssociatedWorkProjects: number;\n };\n workProject: {\n maxGuildSize: number;\n maxFileFolders: number;\n maxWorkFiles: number;\n maxWorkFileStorageBytes: number;\n maxWorkProjectAuditions: number;\n maxCommissionListings: number;\n maxChapters: number;\n /** Chapter BODY length (chars) — the one mode-varied text limit (DJ 2026-07-13). */\n maxChapterContentLength: number;\n maxTuneTracks: number;\n maxTelevisionEpisodes: number;\n };\n /** Conversation Files container caps — PER CONVERSATION (one guild-invite\n * conversation or one admin-support dispatch thread). Both scopes share one cap\n * set; guild chat channels have no Conversation Files. DJ ruling 2026-07-25. */\n conversation: {\n /** Published active Conversation Files allowed in one conversation. */\n maxConversationFiles: number;\n /** Published STORED-OUTPUT bytes allowed in one conversation. */\n maxConversationFileStorageBytes: number;\n };\n hall: {\n maxSubmitBatch: number;\n };\n batches: {\n trendingFeedProcessLimit: number;\n maxFeedbackSubmitters: number;\n };\n /** Values for the backend rate limiters. Prefixes/factory stay in functions. */\n rateLimits: {\n UPLOAD: RateLimitValue;\n ADMIN_UPLOAD: RateLimitValue;\n CONTENT_WRITE: RateLimitValue;\n VOTE: RateLimitValue;\n MODERATION: RateLimitValue;\n SENSITIVE_ACTION: RateLimitValue;\n DISPLAY_NAME_CHECK: RateLimitValue;\n CHAT_MESSAGE: RateLimitValue;\n ADMIN_TASK: RateLimitValue;\n APPEAL_REVIEW: RateLimitValue;\n BAN_ACTION: RateLimitValue;\n SHARE_TRANSFER: RateLimitValue;\n CONTENT_REPORT: RateLimitValue;\n SHORT_LINK_CLICK: RateLimitValue;\n FOLLOW: RateLimitValue;\n MENTION_HISTORY: RateLimitValue;\n MEDIA_GRANT: RateLimitValue;\n CHAT_GRANT: RateLimitValue;\n OPERATOR_STEP_UP: RateLimitValue;\n ADMIN_MESSAGE_READ: RateLimitValue;\n USER_LOOKUP: RateLimitValue;\n NOTIFICATION_BROADCAST: RateLimitValue;\n NOTIFICATION_ARCHIVE: RateLimitValue;\n NOTIFICATION_MARK_SEEN: RateLimitValue;\n FEEDBACK: RateLimitValue;\n SHORT_LINK_CREATE: RateLimitValue;\n INVITE_ACTION: RateLimitValue;\n LIBRARY_SUBMISSION: RateLimitValue;\n CHANNEL_CREATE: RateLimitValue;\n CHECKOUT_CREATE: RateLimitValue;\n AGE_ATTEST: RateLimitValue;\n HALL_PREFERENCE: RateLimitValue;\n REFUND_DECISION: RateLimitValue;\n };\n}\n\nexport const CHARTER_LIMITS: TttLimits = {\n mode: 'charter',\n user: {\n maxCraftSkills: 8,\n maxOwnedWorkProjects: 3,\n maxAssociatedWorkProjects: 10,\n },\n workProject: {\n maxGuildSize: 25,\n maxFileFolders: 10,\n maxWorkFiles: 100,\n maxWorkFileStorageBytes: 2_684_354_560, // 2.5 GiB\n maxWorkProjectAuditions: 3,\n maxCommissionListings: 3,\n maxChapters: 5,\n // ~5,000 words — a full real chapter, while keeping the human threshold-review\n // reading effort per item bounded during charter season.\n maxChapterContentLength: 30_000,\n maxTuneTracks: 5,\n maxTelevisionEpisodes: 3,\n },\n // Conversation Files are QUOTA'D PER CONVERSATION (DJ ruling 2026-07-25). Counted on\n // STORED OUTPUT bytes (what actually sits in R2 after transcode), never on raw upload\n // bytes. Rationale: a per-file `maxBytes` cap alone bounds one upload but nothing stops\n // unbounded accumulation across a long-running conversation — this is the abuse brake\n // on that, and it is what `startUpload`'s reservation and the publication transfer both\n // check. Charter: 10 files / 500 MiB per conversation.\n conversation: {\n maxConversationFiles: 10,\n maxConversationFileStorageBytes: 524_288_000, // 500 MiB\n },\n hall: { maxSubmitBatch: 10 },\n batches: { trendingFeedProcessLimit: 250, maxFeedbackSubmitters: 25 },\n rateLimits: {\n // Uploads are charged ONCE per upload (in startUpload); the processor-side\n // check is a non-charging guard.\n UPLOAD: { maxRequests: 15, window: '1 h' },\n // A separate HIGHER bucket for uploads performed through the sanctioned admin\n // authority path — never an exemption. Bulk admin setup work (creating 3\n // auditions is ~5 uploads) exhausts the 15/h user bucket; 60/h covers a real\n // bulk admin session while keeping a brake on a compromised admin token and on\n // third-party quota/cost (Vision / Video Intelligence / R2). DJ ruling 2026-07-25.\n ADMIN_UPLOAD: { maxRequests: 60, window: '1 h' },\n // General content-write throttle for the non-upload write callables (text posts,\n // craft-skill edits, support-thread starts) that used to charge UPLOAD. Sharing\n // the 15/h charter upload window meant heavy text posting blocked real uploads\n // and vice versa; a separate 30/h bucket keeps each cost driver on its own\n // ceiling. DJ ruling 2026-07-25.\n CONTENT_WRITE: { maxRequests: 30, window: '1 h' },\n VOTE: { maxRequests: 100, window: '1 h' },\n MODERATION: { maxRequests: 50, window: '1 h' },\n // 30/h: one bucket is shared by ~35 callables (register, become-artisan,\n // create-work, invites, trades, appeals, …) — a real first-hour artisan does\n // 10-15 legitimate sensitive actions; 5/h blocked the intended golden path\n // (proven live by the hosted-dev E2E, 2026-07-07). DJ ruling 2026-07-08.\n SENSITIVE_ACTION: { maxRequests: 30, window: '1 h' },\n // 120/h (charter): checkDisplayNameAvailable is enforceAppCheck:true, so\n // reCAPTCHA-Enterprise attestation is the real abuse gate — this bucket is a\n // cost/DoS ceiling, not the security boundary. It is IP-keyed (pre-registration,\n // no uid yet) and the register form fires it debounced-LIVE as you type, so one\n // legit registrant spends ~3-8 checks and shared NAT/CGNAT multiplies that across\n // everyone on the IP. The old 20/h false-rejected legitimate shared-IP users and\n // could not fit a full hosted-dev E2E suite run on one IP. DJ ruling 2026-07-21.\n DISPLAY_NAME_CHECK: { maxRequests: 120, window: '1 h' },\n CHAT_MESSAGE: { maxRequests: 125, window: '1 h' },\n ADMIN_TASK: { maxRequests: 60, window: '1 h' },\n APPEAL_REVIEW: { maxRequests: 30, window: '1 h' },\n BAN_ACTION: { maxRequests: 20, window: '1 h' },\n SHARE_TRANSFER: { maxRequests: 10, window: '1 h' },\n CONTENT_REPORT: { maxRequests: 5, window: '1 h' },\n SHORT_LINK_CLICK: { maxRequests: 60, window: '1 h' },\n FOLLOW: { maxRequests: 20, window: '1 m' },\n MENTION_HISTORY: { maxRequests: 120, window: '1 h' },\n // Scoped-media grant minting (createMediaGrant). Its OWN bucket — it used to charge\n // MENTION_HISTORY, an unrelated surface, so neither limit meant what its name said and the\n // two shared a budget sized for neither (BACKEND-013). Refresh-driven, not user-initiated:\n // a grant is short-TTL (60 min work media, 15 min chat/folder scopes) and the client re-mints\n // under expiry, so a browsing session naturally spends several per hour PER SCOPE (each work,\n // each private file folder, each conversation). Cheap to serve (a Firestore permission read\n // plus an HMAC sign — no third-party cost), and a false 429 breaks media rendering outright,\n // so the ceiling is generous: it exists to stop a scripted grant-farming sweep, not to pace a\n // real reader. 120/h charter.\n MEDIA_GRANT: { maxRequests: 120, window: '1 h' },\n // Realtime chat grant minting (mintChatGrant) — previously NO limiter at all (BACKEND-013),\n // despite minting signed grants at concurrency: 20. Same refresh-driven shape as MEDIA_GRANT:\n // a 15-minute grant TTL means ~4 mints/hour for the inbox plus ~4 per open channel, doubled\n // again by socket reconnects on a flaky mobile network. It stays behind the per-channel\n // authorizeChannelScope gate, so this bucket is a cost/DoS ceiling rather than the\n // authorization boundary — sized to match MEDIA_GRANT so the two grant surfaces are paced\n // alike and neither can be starved by the other (separate Redis prefixes).\n CHAT_GRANT: { maxRequests: 120, window: '1 h' },\n // Operator step-up TOTP verification (confirmOperatorStepUp / verifyOperatorStepUp) —\n // previously unthrottled, so an attacker holding a stolen full-admin session could\n // brute-force the 6-digit second factor guarding the safety console (BACKEND-013).\n // DELIBERATELY THE TIGHTEST BUCKET IN THE SET: a real operator enrolls once and verifies\n // roughly twice an hour (the grant window is 30 minutes), so 10/h absorbs every legitimate\n // mistype while capping guessing at 10 attempts per hour against a code that rotates every\n // 30 seconds. Mode-INVARIANT — this is an admin security control, not a cost driver, so it\n // never loosens at the full-mode flip (same posture as MODERATION / BAN_ACTION / USER_LOOKUP).\n // The lockout-after-N-failures behaviour is a separate app-side concern; this is the throttle.\n OPERATOR_STEP_UP: { maxRequests: 10, window: '1 h' },\n ADMIN_MESSAGE_READ: { maxRequests: 60, window: '1 h' },\n // Admin exact-account lookup (searchPublicUsers / lookupUserByEmailOrUid) — a read, so a\n // generous per-minute bucket that still backstops a scripted enumeration sweep. Admin-only\n // and not a cost driver, so the value is the same in both modes (like MODERATION/ADMIN_TASK).\n USER_LOOKUP: { maxRequests: 30, window: '1 m' },\n NOTIFICATION_BROADCAST: { maxRequests: 10, window: '1 h' },\n NOTIFICATION_ARCHIVE: { maxRequests: 120, window: '1 h' },\n NOTIFICATION_MARK_SEEN: { maxRequests: 120, window: '1 h' },\n FEEDBACK: { maxRequests: 10, window: '1 h' },\n SHORT_LINK_CREATE: { maxRequests: 30, window: '1 h' },\n INVITE_ACTION: { maxRequests: 30, window: '1 h' },\n LIBRARY_SUBMISSION: { maxRequests: 10, window: '1 h' },\n CHANNEL_CREATE: { maxRequests: 5, window: '1 h' },\n CHECKOUT_CREATE: { maxRequests: 5, window: '1 h' },\n // The registration age step, keyed per hashed client IP (pre-account, no uid). One call per\n // attempt — a corrected date or a retry at most doubles it — so 30/h gives one IP the same\n // registrants per hour as DISPLAY_NAME_CHECK's 120/h at its 3–8 debounced checks each, while a\n // script minting age-attestation records gets far less headroom.\n AGE_ATTEST: { maxRequests: 30, window: '1 h' },\n // A member's own Hall settings, ink marks, hidden Works, reading position, and recently viewed\n // list. Reading position and recently viewed are written as the member reads, so the bucket is\n // sized like NOTIFICATION_MARK_SEEN, the other passive per-member write.\n HALL_PREFERENCE: { maxRequests: 120, window: '1 h' },\n // An admin's approve or deny of a refund request. Admin-only, so mode-invariant like\n // APPEAL_REVIEW, the other admin decision on a member's request.\n REFUND_DECISION: { maxRequests: 30, window: '1 h' },\n },\n};\n\nexport const FULL_LIMITS: TttLimits = {\n mode: 'full',\n user: {\n maxCraftSkills: 24,\n maxOwnedWorkProjects: 25,\n maxAssociatedWorkProjects: 100,\n },\n workProject: {\n maxGuildSize: 250,\n maxFileFolders: 25,\n maxWorkFiles: 1000,\n maxWorkFileStorageBytes: 26_843_545_600, // 25 GiB\n maxWorkProjectAuditions: 10,\n maxCommissionListings: 10,\n maxChapters: 50,\n // The intentional design ceiling (~17,000 words; trivially inside Firestore's\n // 1 MiB doc limit) — the audit trail deliberately stores field LENGTHS, not\n // content, because chapters can be this large (runUpdateChapterDetails).\n maxChapterContentLength: 100_000,\n maxTuneTracks: 50,\n maxTelevisionEpisodes: 25,\n },\n // 20 files / 1 GiB (full): the same per-conversation Conversation Files quota as\n // charter, scaled for a public-launch conversation. Still a hard ceiling on\n // unbounded R2 accumulation. See the CHARTER_LIMITS note above. DJ ruling 2026-07-25.\n conversation: {\n maxConversationFiles: 20,\n maxConversationFileStorageBytes: 1_073_741_824, // 1 GiB\n },\n hall: { maxSubmitBatch: 50 },\n batches: { trendingFeedProcessLimit: 1000, maxFeedbackSubmitters: 100 },\n rateLimits: {\n UPLOAD: { maxRequests: 30, window: '1 h' },\n // 120/h (full): the same sanctioned-admin-path upload bucket as charter, scaled\n // with UPLOAD — always HIGHER than the user bucket, never an exemption, so a\n // compromised admin token and third-party media cost stay bounded. See the\n // CHARTER_LIMITS note above. DJ ruling 2026-07-25.\n ADMIN_UPLOAD: { maxRequests: 120, window: '1 h' },\n // 60/h (full): the same non-upload content-write bucket as charter, scaled with\n // UPLOAD so text writes and media uploads never consume each other's ceiling.\n // See the CHARTER_LIMITS note above. DJ ruling 2026-07-25.\n CONTENT_WRITE: { maxRequests: 60, window: '1 h' },\n VOTE: { maxRequests: 200, window: '1 h' },\n MODERATION: { maxRequests: 50, window: '1 h' },\n // 60/h: full-mode power users managing several works do dozens of legitimate\n // management actions per hour; still a hard backstop against scripts.\n // DJ ruling 2026-07-08 (charter 30 / full 60, single bucket; a bucket split\n // is filed post-launch in ttt-prod docs/post-launch/).\n SENSITIVE_ACTION: { maxRequests: 60, window: '1 h' },\n // 300/h (full): same reasoning as the charter value above (App-Check-gated\n // cost ceiling, IP-keyed, debounced-live). Public-launch CGNAT exposure is far\n // larger — hundreds of concurrent legit registrants can sit behind one carrier\n // IP — so err generous; the only cost of \"too high\" is trivial Firestore reads,\n // while \"too low\" false-rejects real users. Raise on evidence (watch prod logs\n // for legit 429s) rather than pre-emptively tightening. DJ ruling 2026-07-21.\n DISPLAY_NAME_CHECK: { maxRequests: 300, window: '1 h' },\n CHAT_MESSAGE: { maxRequests: 150, window: '1 h' },\n ADMIN_TASK: { maxRequests: 60, window: '1 h' },\n APPEAL_REVIEW: { maxRequests: 30, window: '1 h' },\n BAN_ACTION: { maxRequests: 20, window: '1 h' },\n SHARE_TRANSFER: { maxRequests: 10, window: '1 h' },\n CONTENT_REPORT: { maxRequests: 20, window: '1 h' },\n SHORT_LINK_CLICK: { maxRequests: 60, window: '1 h' },\n FOLLOW: { maxRequests: 60, window: '1 m' },\n MENTION_HISTORY: { maxRequests: 120, window: '1 h' },\n // 240/h (full): the same grant-minting buckets as charter, doubled with the surrounding\n // content limits. Full mode raises the ceilings a grant is minted PER (250-guildmate guilds,\n // 25 file folders, 1000 work files, 10 auditions), so one session legitimately touches more\n // scopes and re-mints more often. See the CHARTER_LIMITS notes above.\n MEDIA_GRANT: { maxRequests: 240, window: '1 h' },\n CHAT_GRANT: { maxRequests: 240, window: '1 h' },\n // Operator step-up stays at 10/h in BOTH modes — an admin second-factor throttle is a\n // security control, not a cost lever, so it never loosens at the flip. See CHARTER_LIMITS.\n OPERATOR_STEP_UP: { maxRequests: 10, window: '1 h' },\n ADMIN_MESSAGE_READ: { maxRequests: 60, window: '1 h' },\n // Admin exact-account lookup — same read bucket in both modes (see CHARTER_LIMITS note).\n USER_LOOKUP: { maxRequests: 30, window: '1 m' },\n NOTIFICATION_BROADCAST: { maxRequests: 10, window: '1 h' },\n NOTIFICATION_ARCHIVE: { maxRequests: 120, window: '1 h' },\n NOTIFICATION_MARK_SEEN: { maxRequests: 120, window: '1 h' },\n FEEDBACK: { maxRequests: 10, window: '1 h' },\n SHORT_LINK_CREATE: { maxRequests: 30, window: '1 h' },\n INVITE_ACTION: { maxRequests: 60, window: '1 h' },\n LIBRARY_SUBMISSION: { maxRequests: 20, window: '1 h' },\n CHANNEL_CREATE: { maxRequests: 20, window: '1 h' },\n CHECKOUT_CREATE: { maxRequests: 20, window: '1 h' },\n // Scaled with DISPLAY_NAME_CHECK's full-mode 300/h — see the CHARTER_LIMITS note.\n AGE_ATTEST: { maxRequests: 75, window: '1 h' },\n // Both stay at their charter values — see the CHARTER_LIMITS notes.\n HALL_PREFERENCE: { maxRequests: 120, window: '1 h' },\n REFUND_DECISION: { maxRequests: 30, window: '1 h' },\n },\n};\n\n/** The resolved limit set for the deployed mode. Import THIS (or the alias\n * constants that re-export from it), never CHARTER_/FULL_ directly. A read bound\n * that must hold whichever mode the data was written under uses\n * HALL_SUB_ITEM_READ_BOUND_BY_WORK_TYPE below instead. */\nexport const ACTIVE_LIMITS: TttLimits = byMode(CHARTER_LIMITS, FULL_LIMITS);\n\nconst largestInAnyMode = (pick: (limits: TttLimits) => number): number =>\n Math.max(pick(CHARTER_LIMITS), pick(FULL_LIMITS));\n\n/**\n * The most sub-items one Hall item can hold of each kind (Tale chapters, Tune tracks, Television\n * episodes) in ANY app mode — each kind's count cap at its largest across CHARTER_LIMITS and\n * FULL_LIMITS. A READ bound, never an enforced limit: a Hall item keeps the sub-items it was\n * published with when the mode changes, so a reader that must see all of them sizes its query\n * from this and treats a read that returns more as uncertain. Enforcement reads the active caps\n * (MAX_CHAPTERS, MAX_TUNE_TRACKS, MAX_TELEVISION_EPISODES).\n */\nexport const HALL_SUB_ITEM_READ_BOUND_BY_WORK_TYPE: Readonly<Record<WorkProjectType, number>> = {\n Tales: largestInAnyMode((limits) => limits.workProject.maxChapters),\n Tunes: largestInAnyMode((limits) => limits.workProject.maxTuneTracks),\n Television: largestInAnyMode((limits) => limits.workProject.maxTelevisionEpisodes),\n};\n\n/**\n * User-facing copy for a reached count cap — the ONE owner of the cap-message\n * shape, beside the limits it describes. Every callable refusing on a\n * mode-varied count cap formats through this. In charter mode the message\n * names Charter Season so the cap reads as the season's limit rather than the\n * platform's permanent shape; full mode stays neutral. `hint` is an optional\n * trailing sentence (e.g. \"Delete a file to add another.\").\n */\nexport const countCapReachedMessage = (\n subject: string,\n limit: number,\n noun: string,\n hint?: string,\n): string => {\n const base = byMode(\n `${subject} already has the Charter Season maximum of ${limit} ${noun} — caps expand when Charter Season ends.`,\n `${subject} already has the maximum of ${limit} ${noun}.`,\n );\n return hint ? `${base} ${hint}` : base;\n};\n"]}
1
+ {"version":3,"file":"app-mode.js","sourceRoot":"","sources":["../../src/constants/app-mode.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wEAAwE;AACxE,yEAAyE;AACzE,+DAA+D;AAC/D,2DAA2D;AAC3D,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AAIzE,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,MAAM,CAAU,CAAC;AAGtD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,QAAQ,GAAY,SAAS,CAAC;AAE3C,qDAAqD;AACrD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAI,OAAU,EAAE,IAAO,EAAK,EAAE,CACjD,QAAoB,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAoFvD,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE;QACJ,cAAc,EAAE,CAAC;QACjB,oBAAoB,EAAE,CAAC;QACvB,yBAAyB,EAAE,EAAE;KAC9B;IACD,WAAW,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,GAAG;QACjB,uBAAuB,EAAE,aAAa,EAAE,UAAU;QAClD,uBAAuB,EAAE,CAAC;QAC1B,qBAAqB,EAAE,CAAC;QACxB,WAAW,EAAE,CAAC;QACd,+EAA+E;QAC/E,yDAAyD;QACzD,uBAAuB,EAAE,MAAM;QAC/B,aAAa,EAAE,CAAC;QAChB,qBAAqB,EAA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B,GAAG,CAAC,IAAmC,EAAU,EAAE,CACvE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAA8C;IAC9F,KAAK,EAAE,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC;IACnE,KAAK,EAAE,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC;IACrE,UAAU,EAAE,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC;CACnF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAe,EACf,KAAa,EACb,IAAY,EACZ,IAAa,EACL,EAAE;IACV,MAAM,IAAI,GAAG,MAAM,CACjB,GAAG,OAAO,8CAA8C,KAAK,IAAI,IAAI,0CAA0C,EAC/G,GAAG,OAAO,+BAA+B,KAAK,IAAI,IAAI,GAAG,CAC1D,CAAC;IACF,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACzC,CAAC,CAAC","sourcesContent":["// App mode + the charter/full limit sets — the single published constant that\n// drives the whole app's cost posture. The flip to full-live is: change\n// APP_MODE → publish ttt-core → install in ttt-prod (root + functions) →\n// deploy. There is NO runtime mode flag and NO console toggle.\n// See ttt-prod docs/design/charter-season-and-app-mode.md.\n//\n// Only real cost/abuse drivers vary by mode: media specs (ttt-media-specs.ts),\n// rate-limit values, count caps, batch sizes. Text-length limits and payment\n// min/max are deliberately mode-invariant — with ONE ruled exception (DJ\n// 2026-07-13): chapter body content (maxChapterContentLength), because it\n// bounds threshold-review reading effort per item during charter season.\n\nimport type { WorkProjectType } from '../types/content.js';\n\n/** The app's two modes: charter (the pre-funding limits) and full. */\nexport const APP_MODES = ['charter', 'full'] as const;\nexport type AppMode = (typeof APP_MODES)[number];\n\n/** The deployed mode. Changing this constant (and publishing) IS the flip. */\nexport const APP_MODE: AppMode = 'charter';\n\n/** Pick the active value for a mode-varied limit. */\nexport const byMode = <T>(charter: T, full: T): T =>\n (APP_MODE as AppMode) === 'charter' ? charter : full;\n\n/** Upstash-style sliding-window duration, e.g. '1 h'. */\nexport type RateLimitWindow = `${number} ${'ms' | 's' | 'm' | 'h' | 'd'}`;\n\nexport interface RateLimitValue {\n maxRequests: number;\n window: RateLimitWindow;\n}\n\nexport interface TttLimits {\n mode: AppMode;\n user: {\n maxCraftSkills: number;\n maxOwnedWorkProjects: number;\n maxAssociatedWorkProjects: number;\n };\n workProject: {\n maxGuildSize: number;\n maxFileFolders: number;\n maxWorkFiles: number;\n maxWorkFileStorageBytes: number;\n maxWorkProjectAuditions: number;\n maxCommissionListings: number;\n maxChapters: number;\n /** Chapter BODY length (chars) — the one mode-varied text limit (DJ 2026-07-13). */\n maxChapterContentLength: number;\n maxTuneTracks: number;\n maxTelevisionEpisodes: number;\n };\n /** Conversation Files container caps — PER CONVERSATION (one guild-invite\n * conversation or one admin-support dispatch thread). Both scopes share one cap\n * set; guild chat channels have no Conversation Files. DJ ruling 2026-07-25. */\n conversation: {\n /** Published active Conversation Files allowed in one conversation. */\n maxConversationFiles: number;\n /** Published STORED-OUTPUT bytes allowed in one conversation. */\n maxConversationFileStorageBytes: number;\n };\n hall: {\n maxSubmitBatch: number;\n };\n batches: {\n trendingFeedProcessLimit: number;\n maxFeedbackSubmitters: number;\n };\n /** Values for the backend rate limiters. Prefixes/factory stay in functions. */\n rateLimits: {\n UPLOAD: RateLimitValue;\n ADMIN_UPLOAD: RateLimitValue;\n CONTENT_WRITE: RateLimitValue;\n VOTE: RateLimitValue;\n MODERATION: RateLimitValue;\n SENSITIVE_ACTION: RateLimitValue;\n DISPLAY_NAME_CHECK: RateLimitValue;\n CHAT_MESSAGE: RateLimitValue;\n ADMIN_TASK: RateLimitValue;\n APPEAL_REVIEW: RateLimitValue;\n BAN_ACTION: RateLimitValue;\n SHARE_TRANSFER: RateLimitValue;\n CONTENT_REPORT: RateLimitValue;\n SHORT_LINK_CLICK: RateLimitValue;\n FOLLOW: RateLimitValue;\n MENTION_HISTORY: RateLimitValue;\n MEDIA_GRANT: RateLimitValue;\n CHAT_GRANT: RateLimitValue;\n OPERATOR_STEP_UP: RateLimitValue;\n ADMIN_MESSAGE_READ: RateLimitValue;\n USER_LOOKUP: RateLimitValue;\n NOTIFICATION_BROADCAST: RateLimitValue;\n NOTIFICATION_ARCHIVE: RateLimitValue;\n NOTIFICATION_MARK_SEEN: RateLimitValue;\n FEEDBACK: RateLimitValue;\n SHORT_LINK_CREATE: RateLimitValue;\n INVITE_ACTION: RateLimitValue;\n LIBRARY_SUBMISSION: RateLimitValue;\n CHANNEL_CREATE: RateLimitValue;\n CHECKOUT_CREATE: RateLimitValue;\n AGE_ATTEST: RateLimitValue;\n HALL_PREFERENCE: RateLimitValue;\n REFUND_DECISION: RateLimitValue;\n };\n}\n\nexport const CHARTER_LIMITS: TttLimits = {\n mode: 'charter',\n user: {\n maxCraftSkills: 8,\n maxOwnedWorkProjects: 3,\n maxAssociatedWorkProjects: 10,\n },\n workProject: {\n maxGuildSize: 25,\n maxFileFolders: 10,\n maxWorkFiles: 100,\n maxWorkFileStorageBytes: 2_684_354_560, // 2.5 GiB\n maxWorkProjectAuditions: 3,\n maxCommissionListings: 3,\n maxChapters: 5,\n // ~5,000 words — a full real chapter, while keeping the human threshold-review\n // reading effort per item bounded during charter season.\n maxChapterContentLength: 30_000,\n maxTuneTracks: 5,\n maxTelevisionEpisodes: 3,\n },\n // Conversation Files are QUOTA'D PER CONVERSATION (DJ ruling 2026-07-25). Counted on\n // STORED OUTPUT bytes (what actually sits in R2 after transcode), never on raw upload\n // bytes. Rationale: a per-file `maxBytes` cap alone bounds one upload but nothing stops\n // unbounded accumulation across a long-running conversation — this is the abuse brake\n // on that, and it is what `startUpload`'s reservation and the publication transfer both\n // check. Charter: 10 files / 500 MiB per conversation.\n conversation: {\n maxConversationFiles: 10,\n maxConversationFileStorageBytes: 524_288_000, // 500 MiB\n },\n hall: { maxSubmitBatch: 10 },\n batches: { trendingFeedProcessLimit: 250, maxFeedbackSubmitters: 25 },\n rateLimits: {\n // Uploads are charged ONCE per upload (in startUpload); the processor-side\n // check is a non-charging guard.\n UPLOAD: { maxRequests: 15, window: '1 h' },\n // A separate HIGHER bucket for uploads performed through the sanctioned admin\n // authority path — never an exemption. Bulk admin setup work (creating 3\n // auditions is ~5 uploads) exhausts the 15/h user bucket; 60/h covers a real\n // bulk admin session while keeping a brake on a compromised admin token and on\n // third-party quota/cost (Vision / Video Intelligence / R2). DJ ruling 2026-07-25.\n ADMIN_UPLOAD: { maxRequests: 60, window: '1 h' },\n // General content-write throttle for the non-upload write callables (text posts,\n // craft-skill edits, support-thread starts) that used to charge UPLOAD. Sharing\n // the 15/h charter upload window meant heavy text posting blocked real uploads\n // and vice versa; a separate 30/h bucket keeps each cost driver on its own\n // ceiling. DJ ruling 2026-07-25.\n CONTENT_WRITE: { maxRequests: 30, window: '1 h' },\n VOTE: { maxRequests: 100, window: '1 h' },\n MODERATION: { maxRequests: 50, window: '1 h' },\n // 30/h: one bucket is shared by ~35 callables (register, become-artisan,\n // create-work, invites, trades, appeals, …) — a real first-hour artisan does\n // 10-15 legitimate sensitive actions; 5/h blocked the intended golden path\n // (proven live by the hosted-dev E2E, 2026-07-07). DJ ruling 2026-07-08.\n SENSITIVE_ACTION: { maxRequests: 30, window: '1 h' },\n // 120/h (charter): checkDisplayNameAvailable is enforceAppCheck:true, so\n // reCAPTCHA-Enterprise attestation is the real abuse gate — this bucket is a\n // cost/DoS ceiling, not the security boundary. It is IP-keyed (pre-registration,\n // no uid yet) and the register form fires it debounced-LIVE as you type, so one\n // legit registrant spends ~3-8 checks and shared NAT/CGNAT multiplies that across\n // everyone on the IP. The old 20/h false-rejected legitimate shared-IP users and\n // could not fit a full hosted-dev E2E suite run on one IP. DJ ruling 2026-07-21.\n DISPLAY_NAME_CHECK: { maxRequests: 120, window: '1 h' },\n CHAT_MESSAGE: { maxRequests: 125, window: '1 h' },\n ADMIN_TASK: { maxRequests: 60, window: '1 h' },\n APPEAL_REVIEW: { maxRequests: 30, window: '1 h' },\n BAN_ACTION: { maxRequests: 20, window: '1 h' },\n SHARE_TRANSFER: { maxRequests: 10, window: '1 h' },\n CONTENT_REPORT: { maxRequests: 5, window: '1 h' },\n SHORT_LINK_CLICK: { maxRequests: 60, window: '1 h' },\n FOLLOW: { maxRequests: 20, window: '1 m' },\n MENTION_HISTORY: { maxRequests: 120, window: '1 h' },\n // Scoped-media grant minting (createMediaGrant). Its OWN bucket — it used to charge\n // MENTION_HISTORY, an unrelated surface, so neither limit meant what its name said and the\n // two shared a budget sized for neither (BACKEND-013). Refresh-driven, not user-initiated:\n // a grant is short-TTL (60 min work media, 15 min chat/folder scopes) and the client re-mints\n // under expiry, so a browsing session naturally spends several per hour PER SCOPE (each work,\n // each private file folder, each conversation). Cheap to serve (a Firestore permission read\n // plus an HMAC sign — no third-party cost), and a false 429 breaks media rendering outright,\n // so the ceiling is generous: it exists to stop a scripted grant-farming sweep, not to pace a\n // real reader. 120/h charter.\n MEDIA_GRANT: { maxRequests: 120, window: '1 h' },\n // Realtime chat grant minting (mintChatGrant) — previously NO limiter at all (BACKEND-013),\n // despite minting signed grants at concurrency: 20. Same refresh-driven shape as MEDIA_GRANT:\n // a 15-minute grant TTL means ~4 mints/hour for the inbox plus ~4 per open channel, doubled\n // again by socket reconnects on a flaky mobile network. It stays behind the per-channel\n // authorizeChannelScope gate, so this bucket is a cost/DoS ceiling rather than the\n // authorization boundary — sized to match MEDIA_GRANT so the two grant surfaces are paced\n // alike and neither can be starved by the other (separate Redis prefixes).\n CHAT_GRANT: { maxRequests: 120, window: '1 h' },\n // Operator step-up TOTP verification (confirmOperatorStepUp / verifyOperatorStepUp) —\n // previously unthrottled, so an attacker holding a stolen full-admin session could\n // brute-force the 6-digit second factor guarding the safety console (BACKEND-013).\n // DELIBERATELY THE TIGHTEST BUCKET IN THE SET: a real operator enrolls once and verifies\n // roughly twice an hour (the grant window is 30 minutes), so 10/h absorbs every legitimate\n // mistype while capping guessing at 10 attempts per hour against a code that rotates every\n // 30 seconds. Mode-INVARIANT — this is an admin security control, not a cost driver, so it\n // never loosens at the full-mode flip (same posture as MODERATION / BAN_ACTION / USER_LOOKUP).\n // The lockout-after-N-failures behaviour is a separate app-side concern; this is the throttle.\n OPERATOR_STEP_UP: { maxRequests: 10, window: '1 h' },\n ADMIN_MESSAGE_READ: { maxRequests: 60, window: '1 h' },\n // Admin exact-account lookup (searchPublicUsers / lookupUserByEmailOrUid) — a read, so a\n // generous per-minute bucket that still backstops a scripted enumeration sweep. Admin-only\n // and not a cost driver, so the value is the same in both modes (like MODERATION/ADMIN_TASK).\n USER_LOOKUP: { maxRequests: 30, window: '1 m' },\n NOTIFICATION_BROADCAST: { maxRequests: 10, window: '1 h' },\n NOTIFICATION_ARCHIVE: { maxRequests: 120, window: '1 h' },\n NOTIFICATION_MARK_SEEN: { maxRequests: 120, window: '1 h' },\n FEEDBACK: { maxRequests: 10, window: '1 h' },\n SHORT_LINK_CREATE: { maxRequests: 30, window: '1 h' },\n INVITE_ACTION: { maxRequests: 30, window: '1 h' },\n LIBRARY_SUBMISSION: { maxRequests: 10, window: '1 h' },\n CHANNEL_CREATE: { maxRequests: 5, window: '1 h' },\n CHECKOUT_CREATE: { maxRequests: 5, window: '1 h' },\n // The registration age step, keyed per hashed client IP (pre-account, no uid). One call per\n // attempt — a corrected date or a retry at most doubles it — so 30/h gives one IP the same\n // registrants per hour as DISPLAY_NAME_CHECK's 120/h at its 3–8 debounced checks each, while a\n // script minting age-attestation records gets far less headroom.\n AGE_ATTEST: { maxRequests: 30, window: '1 h' },\n // A member's own Hall settings, ink marks, hidden Works, reading position, and recently viewed\n // list. Reading position and recently viewed are written as the member reads, so the bucket is\n // sized like NOTIFICATION_MARK_SEEN, the other passive per-member write.\n HALL_PREFERENCE: { maxRequests: 120, window: '1 h' },\n // An admin's approve or deny of a refund request. Admin-only, so mode-invariant like\n // APPEAL_REVIEW, the other admin decision on a member's request.\n REFUND_DECISION: { maxRequests: 30, window: '1 h' },\n },\n};\n\nexport const FULL_LIMITS: TttLimits = {\n mode: 'full',\n user: {\n maxCraftSkills: 24,\n maxOwnedWorkProjects: 25,\n maxAssociatedWorkProjects: 100,\n },\n workProject: {\n maxGuildSize: 250,\n maxFileFolders: 25,\n maxWorkFiles: 1000,\n maxWorkFileStorageBytes: 26_843_545_600, // 25 GiB\n maxWorkProjectAuditions: 10,\n maxCommissionListings: 10,\n maxChapters: 50,\n // The intentional design ceiling (~17,000 words; trivially inside Firestore's\n // 1 MiB doc limit) — the audit trail deliberately stores field LENGTHS, not\n // content, because chapters can be this large (runUpdateChapterDetails).\n maxChapterContentLength: 100_000,\n maxTuneTracks: 50,\n maxTelevisionEpisodes: 25,\n },\n // 20 files / 1 GiB (full): the same per-conversation Conversation Files quota as\n // charter, scaled for a public-launch conversation. Still a hard ceiling on\n // unbounded R2 accumulation. See the CHARTER_LIMITS note above. DJ ruling 2026-07-25.\n conversation: {\n maxConversationFiles: 20,\n maxConversationFileStorageBytes: 1_073_741_824, // 1 GiB\n },\n hall: { maxSubmitBatch: 50 },\n batches: { trendingFeedProcessLimit: 1000, maxFeedbackSubmitters: 100 },\n rateLimits: {\n UPLOAD: { maxRequests: 30, window: '1 h' },\n // 120/h (full): the same sanctioned-admin-path upload bucket as charter, scaled\n // with UPLOAD — always HIGHER than the user bucket, never an exemption, so a\n // compromised admin token and third-party media cost stay bounded. See the\n // CHARTER_LIMITS note above. DJ ruling 2026-07-25.\n ADMIN_UPLOAD: { maxRequests: 120, window: '1 h' },\n // 60/h (full): the same non-upload content-write bucket as charter, scaled with\n // UPLOAD so text writes and media uploads never consume each other's ceiling.\n // See the CHARTER_LIMITS note above. DJ ruling 2026-07-25.\n CONTENT_WRITE: { maxRequests: 60, window: '1 h' },\n VOTE: { maxRequests: 200, window: '1 h' },\n MODERATION: { maxRequests: 50, window: '1 h' },\n // 60/h: full-mode power users managing several works do dozens of legitimate\n // management actions per hour; still a hard backstop against scripts.\n // DJ ruling 2026-07-08 (charter 30 / full 60, single bucket; a bucket split\n // is filed post-launch in ttt-prod docs/post-launch/).\n SENSITIVE_ACTION: { maxRequests: 60, window: '1 h' },\n // 300/h (full): same reasoning as the charter value above (App-Check-gated\n // cost ceiling, IP-keyed, debounced-live). Public-launch CGNAT exposure is far\n // larger — hundreds of concurrent legit registrants can sit behind one carrier\n // IP — so err generous; the only cost of \"too high\" is trivial Firestore reads,\n // while \"too low\" false-rejects real users. Raise on evidence (watch prod logs\n // for legit 429s) rather than pre-emptively tightening. DJ ruling 2026-07-21.\n DISPLAY_NAME_CHECK: { maxRequests: 300, window: '1 h' },\n CHAT_MESSAGE: { maxRequests: 150, window: '1 h' },\n ADMIN_TASK: { maxRequests: 60, window: '1 h' },\n APPEAL_REVIEW: { maxRequests: 30, window: '1 h' },\n BAN_ACTION: { maxRequests: 20, window: '1 h' },\n SHARE_TRANSFER: { maxRequests: 10, window: '1 h' },\n CONTENT_REPORT: { maxRequests: 20, window: '1 h' },\n SHORT_LINK_CLICK: { maxRequests: 60, window: '1 h' },\n FOLLOW: { maxRequests: 60, window: '1 m' },\n MENTION_HISTORY: { maxRequests: 120, window: '1 h' },\n // 240/h (full): the same grant-minting buckets as charter, doubled with the surrounding\n // content limits. Full mode raises the ceilings a grant is minted PER (250-guildmate guilds,\n // 25 file folders, 1000 work files, 10 auditions), so one session legitimately touches more\n // scopes and re-mints more often. See the CHARTER_LIMITS notes above.\n MEDIA_GRANT: { maxRequests: 240, window: '1 h' },\n CHAT_GRANT: { maxRequests: 240, window: '1 h' },\n // Operator step-up stays at 10/h in BOTH modes — an admin second-factor throttle is a\n // security control, not a cost lever, so it never loosens at the flip. See CHARTER_LIMITS.\n OPERATOR_STEP_UP: { maxRequests: 10, window: '1 h' },\n ADMIN_MESSAGE_READ: { maxRequests: 60, window: '1 h' },\n // Admin exact-account lookup — same read bucket in both modes (see CHARTER_LIMITS note).\n USER_LOOKUP: { maxRequests: 30, window: '1 m' },\n NOTIFICATION_BROADCAST: { maxRequests: 10, window: '1 h' },\n NOTIFICATION_ARCHIVE: { maxRequests: 120, window: '1 h' },\n NOTIFICATION_MARK_SEEN: { maxRequests: 120, window: '1 h' },\n FEEDBACK: { maxRequests: 10, window: '1 h' },\n SHORT_LINK_CREATE: { maxRequests: 30, window: '1 h' },\n INVITE_ACTION: { maxRequests: 60, window: '1 h' },\n LIBRARY_SUBMISSION: { maxRequests: 20, window: '1 h' },\n CHANNEL_CREATE: { maxRequests: 20, window: '1 h' },\n CHECKOUT_CREATE: { maxRequests: 20, window: '1 h' },\n // Scaled with DISPLAY_NAME_CHECK's full-mode 300/h — see the CHARTER_LIMITS note.\n AGE_ATTEST: { maxRequests: 75, window: '1 h' },\n // Both stay at their charter values — see the CHARTER_LIMITS notes.\n HALL_PREFERENCE: { maxRequests: 120, window: '1 h' },\n REFUND_DECISION: { maxRequests: 30, window: '1 h' },\n },\n};\n\n/** The resolved limit set for the deployed mode. Import THIS (or the alias\n * constants that re-export from it), never CHARTER_/FULL_ directly. A read bound\n * that must hold whichever mode the data was written under uses\n * HALL_SUB_ITEM_READ_BOUND_BY_WORK_TYPE below instead. */\nexport const ACTIVE_LIMITS: TttLimits = byMode(CHARTER_LIMITS, FULL_LIMITS);\n\nconst largestInAnyMode = (pick: (limits: TttLimits) => number): number =>\n Math.max(pick(CHARTER_LIMITS), pick(FULL_LIMITS));\n\n/**\n * The most sub-items one Hall item can hold of each kind (Tale chapters, Tune tracks, Television\n * episodes) in ANY app mode — each kind's count cap at its largest across CHARTER_LIMITS and\n * FULL_LIMITS. A READ bound, never an enforced limit: a Hall item keeps the sub-items it was\n * published with when the mode changes, so a reader that must see all of them sizes its query\n * from this and treats a read that returns more as uncertain. Enforcement reads the active caps\n * (MAX_CHAPTERS, MAX_TUNE_TRACKS, MAX_TELEVISION_EPISODES).\n */\nexport const HALL_SUB_ITEM_READ_BOUND_BY_WORK_TYPE: Readonly<Record<WorkProjectType, number>> = {\n Tales: largestInAnyMode((limits) => limits.workProject.maxChapters),\n Tunes: largestInAnyMode((limits) => limits.workProject.maxTuneTracks),\n Television: largestInAnyMode((limits) => limits.workProject.maxTelevisionEpisodes),\n};\n\n/**\n * User-facing copy for a reached count cap — the ONE owner of the cap-message\n * shape, beside the limits it describes. Every callable refusing on a\n * mode-varied count cap formats through this. In charter mode the message\n * names Charter Season so the cap reads as the season's limit rather than the\n * platform's permanent shape; full mode stays neutral. `hint` is an optional\n * trailing sentence (e.g. \"Delete a file to add another.\").\n */\nexport const countCapReachedMessage = (\n subject: string,\n limit: number,\n noun: string,\n hint?: string,\n): string => {\n const base = byMode(\n `${subject} already has the Charter Season maximum of ${limit} ${noun} — caps expand when Charter Season ends.`,\n `${subject} already has the maximum of ${limit} ${noun}.`,\n );\n return hint ? `${base} ${hint}` : base;\n};\n"]}
@@ -55,6 +55,8 @@ export declare const MAX_THRESHOLD_REVIEW_NOTES_LENGTH = 2000;
55
55
  export declare const MAX_THRESHOLD_PUBLISH_PARKED_REASON_LENGTH = 2000;
56
56
  /** Operator-facing INTERNAL reason/rationale (LE-loggable; account actions, case reopens). */
57
57
  export declare const MAX_INTERNAL_REASON_LENGTH = 2000;
58
+ /** The optional reason an admin records when closing an account discovered to be under 13. */
59
+ export declare const MAX_UNDER_13_CLOSE_REASON_LENGTH = 1000;
58
60
  /** The generic owner-readable (user-facing) reason — deliberately short, no detail leaks. */
59
61
  export declare const MAX_USER_FACING_REASON_LENGTH = 280;
60
62
  /** Structured close-out summary on report/safety-case resolutions. */
@@ -78,6 +80,8 @@ export declare const MAX_CHAT_MODERATION_REASON_LENGTH = 1000;
78
80
  export declare const MAX_BROADCAST_EXPLICIT_UIDS = 2000;
79
81
  export declare const STEP_UP_ENROLL_REQUIRED = "OPERATOR_STEP_UP_ENROLL_REQUIRED";
80
82
  export declare const STEP_UP_REQUIRED = "OPERATOR_STEP_UP_REQUIRED";
83
+ /** How many digits an operator step-up authenticator code has. */
84
+ export declare const OPERATOR_STEP_UP_CODE_LENGTH = 6;
81
85
  /** The frozen report-time captured text snapshot (edit-to-evade guard; NO PII). */
82
86
  export declare const MAX_REPORT_SNAPSHOT_TEXT_LENGTH = 4000;
83
87
  export declare const MAX_FUTURE_PLAN_TITLE_LENGTH = 200;
@@ -110,10 +114,10 @@ export declare const MAX_REQUIRE_RETITLE_REASON_LENGTH = 500;
110
114
  export declare const MAX_USER_FACING_REASON_DETAIL_LENGTH = 2000;
111
115
  /** Admin broadcast / user notification message body. */
112
116
  export declare const MAX_NOTIFICATION_MESSAGE_LENGTH = 2000;
117
+ /** Admin broadcast title — the same length as a Work title. */
118
+ export declare const MAX_BROADCAST_TITLE_LENGTH = 150;
113
119
  /** Admin user-search query input. */
114
120
  export declare const MAX_USER_SEARCH_QUERY_LENGTH = 100;
115
- /** Operator reason on the admin "mark as NCII linked evidence" intake. */
116
- export declare const MAX_NCII_EVIDENCE_REASON_LENGTH = 1000;
117
121
  /** Operator written rationale on a TAKE IT DOWN validity decision (immutable row). */
118
122
  export declare const MAX_NCII_RATIONALE_LENGTH = 4000;
119
123
  /** Requester's statement of nonconsent (statutory intake — in-app and no-login). */
@@ -1 +1 @@
1
- {"version":3,"file":"business-admin.d.ts","sourceRoot":"","sources":["../../src/constants/business-admin.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAEnF,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB;;;;;I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O,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,gGAAgG;AAChG,eAAO,MAAM,6BAA6B,QAAoC,CAAC;AAI/E,qCAAqC;AACrC,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,uIAQ/B,CAAC;AACX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,uGAAuG;AACvG,eAAO,MAAM,mCAAmC;;;;;;;;;;;;CAYoB,CAAC;AAErE;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKtE"}
@@ -1,6 +1,7 @@
1
1
  // Admin + content-moderation business-rule constants — task priority, dispatches,
2
2
  // the moderation/feedback workflow, and admin-task lifecycle.
3
3
  import { ACTIVE_LIMITS } from './app-mode.js';
4
+ import { MAX_WORK_PROJECT_TITLE_LENGTH } from './business-work-project.js';
4
5
  // --- Admin Task Priority System ---
5
6
  export const TASK_PRIORITY = {
6
7
  CRITICAL: 4,
@@ -62,6 +63,8 @@ export const MAX_THRESHOLD_PUBLISH_PARKED_REASON_LENGTH = 2000;
62
63
  // that carries the field — the numbers must never be re-hardcoded at an enforcement point.
63
64
  /** Operator-facing INTERNAL reason/rationale (LE-loggable; account actions, case reopens). */
64
65
  export const MAX_INTERNAL_REASON_LENGTH = 2000;
66
+ /** The optional reason an admin records when closing an account discovered to be under 13. */
67
+ export const MAX_UNDER_13_CLOSE_REASON_LENGTH = 1000;
65
68
  /** The generic owner-readable (user-facing) reason — deliberately short, no detail leaks. */
66
69
  export const MAX_USER_FACING_REASON_LENGTH = 280;
67
70
  /** Structured close-out summary on report/safety-case resolutions. */
@@ -90,6 +93,8 @@ export const MAX_BROADCAST_EXPLICIT_UIDS = 2000;
90
93
  // both the callable (functions operatorStepUp.ts) and the frontend hook import these.
91
94
  export const STEP_UP_ENROLL_REQUIRED = 'OPERATOR_STEP_UP_ENROLL_REQUIRED';
92
95
  export const STEP_UP_REQUIRED = 'OPERATOR_STEP_UP_REQUIRED';
96
+ /** How many digits an operator step-up authenticator code has. */
97
+ export const OPERATOR_STEP_UP_CODE_LENGTH = 6;
93
98
  /** The frozen report-time captured text snapshot (edit-to-evade guard; NO PII). */
94
99
  export const MAX_REPORT_SNAPSHOT_TEXT_LENGTH = 4000;
95
100
  // --- Admin console config-content text caps ---
@@ -125,11 +130,11 @@ export const MAX_REQUIRE_RETITLE_REASON_LENGTH = 500;
125
130
  export const MAX_USER_FACING_REASON_DETAIL_LENGTH = 2000;
126
131
  /** Admin broadcast / user notification message body. */
127
132
  export const MAX_NOTIFICATION_MESSAGE_LENGTH = 2000;
133
+ /** Admin broadcast title — the same length as a Work title. */
134
+ export const MAX_BROADCAST_TITLE_LENGTH = MAX_WORK_PROJECT_TITLE_LENGTH;
128
135
  /** Admin user-search query input. */
129
136
  export const MAX_USER_SEARCH_QUERY_LENGTH = 100;
130
137
  // --- NCII / child-safety statutory + operator text caps ---
131
- /** Operator reason on the admin "mark as NCII linked evidence" intake. */
132
- export const MAX_NCII_EVIDENCE_REASON_LENGTH = 1000;
133
138
  /** Operator written rationale on a TAKE IT DOWN validity decision (immutable row). */
134
139
  export const MAX_NCII_RATIONALE_LENGTH = 4000;
135
140
  /** Requester's statement of nonconsent (statutory intake — in-app and no-login). */
@@ -1 +1 @@
1
- {"version":3,"file":"business-admin.js","sourceRoot":"","sources":["../../src/constants/business-admin.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,8DAA8D;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,qCAAqC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;CACE,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,C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AW;CACd,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,SAAS;IACT,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;IACd,gBAAgB;IAChB,qBAAqB;IACrB,eAAe;CACP,CAAC;AAGX,uGAAuG;AACvG,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,aAAa,EAAE,eAAe;IAC9B,sBAAsB,EAAE,iBAAiB;IACzC,UAAU,EAAE,kBAAkB;IAC9B,gBAAgB,EAAE,cAAc;IAChC,iBAAiB,EAAE,SAAS;IAC5B,mBAAmB,EAAE,SAAS;IAC9B,yBAAyB,EAAE,SAAS;IACpC,mBAAmB,EAAE,SAAS;IAC9B,qBAAqB,EAAE,gBAAgB;IACvC,kBAAkB,EAAE,gBAAgB;IACpC,wBAAwB,EAAE,qBAAqB;CACmB,CAAC;AAErE;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAgB;IAC3D,OAAO,CACL,MAAM,CAAC,MAAM,CAAC,mCAAmC,EAAE,QAAQ,CAAC;QAC5D,mCAAmC,CAAC,QAAyB,CAAC,KAAK,SAAS,CAC7E,CAAC;AACJ,CAAC","sourcesContent":["// Admin + content-moderation business-rule constants — task priority, dispatches,\n// the moderation/feedback workflow, and admin-task lifecycle.\nimport { ACTIVE_LIMITS } from './app-mode.js';\nimport type { AdminTaskType } from '../doc-schemas/report-docs.js';\n\n// --- Admin Task Priority System ---\n\nexport const TASK_PRIORITY = {\n CRITICAL: 4,\n HIGH: 3,\n NORMAL: 2,\n LOW: 1,\n} as const;\n\nexport type TaskPriorityLevel = (typeof TASK_PRIORITY)[keyof typeof TASK_PRIORITY];\n\nexport const TASK_PRIORITY_LABELS = {\n 4: 'CRITICAL',\n 3: 'HIGH',\n 2: 'NORMAL',\n 1: 'LOW',\n} as const;\n\n/**\n * Canonical NUMERIC priority scale for `adminTasks.priority`, shared by BOTH\n * priority systems so `checkoutNextImportantTask` (orderBy priority desc across all\n * task types) compares commensurable values. The userReport report-core score formula\n * already writes on this scale (≈40–2250); the level-based types (thresholdLibraryReview,\n * content-appeal, adminDispatch) map their TASK_PRIORITY level onto these numbers instead\n * of writing the raw 1–4.\n *\n * Resulting order: safety reports (1200–2250) > money anomalies (1100) >\n * CRITICAL (1000) > HIGH (800) > routine reports interleave below > spam-tier (~80).\n */\nexport const TASK_PRIORITY_SCORE = {\n LOW: 50,\n NORMAL: 200,\n HIGH: 800,\n CRITICAL: 1000,\n /** Money-integrity anomaly (stake-share / pledge-ledger corruption signal) — outranks\n * everything except safety-class reports. The three anomaly creators that previously\n * hardcoded `priority: 1` (LOW) all write this. */\n MONEY_ANOMALY: 1100,\n} as const;\n\nexport type TaskPriorityScore = (typeof TASK_PRIORITY_SCORE)[keyof typeof TASK_PRIORITY_SCORE];\n\n/** Maps a level-based TASK_PRIORITY value (1–4) to its canonical numeric score. */\nexport const TASK_PRIORITY_LEVEL_TO_SCORE = {\n [TASK_PRIORITY.LOW]: TASK_PRIORITY_SCORE.LOW,\n [TASK_PRIORITY.NORMAL]: TASK_PRIORITY_SCORE.NORMAL,\n [TASK_PRIORITY.HIGH]: TASK_PRIORITY_SCORE.HIGH,\n [TASK_PRIORITY.CRITICAL]: TASK_PRIORITY_SCORE.CRITICAL,\n} as const;\n\n// --- Admin Dispatches ---\n\n/** Maximum length for an admin-dispatch subject line. */\nexport const MAX_ADMIN_DISPATCH_SUBJECT_LENGTH = 100;\n\n/** Maximum length for the initial body text of an admin dispatch. */\nexport const MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH = 1000;\n\n// --- Content Moderation Workflow ---\n\n/** Maximum length for a content-violation appeal message. */\nexport const MAX_APPEAL_MESSAGE_LENGTH = 1000;\n\n/** Threshold-review reviewer notes (revision notes shown to the author). One owner for\n * the review callable schema AND the admin work-view input. */\nexport const MAX_THRESHOLD_REVIEW_NOTES_LENGTH = 2000;\n\n/** Operator-facing reason stamped on a threshold item whose publish parked terminally\n * (`publishParkedReason`). Server-authored text, bounded so a long copy-failure message\n * cannot grow the doc without limit. */\nexport const MAX_THRESHOLD_PUBLISH_PARKED_REASON_LENGTH = 2000;\n\n// --- Moderation / safety operator text caps ---\n// Each is declared ONCE here and derived by every input schema AND persisted doc schema\n// that carries the field — the numbers must never be re-hardcoded at an enforcement point.\n\n/** Operator-facing INTERNAL reason/rationale (LE-loggable; account actions, case reopens). */\nexport const MAX_INTERNAL_REASON_LENGTH = 2000;\n\n/** The generic owner-readable (user-facing) reason — deliberately short, no detail leaks. */\nexport const MAX_USER_FACING_REASON_LENGTH = 280;\n\n/** Structured close-out summary on report/safety-case resolutions. */\nexport const MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH = 2000;\n\n/** Optional operator note attached to a close-out. */\nexport const MAX_SAFETY_ADMIN_NOTE_LENGTH = 4000;\n\n// --- Report intake text caps ---\n\n/** Reporter free-text narrative/comment (segregated private doc; never on the root). */\nexport const MAX_REPORT_NARRATIVE_LENGTH = 4000;\n\n/** The ids a client names as the target of a report — the item, its parent reference, and the\n * owner hint. They are hints the server re-derives, so the cap only bounds what is read. */\nexport const MAX_REPORT_TARGET_ID_LENGTH = 256;\n\n/** The report DIALOG's comment field cap (the client-side compose bound — tighter than\n * the server narrative cap above, which also absorbs upgrade concatenations). */\nexport const MAX_REPORT_COMMENT_LENGTH = 1000;\n\n/** Minimum operator rationale/reason length on safety-console staged actions. */\nexport const MIN_SAFETY_RATIONALE_LENGTH = 10;\n\n/** Operator reason on an admin chat-moderation action (adminModerateChatMessage /\n * adminReadChannelContext). ONE owner for both callables' `reason` bound. */\nexport const MAX_CHAT_MODERATION_REASON_LENGTH = 1000;\n\n/** Broadcast explicitUids selector audience cap (schema + composer both derive). */\nexport const MAX_BROADCAST_EXPLICIT_UIDS = 2000;\n\n// --- Operator step-up sentinel error codes ---\n// The two backend HttpsError messages the operator TOTP step-up throws; the frontend\n// matches them to open the step-up dialog in ENROLL vs VERIFY mode. ONE declaration —\n// both the callable (functions operatorStepUp.ts) and the frontend hook import these.\nexport const STEP_UP_ENROLL_REQUIRED = 'OPERATOR_STEP_UP_ENROLL_REQUIRED';\nexport const STEP_UP_REQUIRED = 'OPERATOR_STEP_UP_REQUIRED';\n\n/** The frozen report-time captured text snapshot (edit-to-evade guard; NO PII). */\nexport const MAX_REPORT_SNAPSHOT_TEXT_LENGTH = 4000;\n\n// --- Admin console config-content text caps ---\n// Every number the system uses lives HERE — even a field only one surface consumes\n// today, because any future client (TV / phone / admin app) reads ttt-core.\n\nexport const MAX_FUTURE_PLAN_TITLE_LENGTH = 200;\nexport const MAX_FUTURE_PLAN_DESCRIPTION_LENGTH = 4000;\nexport const MAX_PLATFORM_RULE_TITLE_LENGTH = 200;\nexport const MAX_PLATFORM_RULE_DESCRIPTION_LENGTH = 4000;\nexport const MAX_AGREEMENT_POINT_LENGTH = 2000;\nexport const MAX_CONTENT_PAGE_HEADING_LENGTH = 300;\nexport const MAX_CONTENT_PAGE_BODY_LENGTH = 20000;\n/** Sections in one long-form content page (Terms, Privacy, the DMCA policy's process text). */\nexport const MAX_CONTENT_PAGE_SECTIONS = 300;\nexport const MAX_TAKE_IT_DOWN_COPY_LENGTH = 8000;\n/** DMCA policy page: the labeled contact blocks (service provider, designated agent) and their rows. */\nexport const MAX_DMCA_CONTACT_BLOCKS = 10;\nexport const MAX_DMCA_CONTACT_ROWS = 20;\nexport const MAX_DMCA_CONTACT_LABEL_LENGTH = 100;\nexport const MAX_DMCA_CONTACT_VALUE_LENGTH = 500;\nexport const MAX_MAINTENANCE_MESSAGE_LENGTH = 2000;\n\n/** `_appConfig/app.appVersion` — the force-refresh version string VersionGate compares. */\nexport const MAX_APP_VERSION_LENGTH = 64;\n\n/** Announcement-banner copy on `_appConfig/app.announcementMessage`. Deliberately far\n * shorter than the maintenance message: the announcement renders as a one-line banner\n * on the landing page and login screen, not a full-page takeover. */\nexport const MAX_ANNOUNCEMENT_MESSAGE_LENGTH = 300;\n\n/** Admin notes on a content-appeal review (reviewContentAppeal). */\nexport const MAX_APPEAL_REVIEW_NOTES_LENGTH = 2000;\n\n/** Admin reason on a Work/Realm forced-retitle remedy. */\nexport const MAX_REQUIRE_RETITLE_REASON_LENGTH = 500;\n\n/** Optional user-facing DETAIL text on a normal-report resolution. */\nexport const MAX_USER_FACING_REASON_DETAIL_LENGTH = 2000;\n\n/** Admin broadcast / user notification message body. */\nexport const MAX_NOTIFICATION_MESSAGE_LENGTH = 2000;\n\n/** Admin user-search query input. */\nexport const MAX_USER_SEARCH_QUERY_LENGTH = 100;\n\n// --- NCII / child-safety statutory + operator text caps ---\n\n/** Operator reason on the admin \"mark as NCII linked evidence\" intake. */\nexport const MAX_NCII_EVIDENCE_REASON_LENGTH = 1000;\n\n/** Operator written rationale on a TAKE IT DOWN validity decision (immutable row). */\nexport const MAX_NCII_RATIONALE_LENGTH = 4000;\n\n/** Requester's statement of nonconsent (statutory intake — in-app and no-login). */\nexport const MAX_NCII_NONCONSENT_STATEMENT_LENGTH = 4000;\n\n/** Typed-name electronic signature on a statutory request. */\nexport const MAX_NCII_SIGNED_NAME_LENGTH = 256;\n\n/** Requester's optional supporting facts (statutory intake). */\nexport const MAX_NCII_SUPPORTING_FACTS_LENGTH = 8000;\n\n/** Bounded, non-sensitive summary on an NCII request action row. */\nexport const MAX_NCII_ACTION_SUMMARY_LENGTH = 280;\n\n/** Operator description of a registered evidence artifact (e.g. portal screenshot). */\nexport const MAX_SAFETY_ARTIFACT_DESCRIPTION_LENGTH = 500;\n\n/** Operator proof note on a manual NCMEC portal filing. */\nexport const MAX_NCMEC_PORTAL_PROOF_TEXT_LENGTH = 2000;\n\n/** Requester's typed name on the no-login TAKE IT DOWN statutory intake. */\nexport const MAX_NCII_REQUESTER_NAME_LENGTH = 256;\n\n/** Name of the depicted person a representative files on behalf of. */\nexport const MAX_NCII_REPRESENTED_PERSON_NAME_LENGTH = 256;\n\n/** Representative's stated basis of authority (parent/guardian/counsel etc.). */\nexport const MAX_NCII_AUTHORITY_BASIS_LENGTH = 2000;\n\n/** Optional pointer/reference to authority evidence supplied by a representative. */\nexport const MAX_NCII_AUTHORITY_EVIDENCE_REF_LENGTH = 512;\n\n/** The external URL a no-login statutory request names as the content to remove. */\nexport const MAX_NCII_LOCATOR_URL_LENGTH = 2048;\n\n/** The client-generated idempotency key of a statutory request: a retried submit carries the same\n * key, and the server derives the request id from it. */\nexport const NCII_IDEMPOTENCY_KEY_MIN_LENGTH = 8;\nexport const NCII_IDEMPOTENCY_KEY_MAX_LENGTH = 256;\n\n/** A statutory requester's contact email (the address-length ceiling of an email). */\nexport const MAX_NCII_CONTACT_EMAIL_LENGTH = 320;\n\n/** A statutory requester's contact phone number. */\nexport const NCII_CONTACT_PHONE_MIN_LENGTH = 3;\nexport const NCII_CONTACT_PHONE_MAX_LENGTH = 64;\n\n/** Maximum length for a feedback suggestion. */\nexport const MAX_FEEDBACK_SUGGESTION_LENGTH = 100;\n\n/** Maximum number of distinct submitters tracked per feedback suggestion. Mode-varied. */\nexport const MAX_FEEDBACK_SUBMITTERS = ACTIVE_LIMITS.batches.maxFeedbackSubmitters;\n\n/**\n * Canonical list of feedback types accepted by `submitFeedback`. Used both\n * for runtime validation in the schema (`SubmitFeedbackInputSchema`) and\n * for type-safe consumer props on the frontend `<FeedbackSubmission />`\n * component. Adding a new type here is the single source of truth — no\n * mirroring in callers required.\n */\nexport const FEEDBACK_TYPES = [\n 'tradeProfessionSuggestions',\n 'craftSkillTagSuggestions',\n 'talesWorkGenreSuggestions',\n 'tunesWorkGenreSuggestions',\n 'televisionWorkGenreSuggestions',\n] as const;\n\n/** Union of canonical feedback types. */\nexport type FeedbackType = (typeof FEEDBACK_TYPES)[number];\n\n/** Maximum number of items submitted in a single hallLibrary-review submission. Mode-varied. */\nexport const MAX_HALL_LIBRARY_SUBMIT_BATCH = ACTIVE_LIMITS.hall.maxSubmitBatch;\n\n// --- Admin Tasks ---\n\n/** Admin task lifecycle statuses. */\nexport const ADMIN_TASK_STATUS = {\n PENDING: 'pending',\n CHECKED_OUT: 'checkedOut',\n WORK_LATER: 'workLater',\n COMPLETED: 'completed',\n} as const;\n\n/**\n * Who resolves each kind of admin task. `checkin` means the generic queue check-in completes it\n * (the task carries no decision of its own). Every other owner is the domain decision that closes\n * the task — and deletes it in the same transaction — so a generic check-in must never mark one\n * of those tasks resolved: that would drop the decision it exists to collect.\n */\nexport const ADMIN_TASK_RESOLUTION_OWNERS = [\n 'checkin',\n 'reportResolution',\n 'thresholdReview',\n 'appealReview',\n 'refundDecision',\n 'changeRequestReview',\n 'dispatchClose',\n] as const;\nexport type AdminTaskResolutionOwner = (typeof ADMIN_TASK_RESOLUTION_OWNERS)[number];\n\n/** The resolution owner of every admin task type. A new task type fails the build until classified. */\nexport const ADMIN_TASK_RESOLUTION_OWNER_BY_TYPE = {\n adminDispatch: 'dispatchClose',\n thresholdLibraryReview: 'thresholdReview',\n userReport: 'reportResolution',\n 'content-appeal': 'appealReview',\n stakeShareAnomaly: 'checkin',\n pledgeLedgerAnomaly: 'checkin',\n pledgePaymentRepairNeeded: 'checkin',\n pledgeDisputeOpened: 'checkin',\n pledgeRefundRequested: 'refundDecision',\n pledgeRefundFailed: 'refundDecision',\n hallContentChangeRequest: 'changeRequestReview',\n} as const satisfies Record<AdminTaskType, AdminTaskResolutionOwner>;\n\n/**\n * Whether a generic check-in may mark a task of this stored type resolved. The type is read off an\n * untrusted stored task as a string, so an unknown type answers `false` (fails closed).\n */\nexport function isAdminTaskResolvedByCheckin(taskType: string): boolean {\n return (\n Object.hasOwn(ADMIN_TASK_RESOLUTION_OWNER_BY_TYPE, taskType) &&\n ADMIN_TASK_RESOLUTION_OWNER_BY_TYPE[taskType as AdminTaskType] === 'checkin'\n );\n}\n"]}
1
+ {"version":3,"file":"business-admin.js","sourceRoot":"","sources":["../../src/constants/business-admin.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,8DAA8D;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,6BAA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CAAC,MAAM,cAAc,GAAG;IAC5B,4BAA4B;IAC5B,0BAA0B;IAC1B,2BAA2B;IAC3B,2BAA2B;IAC3B,gCAAgC;CACxB,CAAC;AAKX,gGAAgG;AAChG,MAAM,CAAC,MAAM,6BAA6B,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC;AAE/E,sBAAsB;AAEtB,qCAAqC;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,WAAW;IACvB,SAAS,EAAE,WAAW;CACd,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,SAAS;IACT,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;IACd,gBAAgB;IAChB,qBAAqB;IACrB,eAAe;CACP,CAAC;AAGX,uGAAuG;AACvG,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,aAAa,EAAE,eAAe;IAC9B,sBAAsB,EAAE,iBAAiB;IACzC,UAAU,EAAE,kBAAkB;IAC9B,gBAAgB,EAAE,cAAc;IAChC,iBAAiB,EAAE,SAAS;IAC5B,mBAAmB,EAAE,SAAS;IAC9B,yBAAyB,EAAE,SAAS;IACpC,mBAAmB,EAAE,SAAS;IAC9B,qBAAqB,EAAE,gBAAgB;IACvC,kBAAkB,EAAE,gBAAgB;IACpC,wBAAwB,EAAE,qBAAqB;CACmB,CAAC;AAErE;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAgB;IAC3D,OAAO,CACL,MAAM,CAAC,MAAM,CAAC,mCAAmC,EAAE,QAAQ,CAAC;QAC5D,mCAAmC,CAAC,QAAyB,CAAC,KAAK,SAAS,CAC7E,CAAC;AACJ,CAAC","sourcesContent":["// Admin + content-moderation business-rule constants — task priority, dispatches,\n// the moderation/feedback workflow, and admin-task lifecycle.\nimport { ACTIVE_LIMITS } from './app-mode.js';\nimport { MAX_WORK_PROJECT_TITLE_LENGTH } from './business-work-project.js';\nimport type { AdminTaskType } from '../doc-schemas/report-docs.js';\n\n// --- Admin Task Priority System ---\n\nexport const TASK_PRIORITY = {\n CRITICAL: 4,\n HIGH: 3,\n NORMAL: 2,\n LOW: 1,\n} as const;\n\nexport type TaskPriorityLevel = (typeof TASK_PRIORITY)[keyof typeof TASK_PRIORITY];\n\nexport const TASK_PRIORITY_LABELS = {\n 4: 'CRITICAL',\n 3: 'HIGH',\n 2: 'NORMAL',\n 1: 'LOW',\n} as const;\n\n/**\n * Canonical NUMERIC priority scale for `adminTasks.priority`, shared by BOTH\n * priority systems so `checkoutNextImportantTask` (orderBy priority desc across all\n * task types) compares commensurable values. The userReport report-core score formula\n * already writes on this scale (≈40–2250); the level-based types (thresholdLibraryReview,\n * content-appeal, adminDispatch) map their TASK_PRIORITY level onto these numbers instead\n * of writing the raw 1–4.\n *\n * Resulting order: safety reports (1200–2250) > money anomalies (1100) >\n * CRITICAL (1000) > HIGH (800) > routine reports interleave below > spam-tier (~80).\n */\nexport const TASK_PRIORITY_SCORE = {\n LOW: 50,\n NORMAL: 200,\n HIGH: 800,\n CRITICAL: 1000,\n /** Money-integrity anomaly (stake-share / pledge-ledger corruption signal) — outranks\n * everything except safety-class reports. The three anomaly creators that previously\n * hardcoded `priority: 1` (LOW) all write this. */\n MONEY_ANOMALY: 1100,\n} as const;\n\nexport type TaskPriorityScore = (typeof TASK_PRIORITY_SCORE)[keyof typeof TASK_PRIORITY_SCORE];\n\n/** Maps a level-based TASK_PRIORITY value (1–4) to its canonical numeric score. */\nexport const TASK_PRIORITY_LEVEL_TO_SCORE = {\n [TASK_PRIORITY.LOW]: TASK_PRIORITY_SCORE.LOW,\n [TASK_PRIORITY.NORMAL]: TASK_PRIORITY_SCORE.NORMAL,\n [TASK_PRIORITY.HIGH]: TASK_PRIORITY_SCORE.HIGH,\n [TASK_PRIORITY.CRITICAL]: TASK_PRIORITY_SCORE.CRITICAL,\n} as const;\n\n// --- Admin Dispatches ---\n\n/** Maximum length for an admin-dispatch subject line. */\nexport const MAX_ADMIN_DISPATCH_SUBJECT_LENGTH = 100;\n\n/** Maximum length for the initial body text of an admin dispatch. */\nexport const MAX_ADMIN_DISPATCH_INITIAL_TEXT_LENGTH = 1000;\n\n// --- Content Moderation Workflow ---\n\n/** Maximum length for a content-violation appeal message. */\nexport const MAX_APPEAL_MESSAGE_LENGTH = 1000;\n\n/** Threshold-review reviewer notes (revision notes shown to the author). One owner for\n * the review callable schema AND the admin work-view input. */\nexport const MAX_THRESHOLD_REVIEW_NOTES_LENGTH = 2000;\n\n/** Operator-facing reason stamped on a threshold item whose publish parked terminally\n * (`publishParkedReason`). Server-authored text, bounded so a long copy-failure message\n * cannot grow the doc without limit. */\nexport const MAX_THRESHOLD_PUBLISH_PARKED_REASON_LENGTH = 2000;\n\n// --- Moderation / safety operator text caps ---\n// Each is declared ONCE here and derived by every input schema AND persisted doc schema\n// that carries the field — the numbers must never be re-hardcoded at an enforcement point.\n\n/** Operator-facing INTERNAL reason/rationale (LE-loggable; account actions, case reopens). */\nexport const MAX_INTERNAL_REASON_LENGTH = 2000;\n\n/** The optional reason an admin records when closing an account discovered to be under 13. */\nexport const MAX_UNDER_13_CLOSE_REASON_LENGTH = 1000;\n\n/** The generic owner-readable (user-facing) reason — deliberately short, no detail leaks. */\nexport const MAX_USER_FACING_REASON_LENGTH = 280;\n\n/** Structured close-out summary on report/safety-case resolutions. */\nexport const MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH = 2000;\n\n/** Optional operator note attached to a close-out. */\nexport const MAX_SAFETY_ADMIN_NOTE_LENGTH = 4000;\n\n// --- Report intake text caps ---\n\n/** Reporter free-text narrative/comment (segregated private doc; never on the root). */\nexport const MAX_REPORT_NARRATIVE_LENGTH = 4000;\n\n/** The ids a client names as the target of a report — the item, its parent reference, and the\n * owner hint. They are hints the server re-derives, so the cap only bounds what is read. */\nexport const MAX_REPORT_TARGET_ID_LENGTH = 256;\n\n/** The report DIALOG's comment field cap (the client-side compose bound — tighter than\n * the server narrative cap above, which also absorbs upgrade concatenations). */\nexport const MAX_REPORT_COMMENT_LENGTH = 1000;\n\n/** Minimum operator rationale/reason length on safety-console staged actions. */\nexport const MIN_SAFETY_RATIONALE_LENGTH = 10;\n\n/** Operator reason on an admin chat-moderation action (adminModerateChatMessage /\n * adminReadChannelContext). ONE owner for both callables' `reason` bound. */\nexport const MAX_CHAT_MODERATION_REASON_LENGTH = 1000;\n\n/** Broadcast explicitUids selector audience cap (schema + composer both derive). */\nexport const MAX_BROADCAST_EXPLICIT_UIDS = 2000;\n\n// --- Operator step-up sentinel error codes ---\n// The two backend HttpsError messages the operator TOTP step-up throws; the frontend\n// matches them to open the step-up dialog in ENROLL vs VERIFY mode. ONE declaration —\n// both the callable (functions operatorStepUp.ts) and the frontend hook import these.\nexport const STEP_UP_ENROLL_REQUIRED = 'OPERATOR_STEP_UP_ENROLL_REQUIRED';\nexport const STEP_UP_REQUIRED = 'OPERATOR_STEP_UP_REQUIRED';\n\n/** How many digits an operator step-up authenticator code has. */\nexport const OPERATOR_STEP_UP_CODE_LENGTH = 6;\n\n/** The frozen report-time captured text snapshot (edit-to-evade guard; NO PII). */\nexport const MAX_REPORT_SNAPSHOT_TEXT_LENGTH = 4000;\n\n// --- Admin console config-content text caps ---\n// Every number the system uses lives HERE — even a field only one surface consumes\n// today, because any future client (TV / phone / admin app) reads ttt-core.\n\nexport const MAX_FUTURE_PLAN_TITLE_LENGTH = 200;\nexport const MAX_FUTURE_PLAN_DESCRIPTION_LENGTH = 4000;\nexport const MAX_PLATFORM_RULE_TITLE_LENGTH = 200;\nexport const MAX_PLATFORM_RULE_DESCRIPTION_LENGTH = 4000;\nexport const MAX_AGREEMENT_POINT_LENGTH = 2000;\nexport const MAX_CONTENT_PAGE_HEADING_LENGTH = 300;\nexport const MAX_CONTENT_PAGE_BODY_LENGTH = 20000;\n/** Sections in one long-form content page (Terms, Privacy, the DMCA policy's process text). */\nexport const MAX_CONTENT_PAGE_SECTIONS = 300;\nexport const MAX_TAKE_IT_DOWN_COPY_LENGTH = 8000;\n/** DMCA policy page: the labeled contact blocks (service provider, designated agent) and their rows. */\nexport const MAX_DMCA_CONTACT_BLOCKS = 10;\nexport const MAX_DMCA_CONTACT_ROWS = 20;\nexport const MAX_DMCA_CONTACT_LABEL_LENGTH = 100;\nexport const MAX_DMCA_CONTACT_VALUE_LENGTH = 500;\nexport const MAX_MAINTENANCE_MESSAGE_LENGTH = 2000;\n\n/** `_appConfig/app.appVersion` — the force-refresh version string VersionGate compares. */\nexport const MAX_APP_VERSION_LENGTH = 64;\n\n/** Announcement-banner copy on `_appConfig/app.announcementMessage`. Deliberately far\n * shorter than the maintenance message: the announcement renders as a one-line banner\n * on the landing page and login screen, not a full-page takeover. */\nexport const MAX_ANNOUNCEMENT_MESSAGE_LENGTH = 300;\n\n/** Admin notes on a content-appeal review (reviewContentAppeal). */\nexport const MAX_APPEAL_REVIEW_NOTES_LENGTH = 2000;\n\n/** Admin reason on a Work/Realm forced-retitle remedy. */\nexport const MAX_REQUIRE_RETITLE_REASON_LENGTH = 500;\n\n/** Optional user-facing DETAIL text on a normal-report resolution. */\nexport const MAX_USER_FACING_REASON_DETAIL_LENGTH = 2000;\n\n/** Admin broadcast / user notification message body. */\nexport const MAX_NOTIFICATION_MESSAGE_LENGTH = 2000;\n\n/** Admin broadcast title — the same length as a Work title. */\nexport const MAX_BROADCAST_TITLE_LENGTH = MAX_WORK_PROJECT_TITLE_LENGTH;\n\n/** Admin user-search query input. */\nexport const MAX_USER_SEARCH_QUERY_LENGTH = 100;\n\n// --- NCII / child-safety statutory + operator text caps ---\n\n/** Operator written rationale on a TAKE IT DOWN validity decision (immutable row). */\nexport const MAX_NCII_RATIONALE_LENGTH = 4000;\n\n/** Requester's statement of nonconsent (statutory intake — in-app and no-login). */\nexport const MAX_NCII_NONCONSENT_STATEMENT_LENGTH = 4000;\n\n/** Typed-name electronic signature on a statutory request. */\nexport const MAX_NCII_SIGNED_NAME_LENGTH = 256;\n\n/** Requester's optional supporting facts (statutory intake). */\nexport const MAX_NCII_SUPPORTING_FACTS_LENGTH = 8000;\n\n/** Bounded, non-sensitive summary on an NCII request action row. */\nexport const MAX_NCII_ACTION_SUMMARY_LENGTH = 280;\n\n/** Operator description of a registered evidence artifact (e.g. portal screenshot). */\nexport const MAX_SAFETY_ARTIFACT_DESCRIPTION_LENGTH = 500;\n\n/** Operator proof note on a manual NCMEC portal filing. */\nexport const MAX_NCMEC_PORTAL_PROOF_TEXT_LENGTH = 2000;\n\n/** Requester's typed name on the no-login TAKE IT DOWN statutory intake. */\nexport const MAX_NCII_REQUESTER_NAME_LENGTH = 256;\n\n/** Name of the depicted person a representative files on behalf of. */\nexport const MAX_NCII_REPRESENTED_PERSON_NAME_LENGTH = 256;\n\n/** Representative's stated basis of authority (parent/guardian/counsel etc.). */\nexport const MAX_NCII_AUTHORITY_BASIS_LENGTH = 2000;\n\n/** Optional pointer/reference to authority evidence supplied by a representative. */\nexport const MAX_NCII_AUTHORITY_EVIDENCE_REF_LENGTH = 512;\n\n/** The external URL a no-login statutory request names as the content to remove. */\nexport const MAX_NCII_LOCATOR_URL_LENGTH = 2048;\n\n/** The client-generated idempotency key of a statutory request: a retried submit carries the same\n * key, and the server derives the request id from it. */\nexport const NCII_IDEMPOTENCY_KEY_MIN_LENGTH = 8;\nexport const NCII_IDEMPOTENCY_KEY_MAX_LENGTH = 256;\n\n/** A statutory requester's contact email (the address-length ceiling of an email). */\nexport const MAX_NCII_CONTACT_EMAIL_LENGTH = 320;\n\n/** A statutory requester's contact phone number. */\nexport const NCII_CONTACT_PHONE_MIN_LENGTH = 3;\nexport const NCII_CONTACT_PHONE_MAX_LENGTH = 64;\n\n/** Maximum length for a feedback suggestion. */\nexport const MAX_FEEDBACK_SUGGESTION_LENGTH = 100;\n\n/** Maximum number of distinct submitters tracked per feedback suggestion. Mode-varied. */\nexport const MAX_FEEDBACK_SUBMITTERS = ACTIVE_LIMITS.batches.maxFeedbackSubmitters;\n\n/**\n * Canonical list of feedback types accepted by `submitFeedback`. Used both\n * for runtime validation in the schema (`SubmitFeedbackInputSchema`) and\n * for type-safe consumer props on the frontend `<FeedbackSubmission />`\n * component. Adding a new type here is the single source of truth — no\n * mirroring in callers required.\n */\nexport const FEEDBACK_TYPES = [\n 'tradeProfessionSuggestions',\n 'craftSkillTagSuggestions',\n 'talesWorkGenreSuggestions',\n 'tunesWorkGenreSuggestions',\n 'televisionWorkGenreSuggestions',\n] as const;\n\n/** Union of canonical feedback types. */\nexport type FeedbackType = (typeof FEEDBACK_TYPES)[number];\n\n/** Maximum number of items submitted in a single hallLibrary-review submission. Mode-varied. */\nexport const MAX_HALL_LIBRARY_SUBMIT_BATCH = ACTIVE_LIMITS.hall.maxSubmitBatch;\n\n// --- Admin Tasks ---\n\n/** Admin task lifecycle statuses. */\nexport const ADMIN_TASK_STATUS = {\n PENDING: 'pending',\n CHECKED_OUT: 'checkedOut',\n WORK_LATER: 'workLater',\n COMPLETED: 'completed',\n} as const;\n\n/**\n * Who resolves each kind of admin task. `checkin` means the generic queue check-in completes it\n * (the task carries no decision of its own). Every other owner is the domain decision that closes\n * the task — and deletes it in the same transaction — so a generic check-in must never mark one\n * of those tasks resolved: that would drop the decision it exists to collect.\n */\nexport const ADMIN_TASK_RESOLUTION_OWNERS = [\n 'checkin',\n 'reportResolution',\n 'thresholdReview',\n 'appealReview',\n 'refundDecision',\n 'changeRequestReview',\n 'dispatchClose',\n] as const;\nexport type AdminTaskResolutionOwner = (typeof ADMIN_TASK_RESOLUTION_OWNERS)[number];\n\n/** The resolution owner of every admin task type. A new task type fails the build until classified. */\nexport const ADMIN_TASK_RESOLUTION_OWNER_BY_TYPE = {\n adminDispatch: 'dispatchClose',\n thresholdLibraryReview: 'thresholdReview',\n userReport: 'reportResolution',\n 'content-appeal': 'appealReview',\n stakeShareAnomaly: 'checkin',\n pledgeLedgerAnomaly: 'checkin',\n pledgePaymentRepairNeeded: 'checkin',\n pledgeDisputeOpened: 'checkin',\n pledgeRefundRequested: 'refundDecision',\n pledgeRefundFailed: 'refundDecision',\n hallContentChangeRequest: 'changeRequestReview',\n} as const satisfies Record<AdminTaskType, AdminTaskResolutionOwner>;\n\n/**\n * Whether a generic check-in may mark a task of this stored type resolved. The type is read off an\n * untrusted stored task as a string, so an unknown type answers `false` (fails closed).\n */\nexport function isAdminTaskResolvedByCheckin(taskType: string): boolean {\n return (\n Object.hasOwn(ADMIN_TASK_RESOLUTION_OWNER_BY_TYPE, taskType) &&\n ADMIN_TASK_RESOLUTION_OWNER_BY_TYPE[taskType as AdminTaskType] === 'checkin'\n );\n}\n"]}
@@ -74,7 +74,8 @@ export declare const HALL_CLEARABLE_TEXT_FIELD_NAMES: readonly ["title", "descri
74
74
  * The raw doc field names each published hall-content surface exposes as changeable TEXT.
75
75
  * Cross-boundary: the member "Update details" field picker offers this set per surface and
76
76
  * the change-request submit runner validates against it. Detail surfaces (tale/tune/
77
- * television) live on the hall parent doc; sub-item surfaces on the published chapter/
77
+ * television) are the hall parent doc's snapshot of the Work's own title and description
78
+ * (`HALL_DETAIL_TEXT_FIELD_TO_WORK_SHELL_FIELD`); sub-item surfaces are the published chapter/
78
79
  * track/episode doc. This is the HALL-SURFACE SUBSET of the canonical
79
80
  * MODERATION_CLEARABLE_TEXT_FIELDS above (it excludes the `workProject` shell) — every
80
81
  * tuple is projected from that one owner, so the two can never drift.
@@ -88,19 +89,6 @@ export declare const HALL_CONTENT_TEXT_FIELDS: {
88
89
  readonly televisionEpisode: readonly ["title", "description"];
89
90
  readonly workRealm: readonly ["workingTitle", "workingDescription"];
90
91
  };
91
- /** Per-field max lengths for proposed hall-content text. DERIVED from the owning
92
- * constants — never independent numbers — so the change-request pipeline can never
93
- * drift from the authoring limits again (the pre-2026-07-13 copy carried its own
94
- * 200/5000/100000 set while authoring enforced 150/300/2500). Keyed on the derived
95
- * ClearableTextFieldName union, so a new clearable field fails the build here until
96
- * it has a cap. */
97
- export declare const HALL_CONTENT_TEXT_FIELD_MAX: {
98
- readonly title: 150;
99
- readonly description: 1000;
100
- readonly content: number;
101
- readonly workingTitle: 150;
102
- readonly workingDescription: 1000;
103
- };
104
92
  /** One work-project type's two hall text surfaces — the published DETAIL on the hall parent
105
93
  * and its chapter/track/episode SUB-ITEM — each with the clearable/changeable field tuple
106
94
  * that surface exposes. */
@@ -161,6 +149,17 @@ export declare const WORK_SHELL_TEXT_FIELD_TO_HALL_ITEM_FIELD: {
161
149
  readonly workingTitle: "title";
162
150
  readonly workingDescription: "description";
163
151
  };
152
+ /**
153
+ * Hall parent DETAIL text field → the Work field it snapshots: the inverse of
154
+ * `WORK_SHELL_TEXT_FIELD_TO_HALL_ITEM_FIELD`. A Tale / Tune / Television section has no text of
155
+ * its own, so a detail change request or a detail moderation clear names the Hall field and acts
156
+ * on this Work field, the Work's public mirror, and the Hall entry together. Both sides are
157
+ * projected from the canonical clearable-field map.
158
+ */
159
+ export declare const HALL_DETAIL_TEXT_FIELD_TO_WORK_SHELL_FIELD: {
160
+ readonly title: "workingTitle";
161
+ readonly description: "workingDescription";
162
+ };
164
163
  /**
165
164
  * CANONICAL per-work-type rule for what a Tale chapter / Tune track / Television episode must
166
165
  * carry before it may be submitted, approved, or published. ONE owner for the member-side
@@ -1 +1 @@
1
- {"version":3,"file":"business-content.d.ts","sourceRoot":"","sources":["../../src/constants/business-content.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACL,uCAAuC,EACvC,4BAA4B,EAC5B,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,gGAAgG;AAChG,eAAO,MAAM,qCAAqC,MAAM,CAAC;AAIzD,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB,QAAkD,CAAC;AAEvF,iEAAiE;AACjE,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,6CAA6C;AAC7C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AM,8BAA8B,KAAK,CAAC;AAEjD,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAI7C,iDAAiD;AACjD,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD,kDAAkD;AAClD,eAAO,MAAM,iCAAiC,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // Content-surface business-rule constants — commissions, auditions, the social
2
2
  // feed, and messaging.
3
- import { MAX_WORK_PROJECT_TITLE_LENGTH, MAX_WORK_PROJECT_DESCRIPTION_LENGTH, MAX_CHAPTER_CONTENT_LENGTH, MAX_WORK_REALM_TITLE_LENGTH, MAX_WORK_REALM_DESCRIPTION_LENGTH, } from "./business-work-project.js";
3
+ import { MAX_WORK_PROJECT_TITLE_LENGTH } from "./business-work-project.js";
4
4
  import { ACTIVE_LIMITS } from './app-mode.js';
5
5
  import { HALL_LIBRARY_TARGET_FIELDS } from '../media/hall-library-target-fields.js';
6
6
  import { HALL_CONTENT_SURFACE_NAMES_BY_WORK_TYPE } from './hall-content-routing.js';
@@ -71,7 +71,8 @@ export const HALL_CLEARABLE_TEXT_FIELD_NAMES = [
71
71
  * The raw doc field names each published hall-content surface exposes as changeable TEXT.
72
72
  * Cross-boundary: the member "Update details" field picker offers this set per surface and
73
73
  * the change-request submit runner validates against it. Detail surfaces (tale/tune/
74
- * television) live on the hall parent doc; sub-item surfaces on the published chapter/
74
+ * television) are the hall parent doc's snapshot of the Work's own title and description
75
+ * (`HALL_DETAIL_TEXT_FIELD_TO_WORK_SHELL_FIELD`); sub-item surfaces are the published chapter/
75
76
  * track/episode doc. This is the HALL-SURFACE SUBSET of the canonical
76
77
  * MODERATION_CLEARABLE_TEXT_FIELDS above (it excludes the `workProject` shell) — every
77
78
  * tuple is projected from that one owner, so the two can never drift.
@@ -86,19 +87,6 @@ export const HALL_CONTENT_TEXT_FIELDS = {
86
87
  // Realm grain (R1, 2026-07-12): targets the `workRealms/{id}` doc directly.
87
88
  workRealm: MODERATION_CLEARABLE_TEXT_FIELDS.workRealm,
88
89
  };
89
- /** Per-field max lengths for proposed hall-content text. DERIVED from the owning
90
- * constants — never independent numbers — so the change-request pipeline can never
91
- * drift from the authoring limits again (the pre-2026-07-13 copy carried its own
92
- * 200/5000/100000 set while authoring enforced 150/300/2500). Keyed on the derived
93
- * ClearableTextFieldName union, so a new clearable field fails the build here until
94
- * it has a cap. */
95
- export const HALL_CONTENT_TEXT_FIELD_MAX = {
96
- title: MAX_WORK_PROJECT_TITLE_LENGTH,
97
- description: MAX_WORK_PROJECT_DESCRIPTION_LENGTH,
98
- content: MAX_CHAPTER_CONTENT_LENGTH,
99
- workingTitle: MAX_WORK_REALM_TITLE_LENGTH,
100
- workingDescription: MAX_WORK_REALM_DESCRIPTION_LENGTH,
101
- };
102
90
  /**
103
91
  * WorkProjectType → hall text-surface routing. Surface identities project from the lower-level
104
92
  * `HALL_CONTENT_SURFACE_NAMES_BY_WORK_TYPE` owner; this map adds the clearable field tuples each
@@ -145,6 +133,17 @@ export const WORK_SHELL_TEXT_FIELD_TO_HALL_ITEM_FIELD = {
145
133
  [MODERATION_CLEARABLE_TEXT_FIELDS.workProject[0]]: MODERATION_CLEARABLE_TEXT_FIELDS.tale[0], // workingTitle → title
146
134
  [MODERATION_CLEARABLE_TEXT_FIELDS.workProject[1]]: MODERATION_CLEARABLE_TEXT_FIELDS.tale[1], // workingDescription → description
147
135
  };
136
+ /**
137
+ * Hall parent DETAIL text field → the Work field it snapshots: the inverse of
138
+ * `WORK_SHELL_TEXT_FIELD_TO_HALL_ITEM_FIELD`. A Tale / Tune / Television section has no text of
139
+ * its own, so a detail change request or a detail moderation clear names the Hall field and acts
140
+ * on this Work field, the Work's public mirror, and the Hall entry together. Both sides are
141
+ * projected from the canonical clearable-field map.
142
+ */
143
+ export const HALL_DETAIL_TEXT_FIELD_TO_WORK_SHELL_FIELD = {
144
+ [MODERATION_CLEARABLE_TEXT_FIELDS.tale[0]]: MODERATION_CLEARABLE_TEXT_FIELDS.workProject[0], // title → workingTitle
145
+ [MODERATION_CLEARABLE_TEXT_FIELDS.tale[1]]: MODERATION_CLEARABLE_TEXT_FIELDS.workProject[1], // description → workingDescription
146
+ };
148
147
  // --- Hall sub-item publish requirements ---
149
148
  /**
150
149
  * CANONICAL per-work-type rule for what a Tale chapter / Tune track / Television episode must