blun-king-cli 9.1.587 → 9.1.588

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 (436) hide show
  1. package/CHANGELOG.md +11 -185
  2. package/LIESMICH.txt +51 -13
  3. package/README.md +44 -47
  4. package/agent-spine-plugin/.codex-plugin/plugin.json +16 -4
  5. package/agent-spine-plugin/CHANGELOG.md +37 -5
  6. package/agent-spine-plugin/README.md +3 -3
  7. package/agent-spine-plugin/blun.plugin.json +45 -10
  8. package/agent-spine-plugin/docs/artifact-evaluation.md +93 -0
  9. package/agent-spine-plugin/docs/host-integration.md +42 -27
  10. package/agent-spine-plugin/docs/preflight-recall.md +4 -2
  11. package/agent-spine-plugin/docs/session-timeline.md +97 -236
  12. package/agent-spine-plugin/docs/world-model.md +25 -0
  13. package/agent-spine-plugin/hooks/codex.json +1 -1
  14. package/agent-spine-plugin/hooks/hooks.json +1 -1
  15. package/agent-spine-plugin/package.json +1 -3
  16. package/agent-spine-plugin/scripts/check-hosts.js +3 -3
  17. package/agent-spine-plugin/scripts/release-check.js +10 -5
  18. package/agent-spine-plugin/scripts/run-checks.js +4 -1
  19. package/agent-spine-plugin/scripts/run-tests-hermetic.js +32 -6
  20. package/agent-spine-plugin/src/cli-learning.js +15 -0
  21. package/agent-spine-plugin/src/cli.js +2 -0
  22. package/agent-spine-plugin/src/hook.js +32 -32
  23. package/agent-spine-plugin/src/lib/action-lesson-recall.js +73 -8
  24. package/agent-spine-plugin/src/lib/briefing.js +146 -36
  25. package/agent-spine-plugin/src/lib/channel-continuity.js +19 -0
  26. package/agent-spine-plugin/src/lib/delivery-agent-usage.js +14 -7
  27. package/agent-spine-plugin/src/lib/gateway-group-response.js +128 -0
  28. package/agent-spine-plugin/src/lib/gateway-runs.js +24 -15
  29. package/agent-spine-plugin/src/lib/hook-briefing-use.js +13 -3
  30. package/agent-spine-plugin/src/lib/hook-context.js +16 -3
  31. package/agent-spine-plugin/src/lib/hook-output.js +129 -5
  32. package/agent-spine-plugin/src/lib/hook-timeline.js +5 -3
  33. package/agent-spine-plugin/src/lib/indexed-memory.js +2 -2
  34. package/agent-spine-plugin/src/lib/learning-artifact-evaluator.js +114 -0
  35. package/agent-spine-plugin/src/lib/learning-context.js +11 -4
  36. package/agent-spine-plugin/src/lib/learning-measurements.js +2 -2
  37. package/agent-spine-plugin/src/lib/mcp-runtime.js +89 -3
  38. package/agent-spine-plugin/src/lib/mcp-source-context.js +12 -2
  39. package/agent-spine-plugin/src/lib/mcp-timeline-tools.js +91 -8
  40. package/agent-spine-plugin/src/lib/mcp-world-tools.js +2 -2
  41. package/agent-spine-plugin/src/lib/owned-file-lock.js +20 -1
  42. package/agent-spine-plugin/src/lib/persona-runtime.js +2 -2
  43. package/agent-spine-plugin/src/lib/preflight-delivery-id.js +27 -0
  44. package/agent-spine-plugin/src/lib/preflight.js +4 -4
  45. package/agent-spine-plugin/src/lib/session-timeline-codex.js +15 -0
  46. package/agent-spine-plugin/src/lib/session-timeline-contract.js +12 -4
  47. package/agent-spine-plugin/src/lib/session-timeline-event-extract.js +36 -7
  48. package/agent-spine-plugin/src/lib/session-timeline-host-origin.js +13 -10
  49. package/agent-spine-plugin/src/lib/session-timeline-invocation.js +1 -1
  50. package/agent-spine-plugin/src/lib/session-timeline-king.js +14 -0
  51. package/agent-spine-plugin/src/lib/session-timeline-prior.js +18 -12
  52. package/agent-spine-plugin/src/lib/session-timeline-provider.js +5 -0
  53. package/agent-spine-plugin/src/lib/session-timeline-query.js +2 -0
  54. package/agent-spine-plugin/src/lib/session-timeline-results.js +35 -10
  55. package/agent-spine-plugin/src/lib/session-timeline-source-open.js +30 -0
  56. package/agent-spine-plugin/src/lib/session-timeline.js +122 -75
  57. package/agent-spine-plugin/src/lib/source-roots.js +3 -2
  58. package/agent-spine-plugin/src/lib/task-knowledge-context.js +22 -1
  59. package/agent-spine-plugin/src/lib/timeline-continuation-update.js +100 -0
  60. package/agent-spine-plugin/src/lib/timeline-tool-guard.js +30 -7
  61. package/agent-spine-plugin/src/lib/timeline-user-feedback.js +217 -0
  62. package/agent-spine-plugin/src/lib/timeline-world-capture.js +233 -0
  63. package/agent-spine-plugin/src/lib/world-knowledge.js +59 -2
  64. package/agent-spine-plugin/src/lib/world-model.js +64 -9
  65. package/agent-spine-plugin/src/worker.js +13 -1
  66. package/bin/blun.js +43 -28
  67. package/bin/core-bootstrap.js +5 -4
  68. package/bin/king.js +43 -28
  69. package/bin/launcher-mode.js +1 -10
  70. package/bin/launcher-runtime.js +128 -295
  71. package/bin/managed-node.js +0 -0
  72. package/bin/managed-plugin-selection.cjs +0 -1
  73. package/bin/native-module-repair.js +0 -0
  74. package/bin/node-runtime.js +0 -0
  75. package/bin/node-version.js +0 -0
  76. package/bin/plugin-bootstrap.js +56 -120
  77. package/bin/private-paths.js +11 -34
  78. package/bin/standard-tools-bootstrap.js +34 -114
  79. package/bin/turn-thinking-policy.cjs +3 -11
  80. package/bin/update-copy.js +200 -0
  81. package/bin/update-lease.js +0 -0
  82. package/bin/update-notice.js +136 -289
  83. package/bin/verify-agent-behavior.cjs +122 -0
  84. package/bin/verify-agent-components.cjs +104 -0
  85. package/bin/verify-bundled-agent-sources.cjs +57 -0
  86. package/blun.mjs +143076 -135288
  87. package/bundled-agent-sources.json +701 -0
  88. package/package.json +12 -15
  89. package/standard-skills/translate-native/README.md +1293 -0
  90. package/standard-skills/translate-native/SKILL.md +172 -22
  91. package/standard-skills/translate-native/VERSION +1 -1
  92. package/standard-skills/translate-native/agents/openai.yaml +18 -0
  93. package/standard-skills/translate-native/assets/icon.svg +8 -0
  94. package/standard-skills/translate-native/docs/BLUN_CODE_INTEGRATION.md +76 -0
  95. package/standard-skills/translate-native/docs/PREMORTEM.md +489 -0
  96. package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION.md +2035 -0
  97. package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_API.md +1302 -0
  98. package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_EVIDENCE_HTTP.md +136 -0
  99. package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_HEALTH_HTTP.md +130 -0
  100. package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_HTTP_PROVIDER.md +175 -0
  101. package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_RECEIPT_VERIFIER_HTTP.md +86 -0
  102. package/standard-skills/translate-native/integrations/AGENT_RULES.md +32 -0
  103. package/standard-skills/translate-native/integrations/adapters/blun-code-language-guard.js +514 -0
  104. package/standard-skills/translate-native/integrations/adapters/node-language-guard.js +230 -0
  105. package/standard-skills/translate-native/integrations/audit_log.py +327 -0
  106. package/standard-skills/translate-native/integrations/claude_language_hook.js +1536 -0
  107. package/standard-skills/translate-native/integrations/commercial_localization_profile.py +42 -0
  108. package/standard-skills/translate-native/integrations/delivery-policy.example.json +28 -0
  109. package/standard-skills/translate-native/integrations/enforced_delivery.py +543 -0
  110. package/standard-skills/translate-native/integrations/guard_service.py +435 -0
  111. package/standard-skills/translate-native/integrations/language_gateway.py +67 -0
  112. package/standard-skills/translate-native/integrations/mcp_auth_headers.py +198 -0
  113. package/standard-skills/translate-native/integrations/mcp_http_gateway.py +429 -0
  114. package/standard-skills/translate-native/integrations/non_language_html_entities.js +1485 -0
  115. package/standard-skills/translate-native/integrations/pre_output_guard.py +65 -0
  116. package/standard-skills/translate-native/integrations/task_router.py +101 -0
  117. package/standard-skills/translate-native/integrations/website_localization.py +401 -0
  118. package/standard-skills/translate-native/integrations/website_localization_api.py +581 -0
  119. package/standard-skills/translate-native/integrations/website_localization_benchmark.py +1885 -0
  120. package/standard-skills/translate-native/integrations/website_localization_benchmark_campaign.py +1772 -0
  121. package/standard-skills/translate-native/integrations/website_localization_benchmark_candidate.py +506 -0
  122. package/standard-skills/translate-native/integrations/website_localization_benchmark_http.py +400 -0
  123. package/standard-skills/translate-native/integrations/website_localization_benchmark_review_store.py +781 -0
  124. package/standard-skills/translate-native/integrations/website_localization_benchmark_reviewer_http.py +500 -0
  125. package/standard-skills/translate-native/integrations/website_localization_benchmark_runtime.py +1107 -0
  126. package/standard-skills/translate-native/integrations/website_localization_benchmark_suite.py +463 -0
  127. package/standard-skills/translate-native/integrations/website_localization_cms.py +2835 -0
  128. package/standard-skills/translate-native/integrations/website_localization_cms_client.py +875 -0
  129. package/standard-skills/translate-native/integrations/website_localization_cms_dispatch.py +805 -0
  130. package/standard-skills/translate-native/integrations/website_localization_cms_http.py +588 -0
  131. package/standard-skills/translate-native/integrations/website_localization_cms_lifecycle_monitor.py +991 -0
  132. package/standard-skills/translate-native/integrations/website_localization_cms_receiver.py +1441 -0
  133. package/standard-skills/translate-native/integrations/website_localization_cms_receiver_runtime.py +414 -0
  134. package/standard-skills/translate-native/integrations/website_localization_cms_receiver_store.py +1073 -0
  135. package/standard-skills/translate-native/integrations/website_localization_cms_removal_dispatch.py +865 -0
  136. package/standard-skills/translate-native/integrations/website_localization_cms_source_client.py +583 -0
  137. package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery.py +964 -0
  138. package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_runtime.py +665 -0
  139. package/standard-skills/translate-native/integrations/website_localization_cms_source_http.py +1153 -0
  140. package/standard-skills/translate-native/integrations/website_localization_cms_source_runtime.py +675 -0
  141. package/standard-skills/translate-native/integrations/website_localization_cms_source_service.py +1125 -0
  142. package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification.py +674 -0
  143. package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_http.py +444 -0
  144. package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_receiver.py +1469 -0
  145. package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_receiver_runtime.py +1142 -0
  146. package/standard-skills/translate-native/integrations/website_localization_cms_terminal_processing_monitor.py +634 -0
  147. package/standard-skills/translate-native/integrations/website_localization_cms_terminal_receiver_client.py +804 -0
  148. package/standard-skills/translate-native/integrations/website_localization_deepl_baseline.py +922 -0
  149. package/standard-skills/translate-native/integrations/website_localization_evidence_http.py +482 -0
  150. package/standard-skills/translate-native/integrations/website_localization_health.py +1541 -0
  151. package/standard-skills/translate-native/integrations/website_localization_health_http.py +372 -0
  152. package/standard-skills/translate-native/integrations/website_localization_http_provider.py +297 -0
  153. package/standard-skills/translate-native/integrations/website_localization_native_reference_http.py +479 -0
  154. package/standard-skills/translate-native/integrations/website_localization_native_reference_intake.py +363 -0
  155. package/standard-skills/translate-native/integrations/website_localization_native_reference_queue.py +1449 -0
  156. package/standard-skills/translate-native/integrations/website_localization_native_reference_store.py +420 -0
  157. package/standard-skills/translate-native/integrations/website_localization_quality_profiles.py +235 -0
  158. package/standard-skills/translate-native/integrations/website_localization_queue.py +671 -0
  159. package/standard-skills/translate-native/integrations/website_localization_receipt_verifier_http.py +516 -0
  160. package/standard-skills/translate-native/integrations/website_localization_release.py +928 -0
  161. package/standard-skills/translate-native/integrations/website_localization_release_coordinator.py +1008 -0
  162. package/standard-skills/translate-native/integrations/website_localization_runner.py +276 -0
  163. package/standard-skills/translate-native/integrations/website_localization_runtime.py +862 -0
  164. package/standard-skills/translate-native/integrations/website_localization_service.py +350 -0
  165. package/standard-skills/translate-native/integrations/website_localization_supervisor.py +511 -0
  166. package/standard-skills/translate-native/integrations/website_localization_worker.py +663 -0
  167. package/standard-skills/translate-native/provenance.json +3 -4
  168. package/standard-skills/translate-native/references/commercial-localization.md +177 -0
  169. package/standard-skills/translate-native/scripts/blun_language_guard.py +7 -1
  170. package/standard-skills/translate-native/scripts/check_commercial_review.py +80 -0
  171. package/standard-skills/translate-native/scripts/commercial_localization_profile.py +333 -0
  172. package/standard-tools/language-guard/LICENSE +21 -0
  173. package/standard-tools/language-guard/VERSION +1 -0
  174. package/standard-tools/language-guard/blun_language_guard.py +7 -1
  175. package/standard-tools/language-guard/check_commercial_review.py +80 -0
  176. package/standard-tools/language-guard/commercial_localization_profile.py +333 -0
  177. package/standard-tools/language-guard/language_gateway.py +62 -0
  178. package/standard-tools/language-guard/pre_output_guard.py +64 -0
  179. package/standard-tools/language-guard/provenance.json +4 -11
  180. package/standard-tools/manifest.json +34 -11
  181. package/telegram-plugin/commands/access.md +2 -10
  182. package/telegram-plugin/dist/bridge.mjs +64041 -687
  183. package/telegram-plugin/dist/mcp-server.mjs +72810 -9027
  184. package/telegram-plugin/dist/noise.mjs +28 -63511
  185. package/agent-spine-plugin/CONTRIBUTING.md +0 -52
  186. package/agent-spine-plugin/SECURITY.md +0 -47
  187. package/agent-spine-plugin/docs/assignment-continuation.md +0 -48
  188. package/agent-spine-plugin/docs/releasing.md +0 -85
  189. package/agent-spine-plugin/docs/structured-completion.md +0 -67
  190. package/bin/abort-listener-policy.cjs +0 -43
  191. package/bin/active-steer-priority-policy.cjs +0 -24
  192. package/bin/agent-api-http-adapter.mjs +0 -446
  193. package/bin/agent-api-private-http-server.mjs +0 -288
  194. package/bin/agent-api-runtime.mjs +0 -252
  195. package/bin/agent-api-service-environment.mjs +0 -236
  196. package/bin/agent-api-service-host.mjs +0 -209
  197. package/bin/agent-api-service-process.mjs +0 -171
  198. package/bin/agent-api-session-registry.mjs +0 -428
  199. package/bin/agent-api-tool-broker.cjs +0 -248
  200. package/bin/agent-api-turn-controller.mjs +0 -461
  201. package/bin/agent-api-usage-journal.cjs +0 -259
  202. package/bin/agent-resume-snapshot.cjs +0 -241
  203. package/bin/agentspine-king-goal-inbox.mjs +0 -111
  204. package/bin/agentspine-king-goal-intake.mjs +0 -106
  205. package/bin/approval-rejection-stop.cjs +0 -15
  206. package/bin/assistant-message-offload-policy.cjs +0 -284
  207. package/bin/baseline-skill-performance-policy.cjs +0 -39
  208. package/bin/bash-search-scope-policy.cjs +0 -49
  209. package/bin/codebase-search-runtime.cjs +0 -23
  210. package/bin/cognitive-action-checkpoint.cjs +0 -1104
  211. package/bin/cognitive-attention-delivery.cjs +0 -76
  212. package/bin/cognitive-attention-policy.cjs +0 -143
  213. package/bin/cognitive-attention-runtime.cjs +0 -91
  214. package/bin/cognitive-context-projection.cjs +0 -73
  215. package/bin/cognitive-cross-portal-acceptance.cjs +0 -443
  216. package/bin/cognitive-effective-view.cjs +0 -77
  217. package/bin/cognitive-focus-projection.cjs +0 -206
  218. package/bin/cognitive-focus-scope.cjs +0 -37
  219. package/bin/cognitive-goal-autostart-policy.cjs +0 -72
  220. package/bin/cognitive-goal-time-trigger-controller.cjs +0 -146
  221. package/bin/cognitive-memory-adapter.cjs +0 -282
  222. package/bin/cognitive-memory-command.cjs +0 -293
  223. package/bin/cognitive-memory-provider.cjs +0 -92
  224. package/bin/cognitive-salience-policy.cjs +0 -159
  225. package/bin/cognitive-state-store.cjs +0 -508
  226. package/bin/cognitive-turn-lifecycle.cjs +0 -624
  227. package/bin/cognitive-work-focus.cjs +0 -180
  228. package/bin/compaction-history-archive.cjs +0 -166
  229. package/bin/compaction-history-startup.cjs +0 -50
  230. package/bin/compaction-model-policy.cjs +0 -31
  231. package/bin/compaction-stage-policy.cjs +0 -21
  232. package/bin/compaction-transaction-policy.cjs +0 -122
  233. package/bin/config-write-dedup-policy.cjs +0 -27
  234. package/bin/context-budget-ledger.cjs +0 -31
  235. package/bin/context-doctor-policy.cjs +0 -70
  236. package/bin/context-insight-policy.cjs +0 -36
  237. package/bin/context-performance-policy.cjs +0 -19
  238. package/bin/context-pressure-policy.cjs +0 -20
  239. package/bin/cron-run-output.cjs +0 -45
  240. package/bin/cron-run-store.cjs +0 -145
  241. package/bin/curiosity-scout-policy.cjs +0 -49
  242. package/bin/default-model-output-budget-policy.cjs +0 -28
  243. package/bin/durable-task-resume-policy.cjs +0 -130
  244. package/bin/durable-task-resume-runtime.cjs +0 -117
  245. package/bin/durable-task-resume-store.cjs +0 -88
  246. package/bin/editable-tool-approval-policy.cjs +0 -540
  247. package/bin/editable-tool-approval-runtime.cjs +0 -99
  248. package/bin/effective-system-prompt-cache-policy.cjs +0 -33
  249. package/bin/error-memory-performance-policy.cjs +0 -113
  250. package/bin/file-observation-policy.cjs +0 -133
  251. package/bin/foreground-output-capture-policy.cjs +0 -41
  252. package/bin/generated-source-health.cjs +0 -142
  253. package/bin/glob-pattern-policy.cjs +0 -13
  254. package/bin/goal-completion-evidence-policy.cjs +0 -120
  255. package/bin/grep-output-limit-policy.cjs +0 -39
  256. package/bin/historical-media-projection-policy.cjs +0 -48
  257. package/bin/history-offload-pressure-policy.cjs +0 -33
  258. package/bin/html-to-research-markdown.cjs +0 -147
  259. package/bin/identity-context-policy.cjs +0 -764
  260. package/bin/identity-journal-policy.cjs +0 -107
  261. package/bin/input-draft-persistence.cjs +0 -77
  262. package/bin/king-tui-function-contract.json +0 -33
  263. package/bin/launcher-restart-policy.cjs +0 -150
  264. package/bin/live-response-repetition-guard.cjs +0 -196
  265. package/bin/llm-config-log-dedup-policy.cjs +0 -76
  266. package/bin/loop-event-record-policy.cjs +0 -174
  267. package/bin/managed-context-startup-policy.cjs +0 -27
  268. package/bin/media-activity-layout-policy.cjs +0 -34
  269. package/bin/media-auto-retrieval-policy.cjs +0 -90
  270. package/bin/media-result-policy.cjs +0 -59
  271. package/bin/micro-compaction-policy.cjs +0 -145
  272. package/bin/mistake-relevance-policy.cjs +0 -319
  273. package/bin/model-retry-progress-policy.cjs +0 -46
  274. package/bin/native-large-file-io.cjs +0 -42
  275. package/bin/native-runtime-cache.cjs +0 -76
  276. package/bin/natural-presence-policy.cjs +0 -28
  277. package/bin/noninteractive-shell-env-policy.cjs +0 -19
  278. package/bin/observer-hooks.cjs +0 -14
  279. package/bin/outbound-claim-provenance.cjs +0 -150
  280. package/bin/oversized-context-offload-policy.cjs +0 -86
  281. package/bin/pending-media-policy.cjs +0 -182
  282. package/bin/pending-token-estimate-policy.cjs +0 -41
  283. package/bin/personal-memory-consent-policy.cjs +0 -72
  284. package/bin/personal-memory-performance-policy.cjs +0 -12
  285. package/bin/personality-choice-policy.cjs +0 -101
  286. package/bin/personality-memory-adapter.cjs +0 -379
  287. package/bin/personality-mode.cjs +0 -46
  288. package/bin/personality-setup-policy.cjs +0 -197
  289. package/bin/proactive-compaction-policy.cjs +0 -25
  290. package/bin/profile-identity-resolution.cjs +0 -136
  291. package/bin/profile-runtime.cjs +0 -318
  292. package/bin/profile-tool-exclusion-policy.cjs +0 -37
  293. package/bin/programmatic-context-isolation.cjs +0 -25
  294. package/bin/programmatic-tool-runtime.mjs +0 -627
  295. package/bin/provider-idle-timeout-policy.cjs +0 -14
  296. package/bin/provider-model-refresh-deadline.cjs +0 -53
  297. package/bin/provider-model-refresh-policy.cjs +0 -107
  298. package/bin/rate-limit-recovery-policy.cjs +0 -47
  299. package/bin/read-batch-policy.cjs +0 -32
  300. package/bin/read-continuation-policy.cjs +0 -59
  301. package/bin/recurring-cron-history-policy.cjs +0 -124
  302. package/bin/relationship-continuity-policy.cjs +0 -143
  303. package/bin/relationship-curiosity-policy.cjs +0 -107
  304. package/bin/relationship-learning-policy.cjs +0 -168
  305. package/bin/release-artifact-freeze-policy.cjs +0 -30
  306. package/bin/reload-plugin-bootstrap.cjs +0 -18
  307. package/bin/reload-queue-policy.cjs +0 -38
  308. package/bin/repeated-assistant-response-policy.cjs +0 -232
  309. package/bin/repeated-injection-projection.cjs +0 -107
  310. package/bin/repeated-user-message-projection.cjs +0 -8
  311. package/bin/research-page-result.cjs +0 -74
  312. package/bin/retry-checkpoint-policy.cjs +0 -13
  313. package/bin/runtime-exit-ledger.cjs +0 -144
  314. package/bin/scoped-cron-run-policy.cjs +0 -358
  315. package/bin/session-checkpoint-policy.cjs +0 -25
  316. package/bin/session-compaction-policy.cjs +0 -84
  317. package/bin/session-replay-policy.cjs +0 -20
  318. package/bin/session-replay-window-policy.cjs +0 -40
  319. package/bin/session-resume-checkpoint.cjs +0 -254
  320. package/bin/session-scrollback-archive.cjs +0 -229
  321. package/bin/skill-activation-performance-policy.cjs +0 -69
  322. package/bin/skill-listing-performance-policy.cjs +0 -92
  323. package/bin/soul-organization-policy.cjs +0 -78
  324. package/bin/soul-preservation-policy.cjs +0 -20
  325. package/bin/startup-preferences.cjs +0 -131
  326. package/bin/streaming-flush-performance-policy.cjs +0 -28
  327. package/bin/structured-agent-swarm-output.cjs +0 -325
  328. package/bin/structured-subagent-output.cjs +0 -252
  329. package/bin/subagent-context-fork-policy.cjs +0 -155
  330. package/bin/subagent-max-tokens-handoff-policy.cjs +0 -69
  331. package/bin/subagent-parent-responsiveness.cjs +0 -19
  332. package/bin/subagent-skill-policy.cjs +0 -206
  333. package/bin/subagent-timeout-policy.cjs +0 -182
  334. package/bin/subagent-tool-policy.cjs +0 -60
  335. package/bin/subagent-usage-rollup-policy.cjs +0 -29
  336. package/bin/system-prompt-context-policy.cjs +0 -124
  337. package/bin/system-prompt-token-cache-policy.cjs +0 -60
  338. package/bin/telegram-addressed-focus.cjs +0 -55
  339. package/bin/telegram-addressed-priority.cjs +0 -12
  340. package/bin/telegram-approval-relay.cjs +0 -290
  341. package/bin/telegram-bot-priority.cjs +0 -17
  342. package/bin/telegram-console-status-policy.cjs +0 -174
  343. package/bin/telegram-context-projection-policy.cjs +0 -141
  344. package/bin/telegram-delivery-lifecycle.cjs +0 -125
  345. package/bin/telegram-direct-focus-policy.cjs +0 -273
  346. package/bin/telegram-mcp-compatibility.cjs +0 -49
  347. package/bin/telegram-media-delivery-policy.cjs +0 -42
  348. package/bin/telegram-private-conversation-policy.cjs +0 -185
  349. package/bin/telegram-queue-handoff-policy.cjs +0 -73
  350. package/bin/telegram-remote-status-policy.cjs +0 -120
  351. package/bin/telegram-session-queue-runtime.mjs +0 -306
  352. package/bin/telegram-text-chunk-policy.cjs +0 -63
  353. package/bin/telegram-truncated-reply-policy.cjs +0 -37
  354. package/bin/telegram-urgent-policy.cjs +0 -45
  355. package/bin/telemetry-spool-policy.cjs +0 -57
  356. package/bin/thinking-activity-status-policy.cjs +0 -132
  357. package/bin/thinking-only-guard.cjs +0 -80
  358. package/bin/todo-list-turn-policy.cjs +0 -131
  359. package/bin/tool-call-loop-policy.cjs +0 -51
  360. package/bin/tool-file-persistence.cjs +0 -141
  361. package/bin/tool-result-offload-policy.cjs +0 -359
  362. package/bin/tool-result-offload-telemetry.cjs +0 -12
  363. package/bin/tool-schema-token-cache-policy.cjs +0 -41
  364. package/bin/tool-stream-preview-policy.cjs +0 -9
  365. package/bin/tui-functional-contract.cjs +0 -55
  366. package/bin/turn-tool-performance-policy.cjs +0 -486
  367. package/bin/usage-cache-efficiency-policy.cjs +0 -26
  368. package/bin/user-home-path-policy.cjs +0 -13
  369. package/bin/user-message-offload-policy.cjs +0 -103
  370. package/bin/user-prompt-hook-origin-policy.cjs +0 -34
  371. package/bin/user-tool-record-policy.cjs +0 -7
  372. package/bin/validated-learning-insight-policy.cjs +0 -58
  373. package/bin/validated-learning-outcome-trace.cjs +0 -107
  374. package/bin/validated-learning-performance-policy.cjs +0 -53
  375. package/bin/validated-learning-signal.cjs +0 -463
  376. package/bin/windows-bash-dialect-policy.cjs +0 -25
  377. package/bin/windows-node-crash-dump.cjs +0 -110
  378. package/bin/write-continuation-policy.cjs +0 -69
  379. package/codebase-index/README.md +0 -82
  380. package/codebase-index/codebase_index.py +0 -470
  381. package/standard-skills/agent-browser/SKILL.md +0 -19
  382. package/standard-skills/agent-browser/references/runtime.md +0 -8
  383. package/standard-skills/blun-session-inspector/SKILL.md +0 -41
  384. package/standard-skills/blun-session-inspector/scripts/inspect-session.cjs +0 -437
  385. package/standard-skills/design-taste-frontend/SKILL.md +0 -1206
  386. package/standard-skills/full-output-enforcement/SKILL.md +0 -49
  387. package/standard-skills/high-end-visual-design/SKILL.md +0 -98
  388. package/standard-skills/image-to-code/SKILL.md +0 -1228
  389. package/standard-skills/industrial-brutalist-ui/SKILL.md +0 -92
  390. package/standard-skills/minimalist-ui/SKILL.md +0 -85
  391. package/standard-skills/motion-design-taste/SKILL.md +0 -74
  392. package/standard-skills/playwright-testing/SKILL.md +0 -19
  393. package/standard-skills/playwright-testing/references/runtime.md +0 -7
  394. package/standard-skills/premortem/SKILL.md +0 -148
  395. package/standard-skills/redesign-existing-projects/SKILL.md +0 -178
  396. package/standard-skills/research-evidence/SKILL.md +0 -39
  397. package/standard-skills/research-evidence/references/evidence-format.md +0 -104
  398. package/standard-skills/research-evidence/scripts/evidence-collection.cjs +0 -260
  399. package/standard-skills/research-evidence/scripts/score-report.cjs +0 -130
  400. package/standard-skills/screenshot-lesen/SKILL.md +0 -52
  401. package/standard-skills/stitch-design-taste/DESIGN.md +0 -121
  402. package/standard-skills/stitch-design-taste/SKILL.md +0 -184
  403. package/standard-skills/telegram-channel/SKILL.md +0 -18
  404. package/standard-skills/telegram-channel/references/runtime.md +0 -7
  405. package/standard-skills/venture-flywheel/SKILL.md +0 -32
  406. package/standard-skills/venture-flywheel/identity/project-identity.cjs +0 -146
  407. package/standard-skills/venture-flywheel/policy/capability-engine.cjs +0 -114
  408. package/standard-skills/venture-flywheel/policy/repository-trust.cjs +0 -229
  409. package/standard-skills/venture-flywheel/references/BEISPIELE-phase0.md +0 -146
  410. package/standard-skills/venture-flywheel/references/CAPABILITY-MAP.md +0 -34
  411. package/standard-skills/venture-flywheel/references/SPEC-phase0-identity-trust.md +0 -77
  412. package/standard-skills/venture-flywheel/references/SPEC-phase0-state-events.md +0 -93
  413. package/standard-skills/venture-flywheel/schemas/capability-decision.schema.json +0 -13
  414. package/standard-skills/venture-flywheel/schemas/execution-event.schema.json +0 -44
  415. package/standard-skills/venture-flywheel/schemas/project-identity.schema.json +0 -32
  416. package/standard-skills/venture-flywheel/schemas/repository-trust.schema.json +0 -57
  417. package/standard-skills/venture-flywheel/schemas/run-transition.schema.json +0 -59
  418. package/standard-skills/venture-flywheel/state/execution-event.cjs +0 -191
  419. package/standard-skills/venture-flywheel/state/task-state-machine.cjs +0 -190
  420. package/standard-skills/web-lesen/SKILL.md +0 -73
  421. package/standard-skills/web-lesen/scripts/crawl_public.py +0 -379
  422. package/standard-skills/windows-mcp/SKILL.md +0 -19
  423. package/standard-skills/windows-mcp/references/runtime.md +0 -9
  424. package/telegram-plugin/DELIVERY.md +0 -36
  425. package/telegram-plugin/bin/telegram-approval-relay.cjs +0 -290
  426. package/telegram-plugin/bin/telegram-console-status-policy.cjs +0 -175
  427. package/telegram-plugin/bin/telegram-delivery-lifecycle.cjs +0 -125
  428. package/telegram-plugin/bin/telegram-direct-reply-policy.cjs +0 -48
  429. package/telegram-plugin/bin/telegram-launcher-status-queue.cjs +0 -122
  430. package/telegram-plugin/bin/telegram-private-conversation-policy.cjs +0 -186
  431. package/telegram-plugin/bin/telegram-remote-status-policy.cjs +0 -121
  432. package/telegram-plugin/bin/telegram-reply-parts.cjs +0 -149
  433. package/telegram-plugin/bin/telegram-text-chunk-policy.cjs +0 -63
  434. package/telegram-plugin/bin/telegram-typing-keepalive.cjs +0 -89
  435. package/telegram-plugin/compat/mcp-server-fa511cd1.mjs +0 -73825
  436. /package/{bin → scripts}/fix-node-pty-perms.js +0 -0
@@ -0,0 +1,2035 @@
1
+ # Website localization job planning
2
+
3
+ `integrations/website_localization.py` is the provider-neutral entry point for
4
+ the website-localization pipeline. It does not contact an LLM and cannot
5
+ publish content. Its only job is to turn one trusted source object into one
6
+ independently retryable queue payload per EU target locale.
7
+
8
+ ## Premortem
9
+
10
+ Assume the planner shipped and failed: stale work was reused after a source,
11
+ glossary, policy, provider, model, or runtime change; the source language was
12
+ translated back into itself; or one queue entry mixed several target
13
+ languages. The early warning is a repeated job identity despite one changed
14
+ input or a job count that differs from 23 for an EU source and 24 for a non-EU
15
+ source. The mitigation is one immutable job per locale whose canonical
16
+ idempotency binding includes every result-affecting field and the exact source
17
+ hash. The regression suite mutates each binding separately and proves the
18
+ expected 24-profile registry and per-language job counts.
19
+
20
+ The current language registry follows the European Union's official list of 24
21
+ languages: <https://european-union.europa.eu/principles-countries-history/languages_en>.
22
+ Each language has one explicit BCP-47 website profile. The default German
23
+ profile is `de-AT`; English is `en-IE`, Portuguese is `pt-PT`, Spanish is
24
+ `es-ES`, and Swedish is `sv-SE`. A source whose primary language is already in
25
+ the registry produces 23 jobs. A non-EU source produces all 24.
26
+
27
+ `integrations/website_localization_quality_profiles.py` adds one immutable,
28
+ versioned evaluation profile for each of those 24 locales. Each profile has
29
+ separate target-only nativeness criteria, source-aware fidelity criteria, and
30
+ locale-specific adversarial cases. Every profile also requires the complete
31
+ red-team matrix for translationese, wrong neighbouring language, mixed
32
+ varieties, ASCII folding, missing diacritics or native script, wrong
33
+ inflection, omitted meaning, unnatural CTAs, and marketing calques. This
34
+ shared minimum does not replace the language-specific criteria.
35
+
36
+ The canonical profile hash and version are part of the target profile and job
37
+ identity. The complete profile is supplied independently to transcreation,
38
+ target-only review, source-aware review, and blinded benchmark review. Worker
39
+ results carry the locale, version, and hash; quality-evidence requests and
40
+ signed approvals bind that triplet again. A missing, substituted, or stale
41
+ profile therefore blocks before a provider call or release instead of falling
42
+ back to generic instructions.
43
+
44
+ Finnish criteria explicitly cover natural information structure, case
45
+ government, agglutination, possessive suffixes, vowel harmony, consonant
46
+ gradation, clitics, compounds, politeness, and non-calqued web CTAs. Maltese
47
+ criteria cover `ċ`, `ġ`, `għ`, `ħ`, and `ż`, morphology, fused articles and
48
+ prepositions, idiom, and English/Italian calques. The Maltese institutional
49
+ reference is the [Kunsill Nazzjonali tal-Ilsien Malti](https://kunsilltalmalti.gov.mt/mistoqssija-u-twegiba-51-76/);
50
+ locale exemplar and convention references are pinned to
51
+ [Unicode CLDR 48](https://www.unicode.org/cldr/charts/48/summary/mt.html).
52
+
53
+ ## JSON contract
54
+
55
+ ```bash
56
+ python3 integrations/website_localization.py <<'JSON'
57
+ {
58
+ "source_id": "homepage.hero",
59
+ "source_revision": "cms-184",
60
+ "source_text": "Build your business with BLUN.",
61
+ "source_locale": "en-IE",
62
+ "content_type": "headline",
63
+ "glossary_version": "blun-glossary-3",
64
+ "policy_version": "native-web-1",
65
+ "provider_id": "customer-llm",
66
+ "model_id": "king",
67
+ "model_version": "2026-08-29",
68
+ "software_version": "6.43.0-dev",
69
+ "target_locales": ["de-AT", "sv-SE"]
70
+ }
71
+ JSON
72
+ ```
73
+
74
+ Omit `target_locales` to request every eligible EU language. An explicit list
75
+ must contain supported profiles, must not contain duplicates, and must exclude
76
+ the source language. Unknown input fields, ambiguous locale values such as
77
+ `auto`, non-NFC text, NUL characters, unsupported content types, oversized
78
+ source text, and wrong JSON types block the complete plan.
79
+
80
+ Every emitted job contains exactly one target profile, the unchanged source
81
+ text and its SHA-256 hash, both required quality-pass names, and
82
+ `release_required: true`. Its `job_id` and `idempotency_key` are identical and
83
+ are derived from canonical JSON bound to:
84
+
85
+ - source ID, revision, text hash, and locale;
86
+ - complete target-locale metadata, including quality-profile version and hash,
87
+ plus content type;
88
+ - glossary and quality-policy versions;
89
+ - provider, model ID, and model version;
90
+ - Translate Native software version.
91
+
92
+ Changing any bound value creates a new job and plan identity. A queue may
93
+ therefore deduplicate an exact retry, while stale work cannot silently survive
94
+ a changed source, glossary, policy, provider, model, or runtime. Later workers
95
+ must keep the two declared reviews separate—target-only native quality first,
96
+ source-aware fidelity second—and obtain a signed Translate Native release
97
+ before publication.
98
+
99
+ ## Durable queue state
100
+
101
+ `integrations/website_localization_queue.py` persists planner jobs through a
102
+ trusted host-supplied `sqlite3.Connection`. Enqueuing a complete plan is one
103
+ transaction: an exact repeat inserts nothing, while a reused job ID with
104
+ different bytes rolls the entire operation back. Workers claim one locale at a
105
+ time through a random, owner-bound lease. Lease expiry recovers work after a
106
+ crash, but stale claims cannot acknowledge a newer attempt.
107
+
108
+ The queue records `pending`, `leased`, `retry_wait`, `succeeded`, and `failed`
109
+ states, bounded attempt counts, the next eligible attempt time, result hashes,
110
+ and stable error codes. Free-form error detail is represented only by a
111
+ SHA-256 hash so status inspection does not disclose customer prose. Payloads
112
+ are hashed on insertion and checked again before a worker receives them.
113
+
114
+ Queue `succeeded` means only that a worker returned finite, NFC JSON. It is not
115
+ a native-quality attestation, signed release, or publication permission. The
116
+ later review and release stages must still perform the ordered target-only and
117
+ source-aware checks and verify a purpose-bound Translate Native receipt.
118
+
119
+ Premortem: a worker may crash while leased, retry forever, replay a stale
120
+ claim, or collide with different content under the same idempotency key. The
121
+ lease token changes on every attempt, expiry consumes the abandoned attempt,
122
+ the configured attempt ceiling becomes terminal, and every collision or
123
+ payload-integrity failure blocks transactionally. Cross-connection and crash
124
+ recovery regressions prove those boundaries.
125
+
126
+ ## Provider-neutral worker contract
127
+
128
+ `integrations/website_localization_worker.py` consumes exactly one locale job
129
+ and calls a host-supplied adapter implementing `invoke(ProviderRequest)`. The
130
+ contract contains no BLUN.ai, OpenAI, Anthropic, or other provider-specific
131
+ transport. An adapter maps the immutable request to its own API and either
132
+ returns strict JSON or raises the content-free `ProviderCallFailed` with a
133
+ stable error code and retryability decision.
134
+
135
+ Every worker attempt has three ordered calls:
136
+
137
+ 1. `transcreation` receives the complete source, one exact BCP-47 target,
138
+ content-specific guidance, and the resolved glossary, audience, tone, and
139
+ protected terms;
140
+ 2. `target_native` receives only the candidate and target-side terminology—no
141
+ source text, source locale, or source glossary terms—and rejects unnatural
142
+ wording, translationese, register, script, orthography, and locale errors;
143
+ 3. `source_fidelity` runs only after the native review passes and checks the
144
+ candidate against the complete source for meaning, completeness,
145
+ terminology, and protected syntax.
146
+
147
+ The trusted host resolves `LocalizationAssets` from immutable registries. Its
148
+ glossary and policy versions must exactly match the versions already bound to
149
+ the job; stale assets block before any provider call. The policy version owns
150
+ the audience, tone profile, prompt rules, and review standard. Provider
151
+ responses must use the exact phase, locale, and schema, contain no extra
152
+ fields, and use NFC text. Each review must also report `confidence` as exactly
153
+ `high` or `low`. Missing or unknown confidence is malformed and blocks; `high`
154
+ does not replace either substantive review, while `low` adds a mandatory
155
+ independent-review requirement to the result. A wrong locale, malformed
156
+ response, failed review, provider exception, or changed job binding blocks
157
+ without producing a queue result.
158
+
159
+ After both LLM reviews pass, the bundled local translation guard independently
160
+ checks Unicode NFC, HTML/JSON/XML structure, placeholders, links, code,
161
+ protected tokens, untranslated segments, and major omissions. Worker results
162
+ bind source and target hashes, locales, content type, glossary and policy
163
+ versions, provider/model identity, software version, and hashes of all three
164
+ requests and responses. The explicit per-phase confidence decision is carried
165
+ in the result and remains bound through quality evidence and the signed
166
+ approval. Results retain no reviewer prose and still set
167
+ `release_required: true`; queue success therefore remains neither a signed
168
+ release nor publication permission. Legal content sets
169
+ `human_review_required: true`; low confidence in either review instead sets
170
+ `independent_review_required: true` for non-legal content. The latter can be
171
+ satisfied only by a separately verified qualified-human receipt or a verified
172
+ second model adapter with a different provider identity.
173
+
174
+ Premortem: a provider could answer in the wrong locale, merge creation and
175
+ review, leak the source into the native-only judgment, return convincing but
176
+ unstructured prose, or pass a candidate with a broken placeholder. Exact
177
+ phase and locale schemas, separate inputs, ordered calls, version matching,
178
+ response hashes, and the final local integrity gate make each case fail closed.
179
+ The same profile version and hash are carried into the unsigned worker result,
180
+ then into external quality evidence and the signed approval, so a later profile
181
+ change cannot reuse an older translation-memory entry.
182
+
183
+ ### Secure HTTP provider adapter
184
+
185
+ `integrations/website_localization_http_provider.py` is the bundled transport
186
+ for connecting a host-owned model gateway to the worker contract. It sends one
187
+ request for one locale and one phase, binds every response to the deterministic
188
+ request ID and canonical request hash, obtains credentials from a host callback,
189
+ rejects redirects, and leaves all bounded retries to the durable queue. The
190
+ adapter is vendor-neutral and can sit in front of a user's own LLM or any
191
+ provider-specific proxy without placing credentials or vendor logic in jobs.
192
+
193
+ The complete public envelope, authentication, idempotency, response, and
194
+ failure contract is documented in
195
+ [`WEBSITE_LOCALIZATION_HTTP_PROVIDER.md`](WEBSITE_LOCALIZATION_HTTP_PROVIDER.md).
196
+ The transport proves neither native quality nor superiority over an external
197
+ baseline; those decisions remain with the two independent review stages and
198
+ the blinded benchmark.
199
+
200
+ ## Queue-to-worker execution
201
+
202
+ `integrations/website_localization_runner.py` is the narrow bridge between the
203
+ durable queue and the provider-neutral worker. One call claims at most one
204
+ locale, resolves its exact provider and versioned assets through host-supplied
205
+ callbacks, executes the three quality stages, and performs one lease-bound
206
+ queue transition. A successful transition stores the unsigned worker result;
207
+ it still cannot publish, replace a last-known-good translation, or make the
208
+ overall website version ready.
209
+
210
+ The runner renews the lease after dependency resolution and after every
211
+ validated worker phase. If a provider call outlives the lease, a stale worker
212
+ cannot record its output. Retryable failures use deterministic bounded
213
+ exponential backoff and become terminal at the job's attempt ceiling.
214
+ Non-retryable failures stop only that locale. Status output contains stable
215
+ codes and opaque finding hashes, never provider exceptions, reviewer prose, or
216
+ candidate text. Mixed success and failure therefore remains visible per locale
217
+ while publication stays blocked until a later release coordinator verifies all
218
+ required signed approvals.
219
+
220
+ Premortem: the bridge could acknowledge output after losing its lease, retry a
221
+ permanent configuration error forever, expose source text through exception
222
+ messages, or let one failed locale erase a successful sibling. Exact lease
223
+ tokens guard every transition; typed dependency and worker failures preserve
224
+ retryability without prose; attempts are bounded; and each invocation mutates
225
+ only its claimed locale. Regression tests exercise lease expiry, retry
226
+ exhaustion, opaque errors, and partial provider failure.
227
+
228
+ ### Signed local fallback
229
+
230
+ The low-level runner's optional `result_cache` is deliberately consulted before
231
+ asset or provider resolution. The complete production runtime does not accept a
232
+ host-supplied cache: it always constructs
233
+ `LocalizationReleaseStore.verified_result_cache(authority)` from its own local
234
+ signed release store and the already validated approval authority. That adapter
235
+ loads the exact deterministic job from the local translation memory, rechecks
236
+ the stored result hash, approval payload hash, complete job binding, approval
237
+ ID, signing-key identity, signature, and expiry, and returns the already
238
+ reviewed worker result only when every check passes. `RunOutcome.result_origin`
239
+ then reports `translation_memory`; a new provider result reports `provider`.
240
+
241
+ A missing or expired approval is a clean cache miss. The normal provider path
242
+ must produce and review a new target, so an unavailable model still leaves the
243
+ locale blocked without inventing text. Any malformed, altered, or unverifiable
244
+ cache entry blocks that attempt before provider or asset lookup and follows the
245
+ queue's bounded retry policy. Because job identity binds source, locale,
246
+ content type, glossary, policy, provider/model, worker schema, and software
247
+ version, changing any of them cannot reuse an older translation.
248
+
249
+ Premortem: an offline deployment could mistake an expired translation for a
250
+ safe fallback, silently use a signature from another source or policy, or call
251
+ the provider after discovering local tampering. The adapter treats expiry as a
252
+ miss, verifies every signed binding before returning content, and makes cache
253
+ verification errors stop the attempt before any other resolver runs. Tests
254
+ cover exact offline recovery, policy invalidation, expiry, and database
255
+ tampering across separate queue and translation-memory connections.
256
+
257
+ ## Blind quality benchmark against an external baseline
258
+
259
+ `integrations/website_localization_benchmark.py` provides the evidence gate for
260
+ quality claims such as “better than DeepL.” The module does not call DeepL or
261
+ any other baseline service. A host may create a comparison artifact only from
262
+ the provider's official API or a lawfully supplied fixed fixture. It calls
263
+ `create_baseline_artifact` with the exact target and a provenance record whose
264
+ method is `official_api` or `lawful_fixture`, plus a stable evidence identifier
265
+ and SHA-256 digest of the host-retained acquisition record. Undocumented
266
+ endpoints and scraping are deliberately not valid provenance methods.
267
+
268
+ The artifact binds the baseline identity and version, exact source hash,
269
+ target locale, content type, target hash, complete target text, and provenance.
270
+ The same host-owned `BenchmarkEvidenceAuthority` attests those canonical bytes
271
+ and immediately verifies its own result. The harness rejects unsigned,
272
+ foreign-key, changed, or malformed baseline evidence before either reviewer is
273
+ called. The case result retains only target, provenance, and complete artifact
274
+ hashes; the final report includes a digest over the exact baseline-evidence set.
275
+ Neither provenance nor baseline identity enters a reviewer request. A signature
276
+ proves integrity and host approval, not that a false provenance statement is
277
+ legally true, so the host must preserve the API receipt or fixture licence for
278
+ audit. Credentials and transport code do not belong in benchmark artifacts.
279
+
280
+ ### Official DeepL baseline acquisition
281
+
282
+ `integrations/website_localization_deepl_baseline.py` is the optional concrete
283
+ input adapter for that provider-neutral gate. The host chooses only `free` or
284
+ `pro`; the adapter derives the corresponding documented origin and does not
285
+ accept an arbitrary URL. It obtains the API key from a callback immediately
286
+ before each request, sends it with the documented `DeepL-Auth-Key` scheme, and
287
+ disables redirects. Neither the key nor the raw provider response envelope
288
+ appears in an exception, representation, artifact, or provenance-evidence
289
+ record; the exact translated target is retained only where the benchmark
290
+ artifact contract requires it.
291
+
292
+ Before translation, the adapter queries
293
+ `GET /v3/languages?resource=translate_text` and caches a validated stable
294
+ capability snapshot for no more than one hour. It prefers an exact BCP-47
295
+ variant and otherwise uses a provider-advertised base language only when that
296
+ base is explicitly usable in the required source or target role. New stable
297
+ languages can therefore become available without a release, while removed,
298
+ beta, malformed, or unsupported entries block fail-closed. In particular, the
299
+ adapter does not manufacture a Maltese result when the current API capability
300
+ response does not advertise `mt` as a target.
301
+
302
+ One benchmark case produces one `POST /v2/translate` request. Its `text` array
303
+ contains exactly the complete bound source document, never separately scored
304
+ segments or several locales; the request selects `prefer_quality_optimized`
305
+ and preserves formatting. The adapter enforces DeepL's 128-KiB request limit,
306
+ a bounded response, strict UTF-8 JSON with no duplicate keys, exactly one
307
+ translation, source-language consistency, NFC target text, and the benchmark's
308
+ target-size limit. It classifies HTTP 429 and 5xx responses as retryable for
309
+ the campaign's existing bounded exponential backoff. Authentication, quota,
310
+ other HTTP 4xx, unsupported-language, schema, binding, and attestation failures
311
+ remain terminal. Adapter errors carry a validated content-free campaign marker,
312
+ so `run_next_benchmark_case` stores only a stable code and retry decision.
313
+
314
+ On success, `BaselineAcquisition.artifact` is the existing signed benchmark
315
+ artifact. `BaselineAcquisition.evidence` contains only endpoint, language,
316
+ model label, and exact request/response/source/target digests. Its canonical
317
+ digest becomes the artifact's `official_api` provenance; the host must retain
318
+ that evidence beside its authorized API audit record.
319
+
320
+ `BaselineAcquisitionStore` provides the durable hand-off between acquisition
321
+ and blind review. Give it a dedicated host-owned SQLite connection and resolve
322
+ each acquisition with `resolve_baseline_acquisition`. The caller supplies a
323
+ stable route ID such as an account/environment reference that contains no
324
+ credential. Store identity binds that route, the complete validated benchmark
325
+ policy, and the complete validated suite job. It therefore changes with the
326
+ source, locale, candidate configuration, suite, baseline identity or version,
327
+ quality policy, and every other benchmark-policy field.
328
+
329
+ The resolver first reads and reverifies the exact stored artifact, provenance
330
+ evidence, canonical hashes, and host attestation. A valid hit is returned
331
+ without calling the acquisition callback; a missing row calls it once and
332
+ persists the complete acquisition before review. Corrupt state is not a cache
333
+ miss: it blocks before any callback or provider request. Concurrent identical
334
+ writes converge, while a different valid output under the same identity is a
335
+ terminal conflict and never replaces the first acquisition. Rotate
336
+ `baseline_version` deliberately when a fresh current-API comparison is
337
+ required.
338
+
339
+ The database necessarily contains the baseline target because the blind
340
+ benchmark consumes it. Keep the database owner-only and apply host storage
341
+ encryption, backup, retention, and deletion policy appropriate to the source
342
+ content; never place API keys or raw provider envelopes in it. A separate
343
+ campaign database may retain only the already defined text-free case results.
344
+ Constructing the store neither opens a network connection nor invents a
345
+ fallback translation.
346
+
347
+ Long-running hosts should also pass an `operation_guard` to
348
+ `DeepLBaselineAdapter`. It runs immediately before credentials are requested
349
+ and before each Languages or Translate API call. A lost lease therefore blocks
350
+ the external operation; the campaign still owns bounded retry and terminal
351
+ failure policy.
352
+
353
+ For a provider-unsupported locale, the host may instead call
354
+ `create_lawful_fixture_acquisition`. The fixed target remains host-supplied and
355
+ must match a strict evidence record binding fixture ID and revision, supplier,
356
+ rights basis (`owned`, `licensed`, or `permission`), rights-evidence digest,
357
+ source digest, target locale, and target digest. The function neither retrieves
358
+ nor creates a translation. The host-owned authority attests the resulting
359
+ `lawful_fixture` artifact, and the host remains responsible for the truth and
360
+ retention of the underlying licence or permission.
361
+
362
+ The implementation follows DeepL's official
363
+ [translation request](https://developers.deepl.com/api-reference/translate/request-translation),
364
+ [Languages API](https://developers.deepl.com/docs/languages/using-the-languages-api),
365
+ [error handling](https://developers.deepl.com/docs/best-practices/error-handling),
366
+ and [usage limits](https://developers.deepl.com/docs/resources/usage-limits)
367
+ documentation. No API credential or real baseline output is included in this
368
+ repository.
369
+
370
+ `integrations/website_localization_benchmark_candidate.py` gives the attached
371
+ customer-model candidate the same crash-safe identity discipline as the
372
+ baseline. `resolve_candidate_acquisition` first looks up a candidate under a
373
+ stable, non-secret model-route ID plus the complete benchmark policy and
374
+ canonical suite job. A verified hit returns the exact previous worker result
375
+ without calling the model. A miss runs the ordinary three-phase localization
376
+ worker—transcreation, target-only native review, then source-aware fidelity
377
+ review—and persists the first complete result before blind comparison.
378
+
379
+ The candidate artifact contains the complete worker result and is signed by
380
+ the configured host-owned benchmark evidence authority. Every read checks the
381
+ store digest, reconstructs every job, source, locale, model, version, quality
382
+ profile, review-confidence, and target-hash binding, and reverifies that
383
+ attestation. Recomputing the database digest after changing target text is
384
+ therefore insufficient. Corrupt or differently signed content blocks before
385
+ model access. Identical writers converge; a different valid result under the
386
+ same route, policy, and job is a terminal conflict and cannot replace the first
387
+ candidate. Deliberate reevaluation requires a changed bound model version,
388
+ policy, suite, or route rather than deleting or overwriting evidence.
389
+
390
+ Pass the campaign lease guard as `operation_guard`. A guarded adapter checks it
391
+ immediately before each of the three model calls and before every authority
392
+ sign or verify call, including verification of a cached result. Model,
393
+ temporary authority, and lease failures retain stable retryability and flow
394
+ into the campaign's bounded content-free retry policy. Invalid jobs, assets,
395
+ responses, stored state, attestations, and conflicts remain fail-closed.
396
+
397
+ This dedicated database necessarily retains candidate source-derived text and
398
+ review metadata. Keep it owner-only and apply storage encryption, retention,
399
+ backup, and deletion controls appropriate to the source. It contains no model
400
+ credential or raw provider exception. The separate campaign database still
401
+ stores only attested text-free case results.
402
+
403
+ Every policy-required locale and source case also requires one versioned native
404
+ reference artifact before the first blind review can run. The repository does
405
+ not ship or invent reference translations. A host obtains the exact
406
+ `native_reference_verification_request`, including the complete source and its
407
+ hash, suite case, target locale, content type, glossary and localization-policy
408
+ versions, locale-profile version and hash, complete reference target, and
409
+ reference revision. A configured `NativeReferenceVerifier` must
410
+ then validate an opaque receipt from a separately identified qualified native
411
+ human reviewer. Candidate provider, baseline, A/B reviewer, reference verifier,
412
+ and reference reviewer identities must remain distinct.
413
+
414
+ `create_native_reference_artifact` verifies that receipt before a host-owned
415
+ `BenchmarkEvidenceAuthority` attests the complete artifact. The benchmark
416
+ rechecks both the attestation and qualified-review receipt immediately before
417
+ review and binds the complete evidence hash into the keyed blind assignment,
418
+ case result, and final report. A receipt therefore cannot be replayed across a
419
+ source case, source text, locale, content type, glossary, localization policy,
420
+ quality profile, reference revision, or reviewer credential. Missing, altered,
421
+ rejected, or contradictory reference evidence blocks without calling the A/B
422
+ reviewer.
423
+
424
+ Reference text, reviewer identity, and receipt never enter either A/B request
425
+ or the text-free case result; only hashes and the public reference revision are
426
+ retained. This preserves the strictly ordered two-stage decision: source-blind
427
+ native quality first, then source-aware fidelity. The reference is auditable
428
+ eligibility and calibration evidence, not a hidden third score and not proof
429
+ that a model is linguistically superior. The test references are synthetic
430
+ contract fixtures only and make no native-quality claim.
431
+
432
+ `integrations/website_localization_native_reference_store.py` provides the
433
+ durable hand-off from that qualified-human workflow into a benchmark campaign.
434
+ Give `NativeReferenceArtifactStore` a dedicated host-owned SQLite connection
435
+ and a stable route ID identifying the approved vault or editorial workflow,
436
+ never a credential. The record identity binds that route, the complete
437
+ benchmark policy, and the complete canonical suite job. A source, locale,
438
+ candidate configuration, policy, suite, quality profile, verifier, reference
439
+ revision, or route change therefore cannot inherit an older reference.
440
+
441
+ Every read checks the stored JSON and digest, then reverifies the artifact's
442
+ host attestation and qualified-native receipt against the exact current job.
443
+ Corrupt state blocks instead of becoming a miss. Identical independent writes
444
+ converge, while a different valid artifact under the same identity is a
445
+ terminal conflict and never replaces the first. The database necessarily
446
+ contains the complete reference target and receipt; keep it owner-only and
447
+ apply the host's encryption, backup, retention, and deletion policy. The
448
+ campaign database continues to retain only text-free case evidence.
449
+
450
+ `resolve_native_reference_artifact` returns a verified stored artifact or calls
451
+ one host-supplied external loader and persists its result before blind review.
452
+ Its optional operation guard runs before cached receipt verification, before
453
+ the external lookup, and before verification on save. Guard, loader, temporary
454
+ attestation-authority, and receipt-verifier outages become bounded,
455
+ content-free campaign dependency failures. Invalid artifacts, altered state,
456
+ binding mismatches, and conflicts remain terminal; no missing reference is
457
+ generated locally.
458
+
459
+ `integrations/website_localization_native_reference_intake.py` completes the
460
+ editorial hand-off without defining a vendor or inventing a translation. A
461
+ host creates one `blun.website-localization-native-reference-work-order.v1`
462
+ object per exact suite job. It contains the complete source, target locale,
463
+ content type, locale-quality profile, policy and suite bindings, but no target
464
+ text, reviewer credential, receipt, candidate, or baseline. Its stable identity
465
+ binds the current route, complete policy, and complete canonical job.
466
+
467
+ After a separately qualified native editor supplies a target, use
468
+ `native_reference_verification_request_for_work_order` to construct the exact
469
+ request that the configured verification authority must authorize. Submit that
470
+ request and opaque receipt as
471
+ `blun.website-localization-native-reference-submission.v1`, including the exact
472
+ work-order ID and SHA-256 digest. `accept_native_reference_submission`
473
+ regenerates the work order from current trusted state, reconstructs the receipt
474
+ payload, verifies the qualified-human receipt, obtains and verifies the host
475
+ attestation, then saves through `NativeReferenceArtifactStore`. A stale order,
476
+ changed source, locale, profile, suite, policy, route, reviewer, target, or
477
+ receipt therefore blocks before storage. Pass the campaign lease guard as
478
+ `operation_guard`; it is checked immediately before every verifier and
479
+ attestation-authority operation. Temporary guard, verifier, signer, or
480
+ attestation-verifier outages are retryable and content-free. Identical
481
+ submissions converge, while a different valid submission cannot replace the
482
+ first accepted reference.
483
+
484
+ The work order and accepted artifact contain source-derived prose and the
485
+ accepted artifact contains the native target and receipt. Transport them only
486
+ over a host-authenticated channel and retain them in owner-only storage under
487
+ the host's encryption, access, backup, retention, and deletion policy. Public
488
+ status must expose only stable IDs, hashes, codes, and counts. The intake
489
+ module performs no network call, reads no credential or environment variable,
490
+ and deliberately leaves authentication and qualified-review operations to the
491
+ host adapters.
492
+
493
+ `integrations/website_localization_native_reference_queue.py` makes that hand-off
494
+ durable for a complete campaign. It creates exactly one text-free queue row for
495
+ every policy-required `(target_locale, suite_case_key)` pair in the campaign
496
+ database. `claim_native_reference_work_order` returns one expiring,
497
+ token-bound lease and its exact target-free work order; concurrent editors
498
+ cannot claim the same live row. The lease payload contains the source and is a
499
+ private editorial artifact even though it contains no target. Renew it with
500
+ `renew_native_reference_work_order` when a qualified review legitimately needs
501
+ more time.
502
+
503
+ Submit only through `accept_native_reference_submission` on the production
504
+ runtime. The runtime checks the exact live queue lease before each receipt or
505
+ attestation operation, saves the verified artifact in the separate native-
506
+ reference store, and only then records the artifact SHA-256 digest as queue
507
+ success. A verifier or authority outage enters bounded exponential retry;
508
+ malformed, replayed, stale, or rejected evidence becomes a terminal stable
509
+ error without storing its prose. Expired leases are recovered with a new token
510
+ and stop permanently at the configured attempt limit. If a process crashes
511
+ after the artifact commit but before queue completion, the next claim
512
+ reverifies that immutable artifact and reconciles the queue without asking a
513
+ model or external reference loader to create replacement text.
514
+
515
+ `native_reference_queue_status` and `native_reference_queue_health` expose only
516
+ counts, hashes, timestamps, and stable codes. Health is rollback-only and
517
+ blocks on corrupt state, terminal failures, or an expired benchmark policy;
518
+ expired leases, due retries, and stalled progress degrade visibly. A transport
519
+ adapter must keep the lease token and work-order source private, authenticate
520
+ the editor, reject duplicate JSON keys and oversized bodies, and map the
521
+ runtime's exact content-free outcomes without weakening these checks.
522
+
523
+ `integrations/website_localization_native_reference_http.py` provides that
524
+ transport as a provider-neutral WSGI application. The host supplies one
525
+ authenticator; after checking the complete method, path, normalized headers,
526
+ and request-body SHA-256 digest, it must return a credential-bound editor ID
527
+ and exactly one qualified BCP-47 target locale. The client cannot choose or
528
+ override either value. The application requires an effective HTTPS WSGI
529
+ scheme, rejects query strings, transfer encoding, missing or false content
530
+ lengths, non-JSON media types, BOMs, duplicate keys, non-finite numbers,
531
+ invalid UTF-8, extra fields, and bodies above 4 MiB. Authentication happens
532
+ before JSON decoding, and neither credentials nor exception prose enter a
533
+ response.
534
+
535
+ The private endpoints are:
536
+
537
+ - `POST /v1/native-references/claim` with the exact claim schema, a durable
538
+ request ID, and a lease duration. The queue filters by the authenticated
539
+ locale. Replaying the same request while its lease is live returns the exact
540
+ same lease and cannot reserve a second source; replay after expiry or reuse
541
+ under another credential fails closed.
542
+ - `POST /v1/native-references/renew` with the exact private lease envelope and
543
+ a new duration. The runtime reconstructs the canonical job from policy and
544
+ suite state, then requires the authenticated editor, locale, work ID,
545
+ attempt, token, expiry, and complete work order to match the live row. Lease
546
+ renewal and its content-free response journal commit in one transaction, so
547
+ a retry after a lost response returns the byte-equivalent lease envelope.
548
+ - `POST /v1/native-references/submit` with that lease and the complete
549
+ transport-neutral submission envelope below. Receipt verification,
550
+ attestation, immutable artifact storage, and queue completion remain inside
551
+ the runtime. The request is reserved before external verification, and its
552
+ content-free outcome is committed atomically with the queue transition. An
553
+ exact retry returns that outcome without invoking the verifier or storage
554
+ again; a repeated or stale request cannot store a second result.
555
+ - `GET /v1/native-references/status`, which returns only the authenticated
556
+ locale plus the existing content-free counts, timestamps, hashes, and stable
557
+ codes, including processing, completed, and abandoned HTTP-request counts.
558
+ It never returns a source, target, receipt, credential, request ID, or lease
559
+ token.
560
+
561
+ Every response sets `Cache-Control: no-store` and
562
+ `X-Content-Type-Options: nosniff`. A claim response necessarily contains the
563
+ source and lease token, so operators must also prevent proxy/access-log body
564
+ capture and apply owner-only retention to request bodies. When TLS terminates
565
+ before WSGI, only a trusted proxy may set the effective HTTPS scheme;
566
+ forwarding an untrusted client header is not sufficient. Request IDs are
567
+ idempotency keys, not evidence and not authorization.
568
+
569
+ Renewal and submission journals bind the request ID to the exact body digest,
570
+ campaign, credential-derived editor identity, locale, work item, attempt,
571
+ lease token, and original expiry. Reusing an ID with another operation, body,
572
+ credential, or locale is a conflict. Journals retain only renewal expiry or
573
+ the existing content-free queue outcome—never source text, target text,
574
+ receipts, work orders, or credentials. Concurrent submission retries receive
575
+ a retryable in-progress conflict. If the worker crashes before a queue
576
+ transition, the processing entry expires with its work lease; normal bounded
577
+ queue recovery issues a new attempt and the abandoned request ID remains
578
+ unusable.
579
+
580
+ The three write requests use these exact outer shapes; `lease` is the complete
581
+ claim response value and `submission` is the complete envelope in the next
582
+ section:
583
+
584
+ ```json
585
+ {"schema":"blun.website-localization-native-reference-http-claim.v1","request_id":"<idempotency key>","lease_seconds":3600}
586
+ {"schema":"blun.website-localization-native-reference-http-renew.v1","request_id":"<idempotency key>","lease":{},"lease_seconds":3600}
587
+ {"schema":"blun.website-localization-native-reference-http-submit.v1","request_id":"<idempotency key>","lease":{},"submission":{}}
588
+ ```
589
+
590
+ The authentication adapter receives
591
+ `blun.website-localization-native-reference-http-auth.v1` with the exact HTTP
592
+ method, path, normalized headers, and body digest. It returns exactly
593
+ `schema`, `editor_id`, `target_locale`, `credential_id`, and
594
+ `credential_version` under
595
+ `blun.website-localization-native-reference-editor.v1`. The WSGI application
596
+ validates this shape but does not decide whether the credential is qualified;
597
+ that trust decision belongs to the host authenticator and its separately
598
+ managed registry.
599
+
600
+ The transport-neutral submission envelope has exactly these top-level fields:
601
+
602
+ ```json
603
+ {
604
+ "schema": "blun.website-localization-native-reference-submission.v1",
605
+ "work_order_id": "native-reference-work-order:<sha256>",
606
+ "work_order_sha256": "<sha256 of the complete canonical work order>",
607
+ "verification_request": {
608
+ "schema": "blun.website-localization-native-reference-request.v1",
609
+ "reference_revision": "<policy-bound revision>",
610
+ "suite": "<exact suite object from the work order>",
611
+ "source": "<exact source object from the work order>",
612
+ "target_locale": "<exact BCP-47 locale from the work order>",
613
+ "content_type": "<exact content type from the work order>",
614
+ "quality_profile": "<exact locale profile from the work order>",
615
+ "localization_policy": "<exact version bindings from the work order>",
616
+ "qualification": {
617
+ "method": "qualified_native_human",
618
+ "reviewer_id": "<independent reviewer ID>",
619
+ "reviewer_version": "<credential version>",
620
+ "verifier_id": "<exact verifier ID from the work order>",
621
+ "verifier_version": "<exact verifier version from the work order>"
622
+ },
623
+ "target_text": "<NFC native reference>",
624
+ "target_sha256": "<sha256 of the exact UTF-8 target>"
625
+ },
626
+ "qualification_receipt": "<opaque verifier receipt>"
627
+ }
628
+ ```
629
+
630
+ Fields shown as objects must be JSON objects, not strings; the notation above
631
+ keeps the contract compact. Implementations must transmit the complete
632
+ canonical objects returned by the two intake helpers and must reject extra,
633
+ missing, duplicate, non-finite, oversized, or altered data at their transport
634
+ boundary. The host may wrap this envelope in its own authenticated HTTP,
635
+ message-queue, or editorial-system protocol, but that wrapper is not evidence
636
+ and cannot weaken the receipt, attestation, or immutable-store checks.
637
+
638
+ Every benchmark policy must bind the exact version and SHA-256 digest of the
639
+ output-free source manifest in
640
+ `integrations/website_localization_benchmark_suite.py`. Suite v4 contains 64
641
+ cases: eight independently bound cases from eight distinct domains for each of
642
+ `headline`, `cta`, `marketing`, `ui`, `documentation`, `seo`, `legal`, and
643
+ `commercial`. Eighteen cases are connected long-form pages across commercial,
644
+ marketing, documentation, and legally sensitive content. Together they
645
+ exercise HTML, JSON, placeholders, links, native register and rhythm,
646
+ translationese, negation, modality, amounts, currencies, discount and surcharge
647
+ bases, tax, deposits, trials, billing versus commitment, renewal, cancellation,
648
+ refunds, proration, tiered prices, and offer assignment. The suite contains no
649
+ target, candidate, baseline, or supposed reference translation. Actual targets
650
+ must still come from the attached candidate and lawfully acquired baseline so
651
+ unreviewed prose cannot silently become a gold standard.
652
+
653
+ The hashed manifest also binds the exact commercial evaluation scope from the
654
+ public, brand-neutral offer profile. Every commercial case carries all ten
655
+ ordered dimensions, including dimensions absent from its source so an invented
656
+ target-only claim is still in scope. The runner validates this scope before any
657
+ external review. It exposes the dimensions only to the source-aware fidelity
658
+ pass; the first native-language pass remains source-blind. Missing, additional,
659
+ or reordered dimensions block the case instead of silently narrowing review.
660
+
661
+ After a valid source-fidelity response, the runner removes defect indexes and
662
+ reviewer prose, resolves anonymous A/B labels back to candidate and baseline,
663
+ and writes only `equivalent`, `not_present`, `major`, or `blocking` for each
664
+ ordered dimension into the signed case result. That summary is bound to the
665
+ exact source-fidelity response SHA-256. The final signed report aggregates the
666
+ four status counts separately for every dimension and locale. Any candidate
667
+ `major` or `blocking` status blocks that dimension and the containing lane;
668
+ an overall win rate cannot hide it. Non-commercial cases carry no commercial
669
+ evaluation, and neither cases nor reports expose offer values or reviewer text.
670
+
671
+ The policy also requires `valid_until`, an absolute positive integer Unix
672
+ timestamp chosen by the trusted host for that exact candidate, baseline,
673
+ reviewer, reference, suite, and decision configuration. It is included in the
674
+ policy hash, every signed case result, and the signed final report. Extending
675
+ the date therefore creates a new campaign and cannot relabel old case evidence
676
+ as current. The contract enforces expiry; it does not prove that a host-chosen
677
+ date is appropriate. Hosts must derive it from their lawful baseline update
678
+ process and deliberately shorten it when a provider, model, glossary, quality
679
+ profile, or evaluation policy changes.
680
+
681
+ ### Durable benchmark campaigns
682
+
683
+ `integrations/website_localization_benchmark_campaign.py` turns the bound suite
684
+ and benchmark policy into a durable execution matrix. With the current
685
+ English-source suite and complete EU target scope, one campaign contains
686
+ exactly 1,472 work items: 64 source cases multiplied by 23 target locales. Work
687
+ IDs bind the complete policy hash, suite hash, locale, and case key. Creating
688
+ the same campaign again is idempotent; changing any candidate, reviewer,
689
+ reference, baseline, threshold, locale, or suite field creates a different
690
+ campaign identity instead of inheriting old evidence.
691
+
692
+ The host supplies a dedicated trusted `sqlite3.Connection`, a
693
+ `BenchmarkInputResolver`, the blind reviewer, native-reference verifier,
694
+ evidence authority, and blinding key. The resolver receives one canonical
695
+ localization job and returns `BenchmarkCaseInputs`: the already validated
696
+ candidate result, an attested baseline from an allowed acquisition route,
697
+ locale-bound assets, and an attested qualified-native reference. The campaign
698
+ store never fetches an API, chooses a provider, reads credentials, or invents a
699
+ missing artifact.
700
+
701
+ Production composition should use
702
+ `integrations/website_localization_benchmark_runtime.py`. Its
703
+ `WebsiteLocalizationBenchmarkRuntime` preflights the complete policy, routes,
704
+ adapters, blinding key, worker identity, and five distinct idle SQLite
705
+ connections before creating any schema. Those connections isolate campaign
706
+ status, candidate text, baseline text and evidence, and qualified-native
707
+ reference text and receipts, plus signed anonymous-review evidence, so one
708
+ store cannot silently share transaction or schema state with another.
709
+ Construction creates the exact idempotent campaign;
710
+ `run_once` processes at most one item, while `status`, `health`, `summarize`,
711
+ and `load_report` retain the campaign's existing text-free and
712
+ all-locales-complete contracts.
713
+
714
+ The runtime owns the only `BenchmarkCaseInputs` construction. It resolves
715
+ locale assets, then uses the durable candidate, baseline, and native-reference
716
+ stores under their exact route, policy, and canonical suite-job identities.
717
+ The configured candidate adapter is resolved lazily only when no verified
718
+ candidate is stored. The baseline callback receives the
719
+ job, bound policy, evidence authority, and current operation guard; an official
720
+ API adapter must pass that guard into its transport boundary. The native
721
+ reference callback receives only the canonical job and must return externally
722
+ qualified evidence—it is never asked to generate text. Corrupt or conflicting
723
+ state blocks instead of falling through to another external call.
724
+
725
+ For this trusted resolver, the campaign passes a no-argument token-bound guard
726
+ that renews the current lease. It runs before and after host resolvers, before
727
+ every candidate-model operation, throughout evidence verification, before the
728
+ baseline acquisition boundary, and before the external reference lookup. A
729
+ restart after a reviewer outage therefore reloads the same three verified
730
+ artifacts without invoking the model, baseline API or reference vault again.
731
+ Legacy callable resolvers remain compatible, but they receive only the older
732
+ single guard before dependency resolution and should not be used as the
733
+ production composition root.
734
+
735
+ Adapters may load these zero-dependency modules independently, as happens when
736
+ a host composes the campaign, DeepL baseline adapter, acquisition store, and
737
+ its own resolver without installing a Python package. Public frozen
738
+ `BenchmarkPolicy`, `BenchmarkSignature`, `BenchmarkCaseInputs`, and
739
+ `BaselineAcquisition` values from another module instance are normalized into
740
+ the receiving module only when the dataclass name, frozen status, field order,
741
+ and complete field set match exactly. Every ordinary policy, suite, job,
742
+ signature, evidence, authority, and artifact check then runs unchanged.
743
+ Mappings, mutable objects, extra or missing fields, and similarly named
744
+ lookalikes are not compatibility values and block before persistence or blind
745
+ review. This structural boundary prevents Python class identity from becoming
746
+ an accidental vendor lock while retaining fail-closed validation.
747
+
748
+ `integrations/website_localization_benchmark_review_store.py` closes the
749
+ remaining restart boundary around the two ordered blind reviews. Immediately
750
+ after a response passes the exact phase, locale, blind-ID, preference and
751
+ defect-schema checks, the runtime binds it to the canonical request hash,
752
+ benchmark policy, configured reviewer route and reviewer identity, then signs
753
+ and verifies that artifact before continuing. The source-blind
754
+ `target_native` response is therefore durable before `source_fidelity` begins.
755
+ If the second review or final campaign commit fails, a retry reverifies and
756
+ reuses the first response; after both are stored, neither review is called
757
+ again. The deterministic `review_id` remains the external adapter's
758
+ idempotency key for the unavoidable crash window after the reviewer accepts a
759
+ request but before the local transaction commits.
760
+
761
+ Stored review state is immutable. A repeated review ID with another request
762
+ hash, invalid JSON or digest, a wrong reviewer binding, failed attestation, or
763
+ a second valid but different response blocks without calling the reviewer
764
+ again. Changed routes and policies cannot reuse old evidence. Verifier outages
765
+ remain retryable, while corruption and conflicts are terminal. Operational
766
+ campaign status and final case results still expose only response hashes,
767
+ preferences, defect counts and finding hashes—not reviewer reasons, excerpts,
768
+ source text or either target.
769
+
770
+ For a commercial `source_fidelity` response, persistence additionally requires
771
+ the complete `translate-native.commercial-benchmark-review.v1` acknowledgement.
772
+ It lists all ten dimensions in profile order and records a status for both
773
+ anonymous variants. `major` and `blocking` statuses must reference the matching
774
+ variant's zero-based defect entry; `equivalent` and `not_present` cannot carry a
775
+ defect reference. `uncertain` blocks the case instead of becoming durable PASS
776
+ evidence. The `target_native` response has no commercial acknowledgement and
777
+ therefore remains source-blind.
778
+
779
+ The review store also exposes a strictly read-only, content-free health view
780
+ for one exact reviewer route and benchmark policy. It rechecks canonical rows,
781
+ digests, phases, locale and blind-variant bindings, and every host attestation;
782
+ historical policies are counted separately from the active scope. The caller
783
+ may provide the exact request and response hashes required by completed cases.
784
+ Missing, mismatched, altered, or unverifiable evidence blocks with stable
785
+ reason codes. The health payload contains only counts and never invokes the
786
+ reviewer or returns source, target, explanation, excerpt, or finding text.
787
+
788
+ ### Provider-neutral benchmark reviewer HTTPS adapter
789
+
790
+ `integrations/website_localization_benchmark_reviewer_http.py` implements the
791
+ runtime's `BenchmarkReviewer` contract for an independently hosted human or
792
+ model review gateway. Configure one fixed HTTPS endpoint and a host-owned
793
+ authentication-header callback, then pass the adapter as `reviewer` in the
794
+ existing `benchmark_execution` mapping. The adapter performs exactly one
795
+ request per invocation; the durable campaign and review store remain the only
796
+ owners of retry limits, backoff, leases, and reuse.
797
+
798
+ Each `POST` body uses
799
+ `blun.website-localization-benchmark-review-http-request.v1` and contains the
800
+ exact anonymous `blun.website-localization-benchmark.v7`
801
+ `BenchmarkReviewRequest`, its deterministic `review_id`, and the SHA-256 digest
802
+ of its canonical UTF-8 JSON. Its expected review object uses
803
+ `blun.website-localization-benchmark-review.v2`. The same values are bound in
804
+ `Idempotency-Key`, `X-Benchmark-Review-Id`,
805
+ `X-Benchmark-Review-Phase`, and
806
+ `X-Benchmark-Review-Request-Sha256`. Authentication headers are obtained for
807
+ that attempt only and cannot replace protocol, routing, framing, or binding
808
+ headers. Credentials never enter the body, error state, or durable benchmark
809
+ evidence.
810
+
811
+ The source-blind request is accepted only with the exact `target_native`
812
+ instruction and input field set; `source`, `glossary`, and `protected_terms`
813
+ are forbidden. The later `source_fidelity` request has a different exact field
814
+ set and instruction and carries the source. Commercial fidelity requests also
815
+ carry the ten ordered dimensions and exact acknowledgement schema; other
816
+ content types do not. Both retain only anonymous `A` and `B` variants.
817
+ Candidate provider, baseline identity, acquisition provenance, and unblinding
818
+ data are absent from the transport contract.
819
+
820
+ The service must return
821
+ `blun.website-localization-benchmark-review-http-response.v1` with the same
822
+ `review_id` and request digest plus one exact benchmark-review object. The
823
+ adapter rejects wrong phase, locale or blind ID, unknown fields, malformed
824
+ defects, and a preferred variant that still has a blocking or major defect. For
825
+ commercial fidelity it also rejects missing, additional, reordered, uncertain,
826
+ or improperly defect-linked dimension decisions. The HTTPS adapter and durable
827
+ review store enforce the same conditional contract.
828
+ Responses are strict UTF-8 JSON with duplicate keys, BOMs, non-finite numbers,
829
+ wrong media types, inconsistent lengths, redirects, and oversized bodies
830
+ rejected. Only `408`, `425`, `429`, network failures, and `5xx` responses are
831
+ retryable; orchestration receives stable content-free error codes.
832
+
833
+ Plain HTTP is available only through an explicit loopback-only development
834
+ option. Production TLS termination, authentication, credential rotation,
835
+ access control, request logging policy, and reviewer independence remain host
836
+ responsibilities. This adapter makes the blind review runnable; it does not
837
+ itself establish linguistic quality or superiority over a baseline.
838
+
839
+ `run_next_benchmark_case` claims and processes at most one exact
840
+ case/locale pair. Random token-bound leases are renewed before dependency
841
+ resolution and before each of the two reviewer calls. An abandoned lease can
842
+ be recovered after expiry; stale workers cannot finish it. Retryable adapter
843
+ or attestation failures use bounded exponential backoff and a configured
844
+ attempt ceiling. Terminal binding, parser, suite, policy, and evidence failures
845
+ remain failed while unrelated work continues.
846
+
847
+ Operational status contains only deterministic work identity, counts, stable
848
+ error codes, timestamps, and hashes. The database retains only the attested
849
+ text-free case result after success—not source, candidate, baseline, reference,
850
+ credentials, or reviewer prose. `summarize` remains fail-closed until every
851
+ expected item succeeded. It then signs and verifies the exact result set outside
852
+ the database transaction, rechecks that set atomically, and stores the first
853
+ canonical report in the campaign database. The report is bound to the campaign
854
+ policy and ordered result hashes. Later calls return that same verified report
855
+ byte-for-byte without signing again. A failed, omitted, duplicated, exchanged,
856
+ or policy-stale work item therefore cannot disappear behind a partial aggregate,
857
+ and a crash cannot silently replace the report used for a claim. Existing v1
858
+ and v2 campaign databases migrate transactionally to the v3 report schema.
859
+ Case-result schema v7 and report schema v11 bind the same `valid_until` value.
860
+
861
+ After finalization, `BenchmarkCampaignStore.load_report` is the read-only
862
+ consumer boundary. It opens a consistent snapshot, requires the exact complete
863
+ result matrix and a succeeded report-finalization state, reloads the single
864
+ stored report, then rolls the transaction back before reverifying its policy,
865
+ ordered-result digest, canonical JSON, content hash, timestamp, and signature.
866
+ It never calls the signing capability and never repairs, replaces, or creates
867
+ state. Missing, incomplete, stale, future-dated, state-inconsistent, or altered
868
+ evidence therefore returns a stable failure instead of a report.
869
+
870
+ ### Authenticated benchmark report HTTP reader
871
+
872
+ `integrations/website_localization_benchmark_http.py` exposes that verified
873
+ read-only boundary to an operator dashboard or evidence consumer without
874
+ granting database access. It provides exactly two HTTPS-only WSGI routes:
875
+
876
+ - `GET /v1/benchmarks/status` returns the configured campaign identity,
877
+ policy and suite hashes, validity deadline, work and error counts, plus the
878
+ content-free report-finalization state.
879
+ - `GET /v1/benchmarks/report` first requires the exact campaign to be complete
880
+ and finalized, then invokes only `load_benchmark_report`. Its response binds
881
+ the authenticated campaign ID to the canonical signed report and a SHA-256
882
+ digest of those exact report bytes.
883
+
884
+ The host authenticator receives
885
+ `blun.website-localization-benchmark-http-auth.v1` with the exact method, path,
886
+ sorted request headers, and the empty-body digest. It must return
887
+ `blun.website-localization-benchmark-reader.v1` with `reader_id`,
888
+ `campaign_id`, `credential_id`, and `credential_version`. The application
889
+ requires the principal's campaign to equal the runtime's verified campaign
890
+ status before report loading. Authentication failure, credential rotation,
891
+ cross-campaign access, request bodies, query parameters, plaintext transport,
892
+ incomplete or expired campaigns, malformed runtime output, and report
893
+ verification failures all return only a stable code and retry flag. Responses
894
+ use `Cache-Control: no-store`; neither route starts benchmark work, signs a
895
+ report, repairs state, or returns case prose, source text, target text,
896
+ credentials, or adapter exceptions.
897
+
898
+ `BenchmarkCampaignStore.health` verifies the complete campaign binding, every
899
+ row invariant, successful result hash, and case attestation in a consistent
900
+ read-only snapshot. It reports only status counts, stable reason codes, the
901
+ latest progress timestamp, and whether the persisted final report verifies.
902
+ Health never signs or stores a report. A fully completed campaign without its
903
+ first report is degraded with `benchmark.campaign.report_missing` until an
904
+ explicit `summarize` call creates it; altered or unverifiable report bytes block
905
+ with `benchmark.campaign.report_invalid` and are never regenerated in place.
906
+ The production benchmark runtime performs that explicit finalization directly
907
+ after the last successful case. If the process stopped between committing that
908
+ case and creating the report, the next otherwise idle benchmark tick detects
909
+ the exact complete matrix and closes the gap without resolving another case.
910
+ Both paths guard the signing boundary before and after report construction, so
911
+ loss of the outer supervisor lease prevents persistence and a later tick can
912
+ retry safely. A stored report suppresses all automatic re-signing.
913
+ Expired leases and overdue actionable work degrade health; any terminal work
914
+ failure, altered row, invalid attestation, or invalid final report blocks it.
915
+ Live backoff and recent incomplete work remain healthy and never imply that the
916
+ candidate won.
917
+
918
+ At the first clock value after `valid_until`, the campaign blocks new claims,
919
+ rechecks the boundary before every dependency or reviewer operation, refuses
920
+ case completion and report signing, and rejects stored-report loads with
921
+ `benchmark.campaign.validity_expired`. An expiry discovered during a live case
922
+ or report attempt is recorded as terminal, content-free state; no remaining
923
+ external adapter is called. Health is blocked and `report_ready` is false even
924
+ when every historical score and signature remains otherwise valid.
925
+
926
+ Early locale lanes may be run and reported independently, but passing them no
927
+ longer authorizes an EU-wide superiority statement. The attested report exposes
928
+ `configured_lanes_status` separately from `superiority_claim_allowed` and
929
+ includes an exact `claim_scope` with required, evaluated, missing, unexpected,
930
+ and source-language locales plus the required and evaluated content types. A
931
+ public claim is allowed only when the configured locale set exactly covers
932
+ every EU target eligible for the bound source suite, all eight content types
933
+ are configured, and every locale report passes on its own. One missing locale,
934
+ missing content-type lane, or blocked result therefore blocks the overall
935
+ report; no aggregate can conceal it.
936
+
937
+ Each locale report also exposes separate statistics for `target_native` and
938
+ `source_fidelity`: candidate wins, baseline wins, ties, decisive rate, candidate
939
+ win rate, and the one-sided sign-test probability. Both axes must independently
940
+ meet the policy's predeclared sample, decisiveness, win-rate, and significance
941
+ thresholds. Those thresholds and fixed block reasons are included in the
942
+ attested report. Joint case winners remain an additional conservative metric,
943
+ but discarded cross-axis disagreements can no longer make a weak axis appear
944
+ statistically convincing.
945
+
946
+ Suite v4 predeclares all eight content types as required statistical lanes with
947
+ a minimum of eight cases per type and locale. For every lane, the report repeats
948
+ the joint and independent `target_native` and `source_fidelity` statistics. A
949
+ weak headline, CTA, marketing, UI, documentation, SEO, legal, or price/offer
950
+ lane blocks its locale even when wins from the other content types make the
951
+ all-content aggregate appear significant. A policy may deliberately evaluate a
952
+ smaller diagnostic subset, but its signed claim scope records every omitted
953
+ content type and cannot authorize a public superiority claim.
954
+
955
+ The current suite source language is English, so its EU localization target
956
+ scope contains the other 23 official-language locale profiles. `en-IE` is
957
+ recorded explicitly as the source-language locale and is not sent through a
958
+ same-language translation job, matching the planner's source-exclusion rule.
959
+ This report does not claim that English localization from a non-English source
960
+ was evaluated. A future suite revision with a different source-language design
961
+ must change the bound suite digest and will derive a new exact claim scope.
962
+
963
+ Each case compares one fully validated worker result with one bound baseline
964
+ artifact. A host-held blinding key assigns them reproducibly to anonymous `A`
965
+ and `B` positions. Neither reviewer request contains candidate-provider or
966
+ baseline identity. The first review receives only the two targets, the exact
967
+ locale profile, audience, tone, target terminology, and content type. The
968
+ second review receives the complete source and glossary for a separate
969
+ fidelity judgment. Both must prefer the same variant; a preferred variant with
970
+ any blocking or major defect is an invalid review. The local structure guard
971
+ independently checks both variants. Raw texts and reviewer prose are absent
972
+ from stored case results; only hashes, counts, blinded commitments, and
973
+ unblinded preferences remain.
974
+
975
+ The policy also names the exact candidate provider, model and model version,
976
+ software version, glossary version, localization-policy version, and worker
977
+ schema. The harness rejects a job that differs from any of these values before
978
+ calling a reviewer. Stored case results repeat this candidate binding and the
979
+ exact locale-quality-profile version and hash. During aggregation, the harness
980
+ rebuilds the canonical suite job and requires its deterministic job ID, so a
981
+ result from another model, policy, source case, or locale cannot be relabelled.
982
+ The final report records the same candidate binding and all required locale
983
+ profile bindings. These fields never enter either blinded reviewer request.
984
+
985
+ Benchmark results are durable evidence only when a host-owned
986
+ `BenchmarkEvidenceAuthority` attests them. The harness passes canonical UTF-8
987
+ bytes to that provider-neutral interface and never reads a signing key. The
988
+ policy fixes the expected algorithm and key identifier. After both blind
989
+ reviews, the harness signs and immediately verifies the complete text-free
990
+ case result; missing, rejected, foreign-key, or payload-mismatched attestations
991
+ block before aggregation. `summarize_benchmark` verifies every case first,
992
+ binds the report to the digest of the exact signed case set, and attests the
993
+ complete report. Consumers can call `verify_benchmark_report` with that exact
994
+ case evidence before accepting even a `PASS` claim. Production hosts should
995
+ back the authority with an isolated signer or hardware-backed key and restrict
996
+ it to this benchmark contract; the test-only HMAC authority is not production
997
+ key management.
998
+
999
+ `summarize_benchmark` applies a one-sided exact sign test and minimum case,
1000
+ decisive-rate, and win-rate thresholds separately to every required locale.
1001
+ One candidate blocking/major/integrity defect blocks that locale. Missing,
1002
+ small, tied, mixed-version, substituted-suite, or duplicate samples block the
1003
+ superiority claim, and a strong result in one language can never average away
1004
+ a weak result in another. Maltesisch (`mt-MT`) and Finnisch (`fi-FI`) are the
1005
+ initial mandatory lanes and cannot be removed from policy. A locale passes only after every
1006
+ canonical suite case is present exactly once; the report records observed
1007
+ content types, domains, long-form count, and adversarial tags. The same
1008
+ versioned contract extends to every eligible EU language profile, excluding
1009
+ the source language as required by the localization planner.
1010
+
1011
+ Premortem: reviewers could learn which output came from which system, a large
1012
+ language could hide a weak low-resource language, an arbitrary output could be
1013
+ labelled as an official baseline, or an old baseline could be quietly reused.
1014
+ Attested lawful provenance, keyed A/B assignment, and origin-free review payloads reduce
1015
+ identity bias; per-locale hard gates prevent averaging; exact baseline,
1016
+ reviewer, benchmark, suite, suite case, source, locale, and content bindings
1017
+ plus exact candidate and quality-profile bindings reject stale, substituted,
1018
+ homogeneous, relabelled, unsigned, forged, or mixed evidence. The harness permits
1019
+ a claim only from complete measured blind evidence, never from a model grading
1020
+ its own prose.
1021
+
1022
+ ## Signed translation memory and website readiness
1023
+
1024
+ `integrations/website_localization_release.py` turns a completed queue result
1025
+ into an append-only translation-memory entry only after a host-owned verifier
1026
+ accepts a quality receipt for the complete release context. The module
1027
+ never reads a signing key. Instead, a trusted `ApprovalAuthority` signs and
1028
+ immediately verifies the canonical approval bytes outside the worker's
1029
+ authority. Production hosts should implement that interface with an isolated
1030
+ service or hardware-backed signer; the repository tests use HMAC only as a
1031
+ deterministic test double.
1032
+
1033
+ The receipt-verifier contract receives exactly `binding` and `receipt`.
1034
+ `binding` uses `blun.localization-quality-receipt-binding.v2` and contains the
1035
+ review purpose, job and canonical result hashes, full source and target text
1036
+ plus hashes and locales, content type, glossary and policy versions, primary
1037
+ and optional review-provider identities, software version, two-pass
1038
+ confidence, locale quality profile, optional commercial profile, its exact
1039
+ content-free targeted-review summary, and the human/independent-review
1040
+ requirements. The verifier must cryptographically
1041
+ bind every field. It must reject a receipt issued for another result, policy,
1042
+ model, profile, software version, locale, or review purpose. In particular, a
1043
+ quality receipt cannot satisfy a qualified-human or independent-model review.
1044
+
1045
+ For deployments that keep verification behind a network trust boundary,
1046
+ `integrations/website_localization_receipt_verifier_http.py` provides one
1047
+ fixed-endpoint provider-neutral HTTPS attempt. It validates the complete
1048
+ binding before authentication, derives deterministic request identity from
1049
+ the binding and receipt hashes, disables redirects, strictly checks the bound
1050
+ boolean response, and contains no credential or retry loop. Declared temporary
1051
+ network and service failures retain retryability through the durable evidence
1052
+ queue; an explicit negative verdict or invalid binding remains terminal. The
1053
+ public protocol is documented in
1054
+ [`WEBSITE_LOCALIZATION_RECEIPT_VERIFIER_HTTP.md`](WEBSITE_LOCALIZATION_RECEIPT_VERIFIER_HTTP.md).
1055
+
1056
+ Every approval binds the exact source and target hashes, source and target
1057
+ locales, content type, glossary and policy versions, provider/model identity,
1058
+ worker schema, software version, queue-result hash, quality-receipt hash,
1059
+ the explicit two-phase review confidence, approval lifetime, and signing-key
1060
+ identity. Legal content additionally needs a separately verified qualified-human
1061
+ receipt. For non-legal content, low native or fidelity confidence requires
1062
+ exactly one separately verified qualified-human receipt or an independent
1063
+ second-provider model receipt. Raw receipts are never stored.
1064
+ Approvals for one deterministic job may be reused across different plan
1065
+ compositions, but a changed source, policy, glossary, provider, model, or
1066
+ software version produces a different job and therefore a cache miss. An
1067
+ already approved job can never be overwritten with a different target hash.
1068
+
1069
+ Before any publication adapter receives content, `readiness` revalidates every
1070
+ stored result, approval payload, expiry, and signature for the plan's exact
1071
+ required locale set. `publication_bundle` returns content only when all
1072
+ required locales pass; a missing, expired, altered, or invalid approval blocks
1073
+ the whole website version without deleting an older known-good entry. The
1074
+ release store uses its own trusted host-supplied SQLite connection, separate
1075
+ from the queue connection, and performs no network or publication action.
1076
+
1077
+ Premortem: a receipt or signature might be replayed after policy drift, a database edit
1078
+ might swap the target, or a partial rollout might be mistaken for completion.
1079
+ The deterministic job binding invalidates drift, append-only target hashes and
1080
+ canonical payload signatures expose tampering, and readiness requires exact
1081
+ set equality across all policy-required locales. Tests cover source, policy,
1082
+ model and software invalidation, signature/result corruption, expiry, legal
1083
+ review, partial readiness, and cross-plan translation-memory reuse.
1084
+
1085
+ ## Quality evidence and release coordination
1086
+
1087
+ `integrations/website_localization_release_coordinator.py` joins completed
1088
+ locale jobs, external quality evidence, signed translation memory, and the CMS
1089
+ outbox without embedding a model or reviewer. Each invocation approves at
1090
+ most one completed locale. It creates a CMS delivery only after the release
1091
+ store independently revalidates every locale required by the plan. Pending,
1092
+ retrying, or terminally failed siblings therefore cannot leak a partial
1093
+ website version into the publication outbox.
1094
+
1095
+ The host supplies a `QualityEvidenceProvider` implementing
1096
+ `obtain(QualityEvidenceRequest)`. One request contains exactly one complete
1097
+ source and target, plus their hashes, the CMS event, plan and job identities,
1098
+ source and target locales, content type, glossary and policy versions,
1099
+ provider/model identity, software version, and a host-chosen
1100
+ `evidence_revision`. Its deterministic `request_id` binds all non-text fields
1101
+ and the exact validated queue-result hash. The adapter may call an independent
1102
+ model, a qualified native reviewer, or a host-owned review service; no
1103
+ provider transport or credential is built into the coordinator.
1104
+
1105
+ For deployments that need a concrete network boundary,
1106
+ `integrations/website_localization_evidence_http.py` implements that interface
1107
+ as one request-bound HTTPS attempt. It validates the exact v4 evidence request,
1108
+ canonicalizes native Unicode without ASCII folding, binds the inner digest and
1109
+ deterministic evidence ID in both headers and body, disables redirects, and
1110
+ strictly validates the response envelope before the coordinator verifies its
1111
+ receipts. Authentication remains a host callback and the adapter contains no
1112
+ provider-specific model, endpoint, credential, brand, product, or price. The
1113
+ public protocol and retry classification are documented in
1114
+ [`WEBSITE_LOCALIZATION_EVIDENCE_HTTP.md`](WEBSITE_LOCALIZATION_EVIDENCE_HTTP.md).
1115
+ The adapter never retries internally; the durable evidence state below remains
1116
+ the single retry authority.
1117
+
1118
+ The host must also supply a `QualityEvidenceStateStore` backed by its own
1119
+ trusted SQLite connection and a stable `evidence_worker_id`. Before source or
1120
+ target text reaches the evidence adapter, the store atomically claims the
1121
+ exact request through an owner- and token-bound lease. A second coordinator
1122
+ cannot call the provider while that lease is live. Lease expiry recovers an
1123
+ abandoned attempt after a crash; stale workers cannot finish a newer claim.
1124
+ Retryable failures use bounded exponential backoff and the configured attempt
1125
+ ceiling, while permanent evidence or receipt failures stop immediately.
1126
+
1127
+ The adapter must return exactly this shape:
1128
+
1129
+ ```json
1130
+ {
1131
+ "schema": "blun.localization-quality-evidence-response.v2",
1132
+ "request_id": "blun-l10n-evidence-…",
1133
+ "result_sha256": "…",
1134
+ "quality_receipt": "host-verifiable-purpose-bound-receipt",
1135
+ "human_review_receipt": null,
1136
+ "independent_model_review": null
1137
+ }
1138
+ ```
1139
+
1140
+ The response is rejected if the request object was mutated, a binding differs,
1141
+ the receipt is empty or malformed, or the trusted quality verifier rejects it.
1142
+ The evidence request binds the explicit native and fidelity confidence values.
1143
+ Legal content always requires a non-null human receipt and a separate
1144
+ human-review verifier. For non-legal content with low confidence, the adapter
1145
+ must return exactly one of that qualified-human receipt or an independent model
1146
+ review in this form:
1147
+
1148
+ ```json
1149
+ {
1150
+ "schema": "blun.independent-model-review.v1",
1151
+ "provider": {
1152
+ "id": "independent-provider",
1153
+ "model_id": "configured-review-model",
1154
+ "model_version": "immutable-model-version"
1155
+ },
1156
+ "receipt": "host-verifiable-purpose-bound-receipt"
1157
+ }
1158
+ ```
1159
+
1160
+ The independent reviewer must use a different provider adapter identity from
1161
+ the primary translation provider. The host supplies a separate verifier; its
1162
+ verified receipt hash and exact provider/model identity are included in the
1163
+ signed approval. Missing, ambiguous, same-provider, malformed, or rejected
1164
+ evidence keeps the locale blocked. A receipt is evidence for the existing two
1165
+ ordered reviews—first source-blind native quality, then source-aware
1166
+ fidelity—not permission to collapse them into one score. A major defect still
1167
+ blocks the worker result entirely; it cannot be outweighed or converted into a
1168
+ confidence decision.
1169
+
1170
+ Exact retries are safe: approved locales are reused, the outbox has a stable
1171
+ delivery identity, and a crash after signing an approval but before recording
1172
+ evidence completion is reconciled from that verified approval without another
1173
+ provider call. The deterministic `request_id` remains the adapter's external
1174
+ idempotency key for the narrow crash window after a provider accepts a request
1175
+ but before the local attempt is durably finished. An expired partial approval
1176
+ requires new evidence and a new `evidence_revision`. A pending delivery with
1177
+ expired approvals is blocked; a previously acknowledged delivery remains
1178
+ immutable terminal history.
1179
+
1180
+ `statuses(event_id)` exposes the evidence state, attempt count, retry time,
1181
+ lease expiry, and stable last-error code for monitoring. It stores and returns
1182
+ no source text, target text, receipt, provider prose, or credential.
1183
+ Coordinator outcomes and exceptions follow the same content-free rule.
1184
+
1185
+ Premortem: two schedulers could request the same review, stale evidence could
1186
+ approve changed output, or the last successful locale could trigger a partial
1187
+ publication. Transactional leases prevent concurrent provider calls;
1188
+ deterministic evidence IDs cover the remaining external crash window; exact
1189
+ result and policy bindings reject stale evidence; the HTTP envelope makes the
1190
+ external idempotency and digest contract explicit; signed release readiness and
1191
+ the all-locale CMS transaction block partial publication. Tests cover
1192
+ exclusive claims, bounded retries, one-attempt HTTP failures, one-locale
1193
+ progression, replay, crash recovery, expiry, legal review, authentication and
1194
+ endpoint safety, Unicode transport, parsing, tampering, wrong bindings, and
1195
+ failed receipt verification.
1196
+ They prove the orchestration boundary, not native linguistic quality or
1197
+ superiority over an external translation service.
1198
+
1199
+ ## CMS change and publication contract
1200
+
1201
+ `integrations/website_localization_cms.py` connects the pipeline to a CMS
1202
+ without choosing a vendor or network library. The host supplies three isolated
1203
+ capabilities: an inbound signature verifier, an outbound signing authority,
1204
+ and a publisher implementing `publish(CMSPublicationRequest)`. The bridge does
1205
+ not read keys, choose credentials, or update live CMS state by itself. A host
1206
+ can inject its own publisher or use the included provider-neutral HTTPS
1207
+ publisher described below.
1208
+
1209
+ An inbound `blun.cms-content-change.v2` event has exactly these fields:
1210
+
1211
+ ```json
1212
+ {
1213
+ "schema": "blun.cms-content-change.v2",
1214
+ "event_id": "cms-event-184",
1215
+ "site_id": "blun-marketing",
1216
+ "website_version": "website-2026-08-29.1",
1217
+ "source_sequence": 184,
1218
+ "localization": {
1219
+ "source_id": "homepage.hero",
1220
+ "source_revision": "cms-184",
1221
+ "source_text": "Build your business with BLUN.",
1222
+ "source_locale": "en-IE",
1223
+ "content_type": "headline",
1224
+ "glossary_version": "blun-glossary-3",
1225
+ "policy_version": "native-web-1",
1226
+ "provider_id": "customer-llm",
1227
+ "model_id": "king",
1228
+ "model_version": "2026-08-29",
1229
+ "software_version": "6.43.0-dev",
1230
+ "target_locales": ["de-AT", "sv-SE"]
1231
+ }
1232
+ }
1233
+ ```
1234
+
1235
+ Before publication starts, the CMS may withdraw that exact event with a signed
1236
+ `blun.cms-content-cancellation.v1` message. Its immutable binding contains a
1237
+ unique cancellation ID plus the event, site, website version, source ID, and
1238
+ source sequence. The signer key must match the credential that created the
1239
+ event. Exact replay is idempotent; altered bindings, another accepted tenant
1240
+ key, corrupt stored bytes, and cancellation-ID reuse fail closed. An accepted
1241
+ cancellation removes the event from service scheduling, blocks release and
1242
+ delivery preparation, and closes a pending or retrying outbox entry without
1243
+ calling the model, reviewer, or publisher. Health and tenant lifecycle reads
1244
+ reverify the cancellation and expose only the stable `cancelled` state.
1245
+
1246
+ Cancellation never rewrites an acknowledged publication. It also refuses a
1247
+ currently leased publication because the external CMS may already have
1248
+ accepted the request. The caller must observe the lease outcome before retrying.
1249
+ Deleting content already published uses an independently signed CMS tombstone;
1250
+ cancellation remains deliberately limited to unpublished work. The tombstone
1251
+ is accepted only for an exactly acknowledged publication and is bound to its
1252
+ delivery ID, payload hash, plan, source generation, website version, and full
1253
+ sorted locale set. A separate durable, signed outbox retries delivery after a
1254
+ crash and accepts only an exact signed `deleted` acknowledgement. It contains
1255
+ no source or target prose and preserves the original publication as immutable
1256
+ audit history.
1257
+
1258
+ Cancellation remains available during the durable intake crash gap, after the
1259
+ signed event and source sequence are stored but before queue insertion has
1260
+ finished. The bridge checks the ledger both before and after queue insertion.
1261
+ Therefore an exact replay cannot revive withdrawn work, and a cancellation that
1262
+ races insertion prevents the event from becoming production-eligible. Tenant
1263
+ status, lifecycle, and health expose this intentionally queue-free state as
1264
+ `cancelled` instead of misreporting it as an intake outage; no provider health
1265
+ probe is made for that event.
1266
+
1267
+ The CMS signs the canonical UTF-8 JSON bytes outside the envelope. The bridge
1268
+ verifies the signature before its first write, derives the deterministic plan,
1269
+ and persists the event before enqueuing it. If the process stops between those
1270
+ two transactions, the service supervisor reloads and verifies the stored event,
1271
+ then resumes exactly one intake per tick with the same attempt ceiling as the
1272
+ public API. An exact CMS replay remains safe but is no longer required for
1273
+ progress. Deterministic plan and job identities make concurrent replay and
1274
+ automatic recovery idempotent, while the cancellation ledger is checked again
1275
+ before and after queue insertion and therefore cannot be revived.
1276
+ The same `event_id` with different canonical bytes is an idempotency collision
1277
+ and cannot add work.
1278
+
1279
+ For each `(site_id, source_id)`, the CMS supplies a positive, monotonic
1280
+ `source_sequence` inside the signed event. Once a newer event has reached
1281
+ `enqueued`, every older, not-yet-
1282
+ published generation of that source is marked superseded. Exact replay keeps
1283
+ its signed sequence and therefore cannot displace a newer event; a delayed,
1284
+ out-of-order webhook with a lower sequence is superseded immediately. Reusing
1285
+ one sequence for a different event is an idempotency collision. A
1286
+ superseded event cannot create a release; any pending, retrying, or leased
1287
+ outbox entry becomes terminal with the content-free `event_superseded` reason.
1288
+ The service passes only current plan IDs into the queue claim, so a locale job
1289
+ referenced exclusively by superseded plans is never sent to a model. A
1290
+ content-identical job still remains eligible when any current plan references
1291
+ it.
1292
+
1293
+ New events must use the v2 contract. During the transactional database-v1
1294
+ migration, already stored v1 events receive deterministic legacy generations;
1295
+ afterward only an exact, signed replay of such a stored event is accepted so a
1296
+ crash between persistence and queue insertion can still resume. A new v1 event
1297
+ is rejected rather than entering an ordering domain without a signed sequence.
1298
+ Independent sites and source IDs remain independent, and an already accepted
1299
+ publication remains immutable history. Schema-v1 databases migrate these
1300
+ generations and supersessions transactionally before normal operation resumes.
1301
+
1302
+ After every required locale has a valid signed approval, `prepare_delivery`
1303
+ creates one `blun.cms-localization-publication.v3` payload for the complete
1304
+ locale set. It includes the site and website version, source identity, signed
1305
+ source sequence and hash,
1306
+ and, for each locale, the exact target text and hash, approval ID, expiry, and
1307
+ a `blun.website-localization-release-evidence.v1` object. That content-free
1308
+ object binds the signed approval and worker-result hashes, quality-receipt
1309
+ hash, and either a null commercial scope or the exact commercial-profile ID
1310
+ and validated review summary. It contains no source text, target text, amount,
1311
+ currency, tax wording, brand, or reviewer explanation. A CMS can therefore
1312
+ pin the advertised profile and reject missing, malformed, or drifted evidence
1313
+ before replacing its current content, without treating a cross-language regex
1314
+ as semantic proof.
1315
+ Its deterministic `delivery_id` is an idempotency key over those immutable
1316
+ bytes. The host-owned publication authority signs and immediately verifies the
1317
+ payload before the durable outbox accepts it. A partial, changed, expired, or
1318
+ invalid approval creates no publication entry.
1319
+
1320
+ Outbox workers claim a delivery through an owner- and token-bound lease. The
1321
+ publisher must return exactly:
1322
+
1323
+ ```json
1324
+ {
1325
+ "schema": "blun.cms-localization-publication-ack.v1",
1326
+ "delivery_id": "blun-cms-delivery-…",
1327
+ "payload_sha256": "…",
1328
+ "status": "accepted"
1329
+ }
1330
+ ```
1331
+
1332
+ `integrations/website_localization_cms_http.py` is the concrete HTTP publisher
1333
+ for this contract. Its endpoint is trusted deployment configuration and must
1334
+ not be derived from an inbound event. It requires HTTPS; plain HTTP is
1335
+ available only through an explicit loopback-only development option. The
1336
+ adapter disables redirects, obtains authentication headers from a callback for
1337
+ each attempt, prevents that callback from replacing protocol headers, sends
1338
+ `Accept-Encoding: identity`, and bounds both timeout and response size. URL
1339
+ credentials, query-string secrets, control characters and ambiguous duplicate
1340
+ critical headers are rejected before acceptance.
1341
+
1342
+ The request body contains the exact signed publication rather than another
1343
+ translation format:
1344
+
1345
+ ```json
1346
+ {
1347
+ "schema": "blun.cms-localization-publication-http.v1",
1348
+ "payload_sha256": "…",
1349
+ "publication": { "schema": "blun.cms-localization-publication.v3" },
1350
+ "signature": {
1351
+ "algorithm": "ed25519",
1352
+ "key_id": "publisher-2026-09",
1353
+ "signature": "…"
1354
+ }
1355
+ }
1356
+ ```
1357
+
1358
+ The complete publication object remains nested in `publication`. The adapter
1359
+ also sends the immutable `delivery_id` as `Idempotency-Key` and repeats the
1360
+ delivery ID and payload hash in reserved binding headers. The CMS must verify
1361
+ the publication signature and hash before its atomic source-revision write.
1362
+
1363
+ HTTP success alone is insufficient. Status 200 must contain a strictly parsed,
1364
+ UTF-8 JSON envelope with the exact acknowledgement above and a CMS signature
1365
+ over its canonical bytes:
1366
+
1367
+ ```json
1368
+ {
1369
+ "schema": "blun.cms-localization-publication-http-ack.v1",
1370
+ "acknowledgement": {
1371
+ "schema": "blun.cms-localization-publication-ack.v1",
1372
+ "delivery_id": "blun-cms-delivery-…",
1373
+ "payload_sha256": "…",
1374
+ "status": "accepted"
1375
+ },
1376
+ "signature": {
1377
+ "algorithm": "ed25519",
1378
+ "key_id": "cms-2026-09",
1379
+ "signature": "…"
1380
+ }
1381
+ }
1382
+ ```
1383
+
1384
+ The acknowledgement verifier is independent from the publication signer.
1385
+ Redirects and other 3xx responses are terminal. HTTP 408, 425, 429 and 5xx
1386
+ responses, network failures and malformed response transport are retryable
1387
+ under the existing bounded outbox policy; other non-200 statuses, wrong
1388
+ bindings and invalid signatures are terminal. No response body, credential or
1389
+ exception detail enters the durable status record.
1390
+
1391
+ `integrations/website_localization_cms_receiver.py` is the provider-neutral
1392
+ reference receiver for the publication, tombstone, and health sides of this
1393
+ contract.
1394
+ Before invoking host code, it strictly parses canonical UTF-8 JSON, verifies
1395
+ framing and all three protocol headers, recomputes the payload and delivery
1396
+ hashes, and verifies the publisher signature. For a publication, it also
1397
+ validates every locale's approval expiry and release evidence and compares the
1398
+ signed payload with a host-supplied
1399
+ `PublicationExpectation`. That expectation binds the exact current event,
1400
+ site, website version, plan, source identity, source generation and hash,
1401
+ complete sorted required-locale set, content type, and commercial profile.
1402
+ A correctly signed but partial, stale, or differently scoped publication is
1403
+ therefore rejected before any CMS write.
1404
+
1405
+ The host supplies one commit callback. It must atomically and idempotently bind
1406
+ the stable `(delivery_id, payload_sha256)` pair to the expected source revision,
1407
+ write the complete locale bundle, and return that exact binding with status
1408
+ `committed`. The receiver signs `accepted` only after this receipt. A missing,
1409
+ different, or private-error receipt returns a stable retryable failure; a retry
1410
+ may invoke the callback again with the same immutable binding. This module does
1411
+ not provide the CMS transaction or authentication boundary, and its verified
1412
+ payload still contains target prose, so the host must keep it out of logs and
1413
+ public status.
1414
+
1415
+ For deletion, a `TombstoneExpectation` binds the tombstone to the exact current
1416
+ event, site, website version, plan, source generation, complete sorted locale
1417
+ set, and the delivery ID and payload hash of the previously acknowledged
1418
+ publication. The host's delete callback must remove that complete binding
1419
+ atomically and idempotently, then return the exact tombstone delivery ID and
1420
+ payload hash with status `deleted`. The receiver signs the CMS `deleted`
1421
+ acknowledgement only afterward. A valid signature over a stale publication,
1422
+ different locale set, or different source generation never reaches host code.
1423
+
1424
+ For publisher health, the same receiver accepts only the canonical content-free
1425
+ probe and the three advertised probe-binding headers. Because this request does
1426
+ not contain the signed publication object, the host must provide a dedicated
1427
+ authentication callback; its exception becomes a stable retryable error and a
1428
+ negative result becomes an unauthorized response. Parsing and header binding
1429
+ finish before authentication, while the expected callback-contract digest and
1430
+ host health are checked only after authentication. The host health callback
1431
+ must return the exact probe ID and contract digest with status `healthy`; only
1432
+ then does the receiver sign the protocol acknowledgement. A repeated request
1433
+ reaches the host with the same immutable binding, while the sender's fresh probe
1434
+ ID prevents an acknowledgement for an older challenge from satisfying a newer
1435
+ one. The receiver never adds site, locale, publication, customer, or diagnostic
1436
+ content to this path.
1437
+
1438
+ For deployment, `CMSReceiverApplication` composes all three callbacks into one
1439
+ HTTPS-only WSGI boundary at `/v1/localization/callback` by default. This is one
1440
+ endpoint because the built-in publisher uses the same configured URL for
1441
+ publication, tombstone, and health. Before host code runs, the application
1442
+ requires an exact query-free `POST`, bounded explicit framing, canonical UTF-8
1443
+ JSON, and host authentication. It dispatches only the three exact outer
1444
+ schemas. Publication and tombstone expectation resolvers receive only fully
1445
+ signature-verified messages, then the existing current-source and complete-set
1446
+ checks run before commit or deletion. All transport, authentication, resolver,
1447
+ and private callback failures become a small
1448
+ `blun.cms-localization-receiver-error.v1` response containing no website or
1449
+ diagnostic prose. The application does not terminate TLS or configure a proxy;
1450
+ the WSGI host must derive `wsgi.url_scheme` only from its trusted ingress and
1451
+ must redact authorization headers and verified target text from logs.
1452
+
1453
+ Deployments without an existing atomic CMS transaction can use
1454
+ `integrations/website_localization_cms_receiver_store.py` as the durable
1455
+ reference host behind that WSGI application. Give `DurableCMSReceiverStore` a
1456
+ dedicated host-owned SQLite connection. The trusted CMS first calls
1457
+ `register_source` with its exact current source expectation, then wires the
1458
+ store's publication resolver, commit, tombstone resolver, delete, and health
1459
+ methods directly into `CMSReceiverApplication`. Resolver results are exact
1460
+ field mappings accepted by the same receiver validation as the public
1461
+ dataclasses.
1462
+
1463
+ Publication commit repeats the complete source, locale, content-type, and
1464
+ commercial-profile comparison inside one `BEGIN IMMEDIATE` transaction. A
1465
+ newer registered source leaves the previous active bundle readable as the
1466
+ last-known-good value until the full replacement commits. Exact retries return
1467
+ the same receipt; reused generations, IDs, or hashes block. Once the new bundle
1468
+ is fully stored and selected, that same transaction removes the predecessor's
1469
+ target prose and release evidence and retains only its content-free replay
1470
+ binding. SQLite secure deletion is mandatory for these removals. A cleanup
1471
+ failure rolls back the replacement, so the previous bundle remains active.
1472
+ Backups and filesystem-level retention remain the host's responsibility. For
1473
+ deletion, the trusted host must separately call `register_tombstone` with the exact active
1474
+ publication ID, payload hash, generation, and locale set. A successful delete
1475
+ atomically clears the active pointer, removes localized prose, and retains only
1476
+ content-free publication and tombstone bindings for replay detection. Startup
1477
+ and health verify the schema, SQLite integrity, active pointers, canonical
1478
+ payload and expectation hashes, every locale row, and tombstone state. This
1479
+ reference store is not a substitute for an existing CMS authorization model:
1480
+ source and tombstone registration remain trusted host operations and its
1481
+ content-reading method
1482
+ requires the complete trusted publication expectation for the exact page
1483
+ generation and must never be exposed as a public status route. Looking up
1484
+ localized prose by site and source ID alone is intentionally unsupported. Use
1485
+ one store instance per
1486
+ SQLite connection and WSGI worker; distinct workers may use distinct
1487
+ connections to the same database and coordinate through the write transaction.
1488
+
1489
+ For the complete reference deployment, use
1490
+ `integrations/website_localization_cms_receiver_runtime.py` instead of wiring
1491
+ those callbacks individually. `open_durable_cms_receiver` validates both
1492
+ message authorities, their separation, authentication, callback-contract hash,
1493
+ clock, path, and HTTPS policy before opening SQLite or creating a table. It then
1494
+ returns one worker-owned object that exposes the WSGI callable plus the three
1495
+ trusted CMS operations: source registration, tombstone registration, and
1496
+ generation-bound last-known-good rendering. The rendering call returns target
1497
+ text only when the caller's complete source, plan, website version, locale,
1498
+ content-type, and commercial-profile expectation matches the active signed
1499
+ bundle. This keeps an explicitly requested old website version available while
1500
+ its replacement is pending without allowing a new generation to consume stale
1501
+ prose. Initialization closes its connection on every store
1502
+ or application failure, and `close` is idempotent. Every resolver, transaction,
1503
+ health check, trusted registration, and rendering read uses the same reentrant
1504
+ worker lock. A multithreaded WSGI worker may therefore share this composed
1505
+ runtime without concurrent use of its SQLite connection; failures release the
1506
+ lock before later work. Construct the runtime after each worker process starts
1507
+ and never before a process fork. The runtime records its creator process and
1508
+ blocks every inherited store operation before attempting to acquire a possibly
1509
+ orphaned thread lock. Separate worker processes still require
1510
+ separate runtime instances and SQLite connections. The database URI form is
1511
+ intentionally rejected so connection flags cannot be smuggled through
1512
+ deployment configuration. Filesystem-backed stores additionally require a
1513
+ canonical absolute POSIX path in a real, service-owned directory. Every path
1514
+ ancestor must be root- or service-owned and not shared-writable, except for a
1515
+ root-owned sticky world-writable ancestor such as `/tmp`. A new database is
1516
+ reserved atomically with mode `0600`; an existing database must be a
1517
+ single-link regular file owned by
1518
+ the service account with that exact mode. The runtime rechecks the directory,
1519
+ file identity, ownership, link count, and permissions before every store
1520
+ operation. A symlink, hard link, path replacement, permission drift, or shared
1521
+ writable directory therefore blocks both callbacks and trusted rendering
1522
+ instead of redirecting approved target text. `:memory:` remains available for
1523
+ ephemeral tests only.
1524
+
1525
+ The same adapter transports a tombstone without changing its security model.
1526
+ It uses `blun.cms-localization-tombstone-http.v1`, nests the exact signed
1527
+ object under `tombstone`, and accepts only a signed
1528
+ `blun.cms-localization-tombstone-http-ack.v1` envelope whose acknowledgement
1529
+ is exactly bound to the delivery ID and payload hash and has status `deleted`.
1530
+ The locale list is sorted and unique, while source and target prose are absent.
1531
+
1532
+ The adapter also exposes an optional, content-free `check` operation for
1533
+ operator health. Each call creates a fresh probe ID and sends only that ID plus
1534
+ the SHA-256 digest of the advertised publication HTTP contract. The same
1535
+ authentication, HTTPS-only endpoint, redirect prohibition, transport bounds,
1536
+ and strict JSON parser apply. The CMS must return status `healthy` in a signed
1537
+ `blun.cms-localization-publication-health-ack.v1` acknowledgement bound to the
1538
+ exact probe ID and contract digest. Replayed challenges, a receiver implementing
1539
+ a different contract, or an invalid signature therefore cannot make readiness
1540
+ green. No source text, target text, locale, site, publication, or tombstone is
1541
+ included in this request.
1542
+
1543
+ Wrong or malformed acknowledgements retry with bounded exponential backoff;
1544
+ explicit permanent rejections become terminal. Crashed leases are recovered,
1545
+ but stale workers cannot acknowledge a later attempt. Free-form transport
1546
+ details are stored only as SHA-256 hashes. Delivery is at least once, so a CMS
1547
+ adapter must make the stable `delivery_id` idempotent: acceptance followed by a
1548
+ crash may send the exact same signed payload again. A failed new website
1549
+ version never deletes or overwrites an older successful delivery.
1550
+
1551
+ There is an unavoidable boundary after a publisher begins an external request:
1552
+ local code cannot retract bytes already received by a CMS. The receiving CMS
1553
+ must therefore compare `(site_id, source_id, source_sequence, source_revision,
1554
+ source_sha256)` atomically with its current source revision and reject a stale
1555
+ payload even if its signature is otherwise valid. It must acknowledge
1556
+ `accepted` only after
1557
+ that conditional write succeeds. This complements the local generation gate
1558
+ and closes the lease-to-network race without requiring a vendor-specific API.
1559
+
1560
+ Premortem: an attacker could reuse an event ID with changed content, a partial
1561
+ locale set could reach the CMS, an acknowledgement could name another payload,
1562
+ an older event could finish after a newer source revision, or a worker could
1563
+ wake after its lease or approval expired. Canonical inbound
1564
+ signatures and collision checks block changed events; the release gate creates
1565
+ only complete bundles; monotonic source generations and the receiver-side
1566
+ revision comparison block stale publication; exact signed payload hashes bind
1567
+ acknowledgements; and both leases and approval expiries are rechecked
1568
+ immediately before delivery. Regression tests cover replay, collision,
1569
+ supersession, migration, partial readiness, tampering, exact acknowledgements,
1570
+ bounded retries, opaque failures, and crash recovery.
1571
+
1572
+ ### Authenticated CMS webhook API
1573
+
1574
+ `integrations/website_localization_api.py` exposes the current signed CMS
1575
+ change, cancellation, tombstone, status, lifecycle, and capability contracts
1576
+ through six strict HTTPS-only WSGI routes. The composed runtime publishes the
1577
+ same callable as `runtime.cms_api`; no second bridge, queue, or database is
1578
+ constructed.
1579
+
1580
+ `integrations/website_localization_cms_client.py` is the matching source-side
1581
+ reference client for CMS and website backends. One fixed HTTPS origin and one
1582
+ host-owned signing authority cover all six operations. The client canonicalizes
1583
+ and copies native-Unicode requests before signing, performs exactly one network
1584
+ attempt, never follows redirects, and leaves retries to the caller's durable
1585
+ policy. Status and lifecycle replies must match their request ID, event, and
1586
+ site; mutation replies must match their immutable event identities. Capability
1587
+ and API-contract hashes plus the six exact ordered route definitions are
1588
+ revalidated before use. Failures expose only stable codes and retryability.
1589
+
1590
+ `integrations/website_localization_cms_dispatch.py` adds the durable sending
1591
+ root for changed content. A host first enqueues one complete immutable change
1592
+ event in its SQLite outbox, then lets workers run one leased dispatch at a
1593
+ time. Canonical event bytes and their hash survive restart; exact re-enqueue is
1594
+ idempotent and changed content under the same event ID is rejected. A worker
1595
+ performs one client call per attempt. Retryable failures enter bounded capped
1596
+ backoff, permanent failures become terminal, and an expired crash lease replays
1597
+ the exact event. This gives remote event idempotency enough information to
1598
+ converge even when acceptance succeeded but the local completion commit did
1599
+ not. Status and health expose no source text or transport detail. Each process
1600
+ must open its own SQLite connection; the transactional lease coordinates those
1601
+ connections.
1602
+
1603
+ `integrations/website_localization_cms_removal_dispatch.py` provides the
1604
+ matching durable removal root. One outbox accepts both exact source-side
1605
+ objects without merging their semantics: `cancellation` stops an unpublished
1606
+ localization, while `tombstone` requests deletion only after publication. The
1607
+ composite primary identity is the operation plus its cancellation or tombstone
1608
+ ID; the original event and source-generation bindings remain inside immutable
1609
+ canonical bytes. Workers call only `cancel` or `request_tombstone` for the
1610
+ claimed operation. Remote acceptance followed by a local crash therefore
1611
+ replays the same request instead of inventing a second deletion. Leases,
1612
+ bounded backoff, attempt ceilings, collision rejection, content-free status,
1613
+ and fail-closed integrity checks match the change outbox.
1614
+
1615
+ `integrations/website_localization_cms_lifecycle_monitor.py` then provides the
1616
+ durable source-side completion loop. It accepts only the exact successful
1617
+ change-dispatch record, binds it to the canonical change hash and full remote
1618
+ generation, and polls the signed lifecycle endpoint until a verified terminal
1619
+ state. Every attempt obtains a fresh request identity from the secure client;
1620
+ only the poll lease—not a short-lived signed read—is replayed after a crash.
1621
+ Separate SQLite connections converge through transactional leases. Normal
1622
+ processing uses a fixed interval, transient failures use capped backoff with a
1623
+ consecutive-failure ceiling, and any response for another event, site, plan,
1624
+ version, sequence, or locale count becomes terminally blocked. Status and
1625
+ health retain only content-free identifiers, locale state, counts, stable error
1626
+ codes, and hashes; no website text or transport detail is persisted.
1627
+
1628
+ `POST /v2/localization/changes` accepts only a complete signed
1629
+ `blun.cms-content-change.v2` event. Successful intake durably enqueues one exact
1630
+ job per locale before returning. Exact replay is idempotent; changed event IDs,
1631
+ reused source sequences, new schema-v1 events, and delayed superseded changes
1632
+ cannot become current work. `POST /v2/localization/status` accepts a separate
1633
+ short-lived signed request and returns only identifiers, counts, lease/retry
1634
+ state, stable errors, and hashes. The signed site and original event credential
1635
+ must match, preventing cross-site status access even when a verifier recognizes
1636
+ multiple credentials.
1637
+
1638
+ All routes reject plaintext transport, query strings, transfer encoding,
1639
+ ambiguous or oversized JSON, and invalid framing. Status revalidates the stored
1640
+ event signature, current source generation, exact plan/job/locale identities,
1641
+ and every successful result before returning a complete response. Superseded,
1642
+ missing, altered, or wrong-scope state blocks fail-closed without exposing
1643
+ source text, target text, provider prose, signatures, or credentials. The full
1644
+ public request, response, deployment, and failure contract is documented in
1645
+ [CMS localization webhook API v2](WEBSITE_LOCALIZATION_API.md).
1646
+
1647
+ ## Commercial price and offer profile
1648
+
1649
+ Select `content_type: "commercial"` in the trusted CMS/backend for pricing,
1650
+ offers, subscriptions and their contextual CTAs/conditions. This adds the
1651
+ versioned `translate-native.commercial.v2` profile to the job payload, job ID
1652
+ and plan ID; the existing seven types retain their previous payloads and IDs.
1653
+ It is available for every planner locale, including `mt-MT` and `fi-FI`.
1654
+ The public skill's [commercial guide](../translate-native/references/commercial-localization.md)
1655
+ applies to all languages, with no hardcoded project prices, brands or products.
1656
+
1657
+ The three provider calls stay ordered: transcreation, source-hidden native
1658
+ editing, source-aware fidelity. Commercial fidelity additionally returns
1659
+ `commercial_review` with the profile schema, `coverage` (`complete` or
1660
+ `uncertain`), and `checks` for `amount_currency`, `discount_basis`, `qualifiers`,
1661
+ `tax_status`, `billing_interval`, `commitment`, `renewal`, `cancellation`,
1662
+ `conditions`, and `offer_assignment`. Every check has `status` (`equivalent`,
1663
+ `not_present`, `changed`, `uncertain`) and `items`; each item has `offer`,
1664
+ `relation` (`matched`, `source_only`, or `target_only`), `source_span`,
1665
+ `target_span`, and `explanation`. Spans are zero-based Unicode code-point
1666
+ offsets with an exclusive end. A one-sided item uses `null` only for the side
1667
+ that is absent, so an omitted condition and an invented target claim can be
1668
+ represented without fabricating a counterpart. The exact response contract and
1669
+ dimension guidance are supplied in each fidelity request.
1670
+
1671
+ Equivalent checks require matched evidence; absent dimensions require empty
1672
+ items. A dimension-level changed or uncertain verdict requires at least one
1673
+ specific evidence item, while globally uncertain coverage may remain span-free
1674
+ instead of inventing a location. Changed terms, missing dimensions, invalid
1675
+ relations/spans or a normal PASS without the commercial report block the worker
1676
+ without a publishable result. Uncertain coverage, an uncertain dimension or an
1677
+ all-absent report instead preserve the candidate as a low-confidence fidelity
1678
+ result. That result is fail-closed and
1679
+ requires exactly one independently verified second-provider or qualified-human
1680
+ review before signing; it is neither an automatic retry nor permission to
1681
+ publish. The evidence request and independent verifier both receive the bound
1682
+ commercial profile and policy context. The old known-good translation remains.
1683
+ Do not classify legal text as commercial to bypass the legal human-review gate.
1684
+
1685
+ The full commercial response hash stays in the normal quality-pass receipt;
1686
+ job IDs bind the profile version through queue, signed memory and publication.
1687
+ The content-free result summary uses
1688
+ `translate-native.commercial-review-summary.v1`; the authenticated capability
1689
+ response publishes its exact separately hashed machine contract, including the
1690
+ ordered allowed dimensions and the invariant between status and unresolved
1691
+ dimensions. Quality-evidence request v5 and receipt-binding v2 carry that exact
1692
+ summary, so adapters can reject unknown, reordered or contradictory review
1693
+ scope without reconstructing it from prose.
1694
+ As before, the host must verify an independent quality receipt before signing.
1695
+ Schema validation does not prove that a model's semantic findings are true or
1696
+ complete. The receipt verifier must validate evidence held by the trusted host;
1697
+ the worker retains hashes, not reviewer prose. No new provider is hardwired.
1698
+
1699
+ Premortem: counting digits could reject native number words yet accept swapped
1700
+ tariff prices, while treating uncertainty as an ordinary PASS could bypass the
1701
+ release gate. The profile instead requires per-offer semantic comparison,
1702
+ allows equivalent locale forms, and converts unresolved evidence into a bound
1703
+ low-confidence review route. Keeping source evidence out of the native pass
1704
+ prevents source-shaped copy from receiving an
1705
+ artificial advantage. Version-bound job IDs prevent old policy/cache reuse.
1706
+ Tests exercise the contract across all 24 locale routes, ten defect dimensions,
1707
+ native digit/number-word representations, multiple offers, source blindness,
1708
+ queue terminal failures and the actual worker-to-signed-publication path.
1709
+ Scripted adapters test enforcement, not real native quality or DeepL superiority.
1710
+
1711
+ ## One-transition service loop
1712
+
1713
+ `integrations/website_localization_service.py` composes the queue runner,
1714
+ quality-evidence coordinator, signed release store, and CMS outbox into one
1715
+ host-callable tick. It opens no database, socket, credential, or model by
1716
+ itself. The host injects the provider and asset resolvers, evidence adapter,
1717
+ receipt verifiers, signing authorities, publisher, worker identities, clock,
1718
+ and durable stores.
1719
+
1720
+ Each tick performs at most one externally active pipeline step. A due signed
1721
+ CMS delivery has first priority; otherwise the service advances at most one
1722
+ completed locale through independent evidence and signed approval; otherwise
1723
+ it claims and processes at most one translation job. Active leases and backoff
1724
+ windows remain untouched. An existing delivery that is not yet due and an
1725
+ evidence request waiting for retry do not prevent unrelated queued work from
1726
+ advancing. Successful delivery removes that event from future scheduling.
1727
+
1728
+ The return schema `blun.website-localization-service-tick.v1` contains only the
1729
+ phase, status, stable event/plan/job/delivery IDs, target locale, attempt, and
1730
+ stable error code. It never contains source or target text, reviewer prose,
1731
+ receipts, signatures, provider exceptions, or transport details. A blocked
1732
+ signature, database, queue, evidence, or publication transition cannot fall
1733
+ through to a weaker phase in the same tick.
1734
+
1735
+ The runner accepts the narrow `LocalizationQueue` transition contract rather
1736
+ than a process-local Python class identity. This matters because the public
1737
+ files are independently loadable adapters: a queue created by the CMS bridge
1738
+ can now be passed to the runner without copying state or opening a second
1739
+ database. The host remains trusted and the queue itself still validates every
1740
+ payload, lease, hash, and transition transactionally.
1741
+
1742
+ Premortem: a scheduler could publish before all locales are signed, call a
1743
+ translation provider after an evidence failure, leave a signed intake stranded
1744
+ before queue insertion, starve a ready outbox behind a large queue, leak prose
1745
+ in operational status, or duplicate work after a restart. Tombstone and
1746
+ delivery priority, one verified intake recovery per tick, immediate fail-closed
1747
+ return, content-free outcomes, and reuse of the existing durable leases and
1748
+ idempotency keys address those failures. End-to-end tests count the provider,
1749
+ evidence, and publisher calls across recovery, translation, approval, and
1750
+ delivery ticks; they also cover the API retry ceiling, cancellation exclusion,
1751
+ stored-event tampering, adapter failures, and an idle completed service.
1752
+
1753
+ ## Durable service supervisor
1754
+
1755
+ `integrations/website_localization_supervisor.py` turns the host-configured
1756
+ service tick into a long-running, restartable process without taking ownership
1757
+ of databases, credentials, provider selection, signing keys, or signal
1758
+ handling. The host supplies a dedicated SQLite connection, the configured tick
1759
+ callable, a stable worker ID, and—when running continuously—a stop predicate.
1760
+ The supervisor invokes exactly one service tick at a time and checks for a stop
1761
+ only between those atomic units.
1762
+
1763
+ The supervisor uses one transactional, expiring lease. A second process sees a
1764
+ live lease and performs no work; after a crash, another process may claim only
1765
+ after the exact expiry time. Lease completion is bound to both worker ID and a
1766
+ fresh random token, so an old process cannot overwrite a recovered process's
1767
+ schedule or heartbeat. The service tick's own narrower queue, evidence, and
1768
+ delivery leases remain the final protection for any external operation that
1769
+ outlives the supervisor lease.
1770
+
1771
+ Successful active work receives a short configurable delay, an idle result a
1772
+ longer delay, and `blocked`, `failed`, or `retry_wait` results bounded
1773
+ exponential backoff. Continuous operation caps sleeps by a separate stop-poll
1774
+ interval, allowing prompt graceful shutdown without interrupting a tick.
1775
+ Durable status reports the next tick, live or recoverable lease state,
1776
+ consecutive blocked count, last start/finish time, phase, status, and stable
1777
+ error code. It never returns the lease owner or token, customer content,
1778
+ provider output, exception text, receipts, signatures, or secrets.
1779
+ When attached to `LocalizationHealthMonitor`, a configurable staleness window
1780
+ also marks a long-overdue ready tick as `supervisor.heartbeat_stale`; this
1781
+ prevents an exited process from appearing healthy merely because no lease is
1782
+ currently held.
1783
+
1784
+ Hosts should keep the supervisor connection on durable local storage, use a
1785
+ lease longer than the maximum expected tick duration, install their normal
1786
+ process manager's stop signal into the predicate, and treat
1787
+ `supervisor.tick.unhandled`, altered state, or an expired lease as degraded
1788
+ health requiring operator attention. The library deliberately does not open a
1789
+ socket, daemonize itself, modify an OS scheduler, invent a model, or publish a
1790
+ partial localization.
1791
+
1792
+ Premortem: duplicate supervisors could call providers concurrently, a crash
1793
+ could retain ownership forever, a failing adapter could create a hot loop, a
1794
+ recovered old process could overwrite newer state, or an exception could copy
1795
+ customer prose into operations data. Transactional token-bound expiring
1796
+ leases, bounded delays, stale-completion rejection, structural tick validation,
1797
+ fixed exception codes, and an overdue-heartbeat check close those paths. Tests use two SQLite connections
1798
+ to prove exclusion and crash recovery, then cover backoff caps, graceful stop,
1799
+ state tampering, malformed results, invalid clocks, and prose redaction.
1800
+
1801
+ ## Provider-neutral runtime composition
1802
+
1803
+ `integrations/website_localization_runtime.py` is the composition root for a
1804
+ host that wants to operate the complete service rather than assemble each
1805
+ adapter manually. It creates one canonical queue, signed release store, CMS
1806
+ bridge, durable quality-evidence store, service tick, supervisor, and health
1807
+ monitor. `run_once`, `run_forever`, and `health` all address those same object
1808
+ instances and durable records. This avoids Python class-identity mismatches
1809
+ between independently loadable adapter files while retaining their public
1810
+ structural contracts.
1811
+
1812
+ The host supplies five distinct `sqlite3.Connection` objects: queue, release,
1813
+ CMS, evidence, and supervisor. An optional monitored benchmark campaign adds a
1814
+ sixth connection plus its exact policy, campaign ID, evidence verifier, and
1815
+ staleness threshold. Monitor-only configuration remains supported and performs
1816
+ no benchmark work. Both monitor-only and executing configurations may call
1817
+ `benchmark_campaign_status` and `load_benchmark_report`; they delegate only to
1818
+ the store's content-free status and read-only verified report paths. A runtime
1819
+ without benchmark configuration returns `runtime.benchmark.unavailable`, and
1820
+ unexpected adapter failures are reduced to the content-free
1821
+ `runtime.benchmark.status.invalid` or `runtime.benchmark.report.invalid`
1822
+ boundary code.
1823
+
1824
+ To execute the same campaign, supply the exact `benchmark_execution` mapping.
1825
+ It adds separate `candidate_connection`, `baseline_connection`,
1826
+ `native_reference_connection`, and `review_connection` stores, making ten
1827
+ distinct connections in total. The remaining required fields are
1828
+ `candidate_route_id`, `baseline_route_id`, `native_reference_route_id`,
1829
+ `reviewer_route_id`, `assets_resolver`,
1830
+ `candidate_provider_resolver`, `baseline_acquirer`,
1831
+ `native_reference_loader`, `reviewer`, `native_reference_verifier`,
1832
+ `blinding_key`, `worker_id`, `max_attempts`, `lease_seconds`,
1833
+ `retry_base_seconds`, and `retry_max_seconds`. Extra, missing, malformed, reused,
1834
+ or transaction-active values block before schema construction. The benchmark
1835
+ evidence authority must both sign and verify, and the supervisor lease must
1836
+ strictly exceed the configured benchmark lease.
1837
+ An executing composition also rejects an already expired policy before any of
1838
+ the ten stores creates or migrates a schema. Monitor-only composition may load
1839
+ an expired campaign so health can expose its blocked state, but it cannot load
1840
+ that campaign's report as current evidence.
1841
+
1842
+ The composition root constructs the canonical
1843
+ `WebsiteLocalizationBenchmarkRuntime`; callers cannot replace its durable input
1844
+ assembly with an unrestricted callback. All connections may point to
1845
+ host-chosen durable files but must be distinct because the stores have
1846
+ independent schemas, transactions, and migration rules. The runtime neither
1847
+ opens nor closes them. It also never reads a configuration file, environment
1848
+ variable, credential, signing key, or network endpoint.
1849
+
1850
+ The same composition root binds its approval and publication authorities into
1851
+ the tenant-facing `runtime.cms_api`. It accepts signed change events, exact
1852
+ signed cancellations of unpublished work, and exact signed tombstones for
1853
+ acknowledged publications. Before submitting content, a CMS can use a
1854
+ separately signed read to discover the exact current 24-locale registry,
1855
+ content types, quality phases, schema versions, and locale-profile hashes as
1856
+ one canonical capability object. In addition to durable change intake and
1857
+ per-locale queue progress, the API exposes a purpose-bound lifecycle read that
1858
+ revalidates release readiness and the signed CMS outbox. A tenant can therefore
1859
+ distinguish processing, missing approvals, readiness, publication retry,
1860
+ blocked publication, terminal failure, and acknowledged publication without
1861
+ receiving source text, target text, receipts, signatures, or service-wide site
1862
+ data. Neither read performs a state transition; the complete public contract is
1863
+ in [`WEBSITE_LOCALIZATION_API.md`](WEBSITE_LOCALIZATION_API.md).
1864
+
1865
+ Service-wide HTTP health is disabled unless the host supplies an explicit
1866
+ `health_http_authenticator`. With that capability, the same composition root
1867
+ exposes `runtime.health_http`; optional `health_provider_probe` and
1868
+ `health_publisher_probe` capabilities are bound to that reader and cannot be
1869
+ configured on their own. The publisher probe must be the same object as the
1870
+ runtime's delivery publisher, so a second endpoint cannot mask failure of the
1871
+ real callback. All values are validated
1872
+ before any store creates or migrates a schema. The operator endpoint is distinct
1873
+ from signed tenant CMS progress because its content-free report can contain
1874
+ identifiers for every configured site. Its complete authentication, response,
1875
+ and failure contract is documented in
1876
+ [`WEBSITE_LOCALIZATION_HEALTH_HTTP.md`](WEBSITE_LOCALIZATION_HEALTH_HTTP.md).
1877
+
1878
+ When configured, the existing content-free health report gains a
1879
+ `benchmark_campaign` component. Full `benchmark_execution` configuration also
1880
+ adds `benchmark_reviews`, bound to the same durable review store and reviewer
1881
+ route used by the executor. For every succeeded campaign case, the monitor
1882
+ requires exact stored request and response evidence for both ordered passes
1883
+ and reverifies each artifact. Missing, mismatched, tampered, or unverifiable
1884
+ review evidence blocks the whole health report even when the campaign result
1885
+ itself remains valid. Output is limited to stable reasons and aggregate counts.
1886
+ Its overall status becomes degraded for an expired lease or a stalled
1887
+ actionable campaign and blocked for failed or unverifiable work. The
1888
+ localization service supervisor does not execute benchmark cases for
1889
+ monitor-only configurations. With `benchmark_execution`,
1890
+ each supervised tick still runs the customer publication pipeline first. A
1891
+ delivery, release, evidence, or translation transition returns immediately and
1892
+ the benchmark executor is not called. Only an exact `idle` customer result may
1893
+ advance at most one benchmark case. The same token-bound outer lease guard is
1894
+ passed through the campaign and its durable candidate, baseline, reference,
1895
+ and review operations; losing that lease blocks before the next external
1896
+ boundary. A campaign with no currently actionable case preserves the ordinary
1897
+ idle result. Benchmark success, bounded retry, terminal failure, and stable
1898
+ error code use the existing content-free supervisor tick schema.
1899
+
1900
+ Premortem: a mirrored database could yield inconsistent status, a dead worker
1901
+ could leave a lease that looks active, terminal cases could hide behind overall
1902
+ progress, status could leak reviewer prose, an incomplete campaign could be
1903
+ mistaken for a passed comparison, stored reviews could disappear behind a
1904
+ still-valid case result, or background evaluation could delay a real
1905
+ publication. Ten-store validation, customer-first scheduling, strict lease
1906
+ hierarchy, snapshot verification, lease and staleness reasons, exact
1907
+ cross-store review matching, per-row attestation checks, code-and-count-only
1908
+ output, and a separate `report_ready` flag close those paths.
1909
+
1910
+ The supervisor lease must be strictly longer than every effective translation,
1911
+ quality-evidence, and CMS-delivery lease. The runtime checks this hierarchy
1912
+ before any component creates or migrates a schema. Its default supervisor lease
1913
+ is 360 seconds for the three 300-second operation defaults. Custom values remain
1914
+ valid only when the supervisor continues to outlive the longest operation
1915
+ lease. Immediately before cache or adapter resolution, each model phase,
1916
+ quality-evidence acquisition, and CMS publication, the child path renews the
1917
+ exact token-bound outer lease and fails before the external call if that lease
1918
+ was lost. An expired outer lease cannot finish a tick even when no replacement
1919
+ has claimed it. Together these checks prevent a second service instance from
1920
+ taking the outer lease while the first instance still owns a legitimate inner
1921
+ operation lease. Each external adapter must additionally impose a transport
1922
+ deadline shorter than its operation lease; deterministic request and delivery
1923
+ identifiers still cover an uncertain remote acceptance at that deadline.
1924
+
1925
+ The `dependencies` mapping must contain exactly the configured provider and
1926
+ asset resolvers, evidence provider, quality verifier, inbound event verifier,
1927
+ approval and publication authorities, CMS publisher, three worker IDs, and an
1928
+ evidence revision. Optional values are limited to the documented lease, retry,
1929
+ attempt, approval-expiry, human-review verifier, and independent-model-review
1930
+ verifier settings accepted by the service tick. A host-supplied result cache is
1931
+ rejected before schema creation; the runtime inserts only its own signed local
1932
+ translation-memory adapter. Unknown and missing keys, invalid capabilities, identifiers,
1933
+ retry ranges, duplicate connections, and already-active host transactions
1934
+ block before any store schema is created. The mapping is copied and frozen;
1935
+ runtime status and `repr` never include its objects or values.
1936
+
1937
+ Supervisor policy is supplied as an exact plain mapping rather than a Python
1938
+ class instance, so loading the public supervisor and runtime files under
1939
+ different module names cannot break configuration. The runtime constructs its
1940
+ own canonical policy after validating all six positive, finite timing values.
1941
+ Its health method always reuses the event, approval, and publication verifiers
1942
+ that were validated during composition; a caller can add only the optional
1943
+ provider health probe and check time.
1944
+
1945
+ Premortem: independently loaded modules could reject the same bridge, one
1946
+ SQLite handle could mix incompatible state machines, a missing publisher could
1947
+ be discovered only after a job is claimed, mutable configuration could swap a
1948
+ signer during operation, or diagnostic formatting could reveal a secret.
1949
+ Canonical construction, structural health contracts, pre-mutation validation,
1950
+ five distinct connections, a strict outer-before-inner lease hierarchy, a
1951
+ frozen dependency copy, and a fixed content-free
1952
+ representation close those paths. An end-to-end test sends one signed event
1953
+ through Finnish translation, evidence, approval, publication, supervisor, and
1954
+ health using the single composed runtime; separate tests prove invalid
1955
+ capabilities and connections cause no schema writes.
1956
+
1957
+ ## Read-only health and readiness monitor
1958
+
1959
+ `integrations/website_localization_health.py` gives operators one
1960
+ provider-neutral, content-free view across the queue, signed translation
1961
+ memory, quality-evidence state, CMS events, publication outbox, and configured
1962
+ model endpoints. It accepts the same host-owned event, approval, and
1963
+ publication verifiers as the runtime, optional `ProviderHealthProbe` and
1964
+ `PublisherHealthProbe` capabilities, plus the coordinator's optional
1965
+ `QualityEvidenceStateStore`. A check performs no repair, retry, lease
1966
+ transition, signing action, or content publication. When the publisher probe
1967
+ is configured, it performs exactly one content-free CMS callback challenge.
1968
+
1969
+ `integrations/website_localization_health_http.py` makes that exact report
1970
+ available to a separately authenticated service operator. It authenticates
1971
+ before invoking the monitor, requires HTTPS and an empty query-free request,
1972
+ and validates the complete returned report again before serialization. A valid
1973
+ blocked assessment uses HTTP `503`; malformed monitor output or private
1974
+ exceptions are reduced to stable content-free errors. No endpoint exists when
1975
+ the runtime lacks the explicit operator authenticator.
1976
+
1977
+ The provider probe receives only `provider_id`, `model_id`, and
1978
+ `model_version`—never source text, target text, glossary terms, or reviewer
1979
+ findings—and must return exactly:
1980
+
1981
+ ```json
1982
+ {
1983
+ "schema": "blun.localization-provider-health.v1",
1984
+ "provider": {
1985
+ "id": "customer-llm",
1986
+ "model_id": "king",
1987
+ "model_version": "2026-08-29"
1988
+ },
1989
+ "status": "healthy"
1990
+ }
1991
+ ```
1992
+
1993
+ For every check, the monitor verifies every configured SQLite schema and
1994
+ database, queued payload and result hashes, evidence-to-event/plan/job/result
1995
+ bindings, deterministic evidence request IDs, stored approval bytes and
1996
+ signatures, authenticated CMS events, publication payload hashes and
1997
+ signatures, tombstone request and delivery bindings, live lease times, and
1998
+ approval expiry before pending publication.
1999
+ Missing or malformed provider probes, signature failures, tampering, and
2000
+ unreadable state make the report `blocked`. A configured publisher probe also
2001
+ adds the `cms_publisher` component; an unavailable, malformed, unsigned, or
2002
+ contract-mismatched callback blocks it without exposing transport details.
2003
+ Recoverable operational state such
2004
+ as an expired evidence or worker lease, failed evidence review, failed locale,
2005
+ retrying delivery, or an expired current approval is `degraded`. A live
2006
+ evidence lease and ordinary pending work remain healthy.
2007
+
2008
+ Each website version reports one lifecycle state: `cancelled`, `processing`,
2009
+ `localization_failed`, `awaiting_approval`, `ready`, `publishing`,
2010
+ `publication_failed`, `published`, `deleting`, `deletion_failed`, or `deleted`.
2011
+ The report includes only site, version,
2012
+ plan and event identifiers, counts, locale names, and stable failure codes.
2013
+ Source and target text, exception messages, provider responses, receipts, and
2014
+ transport details are never returned. Stable queue and outbox errors remain
2015
+ actionable, while free-form details stay represented only by their stored
2016
+ hashes. The separate `evidence` component reports pending, leased, retrying,
2017
+ succeeded, and failed counts plus stable reasons such as
2018
+ `evidence.lease_expired` or `evidence.review_failed`.
2019
+
2020
+ For a fully executing benchmark, the separate `benchmark_reviews` component
2021
+ is equally observational. It scopes review rows to the active policy and route,
2022
+ reverifies their immutable attestations, and compares them with the two pass
2023
+ hash pairs referenced by every succeeded case. Historical rows remain visible
2024
+ only as a count and cannot satisfy current requirements. Neither this check nor
2025
+ its error path calls an adapter or returns reviewer prose or content hashes.
2026
+
2027
+ Premortem: a dashboard could report healthy after stored bytes were altered,
2028
+ mutate leases while merely observing them, or leak customer content through a
2029
+ provider exception. The monitor rechecks canonical bytes and isolated
2030
+ signatures, regression-tests that SQLite `total_changes` stays constant, and
2031
+ reduces all external failures to fixed codes. Tests also cover queue and CMS
2032
+ tampering, altered evidence schemas and bindings, live and expired evidence
2033
+ leases, stable evidence failures, expired approvals, missing providers,
2034
+ partial work, retrying acknowledgements, ready bundles, and successful
2035
+ publication.