zorya-classifier 0.1.0 → 0.2.1

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 (311) hide show
  1. package/NOTICE.md +2 -0
  2. package/README.md +37 -9
  3. package/dist/app/cli-arguments.d.ts +40 -0
  4. package/dist/app/cli-arguments.js +67 -0
  5. package/dist/app/create-classifier.d.ts +24 -0
  6. package/dist/app/create-classifier.js +226 -14
  7. package/dist/app/extraction-files.d.ts +9 -0
  8. package/dist/app/extraction-files.js +28 -0
  9. package/dist/cli.js +58 -14
  10. package/dist/entities/boundary-view.d.ts +29 -0
  11. package/dist/entities/boundary-view.js +1 -0
  12. package/dist/entities/contracts.d.ts +81 -1
  13. package/dist/entities/contracts.js +7 -0
  14. package/dist/entities/cutout-raster.d.ts +7 -0
  15. package/dist/entities/cutout-raster.js +1 -0
  16. package/dist/entities/object-proposals.d.ts +56 -0
  17. package/dist/entities/object-proposals.js +8 -0
  18. package/dist/entities/representation.d.ts +225 -0
  19. package/dist/entities/representation.js +33 -0
  20. package/dist/entities/segmentation-metadata.d.ts +11 -0
  21. package/dist/entities/segmentation-metadata.js +1 -0
  22. package/dist/entities/segmentation-verification.d.ts +31 -0
  23. package/dist/entities/segmentation-verification.js +1 -0
  24. package/dist/entities/segmentation.d.ts +164 -0
  25. package/dist/entities/segmentation.js +5 -0
  26. package/dist/entities/whole-object.d.ts +132 -0
  27. package/dist/entities/whole-object.js +7 -0
  28. package/dist/features/choice.d.ts +1 -1
  29. package/dist/features/choice.js +2 -2
  30. package/dist/features/segmentation/box-check.d.ts +10 -0
  31. package/dist/features/segmentation/box-check.js +299 -0
  32. package/dist/features/segmentation/mask.d.ts +6 -0
  33. package/dist/features/segmentation/mask.js +89 -0
  34. package/dist/features/segmentation/packed-mask.d.ts +5 -0
  35. package/dist/features/segmentation/packed-mask.js +53 -0
  36. package/dist/index.d.ts +6 -1
  37. package/dist/infrastructure/boundary-view.d.ts +2 -0
  38. package/dist/infrastructure/boundary-view.js +263 -0
  39. package/dist/infrastructure/openrouter-common.d.ts +8 -8
  40. package/dist/infrastructure/openrouter-vision.d.ts +3 -0
  41. package/dist/infrastructure/openrouter-vision.js +5 -0
  42. package/dist/infrastructure/raster.d.ts +10 -1
  43. package/dist/infrastructure/raster.js +99 -4
  44. package/dist/infrastructure/segmentation/box-presentation.d.ts +2 -0
  45. package/dist/infrastructure/segmentation/box-presentation.js +136 -0
  46. package/dist/infrastructure/segmentation/cutout-raster.d.ts +3 -0
  47. package/dist/infrastructure/segmentation/cutout-raster.js +79 -0
  48. package/dist/infrastructure/segmentation/grabcut/index.d.ts +17 -0
  49. package/dist/infrastructure/segmentation/grabcut/index.js +121 -0
  50. package/dist/infrastructure/segmentation/grabcut/worker-inference.d.ts +47 -0
  51. package/dist/infrastructure/segmentation/grabcut/worker-inference.js +260 -0
  52. package/dist/infrastructure/segmentation/index.d.ts +2 -0
  53. package/dist/infrastructure/segmentation/index.js +2 -0
  54. package/dist/infrastructure/segmentation/mobile-sam/index.d.ts +66 -0
  55. package/dist/infrastructure/segmentation/mobile-sam/index.js +478 -0
  56. package/dist/infrastructure/segmentation/mobile-sam/worker-inference.d.ts +149 -0
  57. package/dist/infrastructure/segmentation/mobile-sam/worker-inference.js +845 -0
  58. package/dist/infrastructure/segmentation/native-child.d.ts +23 -0
  59. package/dist/infrastructure/segmentation/native-child.js +297 -0
  60. package/dist/infrastructure/segmentation/native-protocol.d.ts +923 -0
  61. package/dist/infrastructure/segmentation/native-protocol.js +242 -0
  62. package/dist/infrastructure/segmentation/native-worker.d.ts +1 -0
  63. package/dist/infrastructure/segmentation/native-worker.js +93 -0
  64. package/dist/infrastructure/segmentation/probe-backend.d.ts +1 -0
  65. package/dist/infrastructure/segmentation/probe-backend.js +31 -0
  66. package/dist/infrastructure/segmentation/proposal-presentation.d.ts +3 -0
  67. package/dist/infrastructure/segmentation/proposal-presentation.js +371 -0
  68. package/dist/infrastructure/segmentation/verify-asset.d.ts +4 -0
  69. package/dist/infrastructure/segmentation/verify-asset.js +32 -0
  70. package/dist/infrastructure/text-representation.d.ts +23 -0
  71. package/dist/infrastructure/text-representation.js +226 -0
  72. package/dist/infrastructure/vision-chat.d.ts +1 -1
  73. package/dist/infrastructure/vision-chat.js +13 -4
  74. package/dist/openai-compatible.d.ts +3 -0
  75. package/dist/openai-compatible.js +4 -0
  76. package/dist/openrouter.d.ts +2 -2
  77. package/dist/openrouter.js +1 -1
  78. package/dist/processes/boundary-state.d.ts +12 -0
  79. package/dist/processes/boundary-state.js +196 -0
  80. package/dist/processes/classify.d.ts +2 -1
  81. package/dist/processes/classify.js +21 -3
  82. package/dist/processes/extract-from-region.d.ts +19 -0
  83. package/dist/processes/extract-from-region.js +415 -0
  84. package/dist/processes/extract.d.ts +25 -0
  85. package/dist/processes/extract.js +223 -0
  86. package/dist/processes/locate.d.ts +2 -1
  87. package/dist/processes/locate.js +84 -11
  88. package/dist/processes/proposal-location.d.ts +19 -0
  89. package/dist/processes/proposal-location.js +396 -0
  90. package/dist/processes/whole-object.d.ts +7 -0
  91. package/dist/processes/whole-object.js +272 -0
  92. package/dist/segmentation.d.ts +10 -0
  93. package/dist/segmentation.js +4 -0
  94. package/dist/shared/input-budget.d.ts +7 -0
  95. package/dist/shared/input-budget.js +21 -0
  96. package/docs/0.2.0-plan.md +190 -0
  97. package/docs/README.ru.md +43 -14
  98. package/docs/acceptance.md +116 -3
  99. package/docs/api.md +12 -6
  100. package/docs/architecture.md +22 -7
  101. package/docs/benchmarks.md +10 -0
  102. package/docs/categorical-presence-port.md +26 -0
  103. package/docs/evidence/v02/baseline.json +1043 -0
  104. package/docs/evidence/v02/boundary-variants.md +17 -0
  105. package/docs/evidence/v02/box-confirmation-dev40/README.md +15 -0
  106. package/docs/evidence/v02/box-confirmation-dev40/component-refinement.json +246 -0
  107. package/docs/evidence/v02/box-confirmation-dev40/evaluation.json +1663 -0
  108. package/docs/evidence/v02/box-confirmation-dev40/provenance.json +130 -0
  109. package/docs/evidence/v02/box-confirmation-dev40/report.json +127 -0
  110. package/docs/evidence/v02/box-confirmation-dev40-freeze-20261020-v1.json +230 -0
  111. package/docs/evidence/v02/box-confirmation-method-selection-20261020-v1.json +85 -0
  112. package/docs/evidence/v02/box-heldout-cancelled-before-dispatch-20261021-v1.json +32 -0
  113. package/docs/evidence/v02/box-heldout-combined-seal-20261021-v1.json +89 -0
  114. package/docs/evidence/v02/box-heldout-evaluator-truth-seal-20261021-v1.json +61 -0
  115. package/docs/evidence/v02/box-heldout-exclusion-audit-20261020-v1.json +81 -0
  116. package/docs/evidence/v02/box-heldout-map-seal-20261021-v1.json +48 -0
  117. package/docs/evidence/v02/box-heldout-photo-seal-20261020-v1.json +62 -0
  118. package/docs/evidence/v02/box-heldout-run-freeze-20261021-v1.json +61 -0
  119. package/docs/evidence/v02/box-heldout-source-review-20261020-v1.json +134 -0
  120. package/docs/evidence/v02/box-heldout-ui-seal-20261020-v1.json +44 -0
  121. package/docs/evidence/v02/calculator-proof-root-review-20261020-v1.json +63 -0
  122. package/docs/evidence/v02/categorical-dev40-freeze.json +94 -0
  123. package/docs/evidence/v02/categorical-dev40-preserve.json +460 -0
  124. package/docs/evidence/v02/categorical-dev40-target-only.json +460 -0
  125. package/docs/evidence/v02/categorical-heldout-admission-20261020-v3.json +215 -0
  126. package/docs/evidence/v02/categorical-heldout-admission-20261020-v4.json +270 -0
  127. package/docs/evidence/v02/categorical-heldout-dispatch-authorization-20261020-v4.json +79 -0
  128. package/docs/evidence/v02/categorical-heldout-predispatch-20261020-v3.json +57 -0
  129. package/docs/evidence/v02/categorical-heldout-producer-source-map-v4.json +262 -0
  130. package/docs/evidence/v02/categorical-heldout-producer-source-map.json +263 -0
  131. package/docs/evidence/v02/categorical-heldout-run-freeze-20261020-v3.json +35 -0
  132. package/docs/evidence/v02/categorical-heldout-run-freeze-20261020-v4.json +35 -0
  133. package/docs/evidence/v02/categorical-heldout-v4/candidate-evaluation.json +2812 -0
  134. package/docs/evidence/v02/categorical-heldout-v4/candidate-physical-receipts.json +15261 -0
  135. package/docs/evidence/v02/categorical-heldout-v4/candidate-provenance.json +131 -0
  136. package/docs/evidence/v02/categorical-heldout-v4/control-evaluation.json +855 -0
  137. package/docs/evidence/v02/categorical-heldout-v4/control-physical-receipts.json +4402 -0
  138. package/docs/evidence/v02/categorical-heldout-v4/control-provenance.json +31 -0
  139. package/docs/evidence/v02/categorical-heldout-v4/mask-normalized-exploratory.json +682 -0
  140. package/docs/evidence/v02/categorical-heldout-v4/paired-qualification.json +21 -0
  141. package/docs/evidence/v02/categorical-heldout-v4/report.json +258 -0
  142. package/docs/evidence/v02/categorical-presence-dev6.json +144 -0
  143. package/docs/evidence/v02/categorical-presence-dev6.md +18 -0
  144. package/docs/evidence/v02/categorical-vision-method-selection.json +90 -0
  145. package/docs/evidence/v02/checked-region-component-v1/README.md +7 -0
  146. package/docs/evidence/v02/checked-region-component-v1/evidence.json +311 -0
  147. package/docs/evidence/v02/checked-region-resource-interrupted-2b0d09f.json +102 -0
  148. package/docs/evidence/v02/checked-region-segmentation-resource-4df544c-receipt.json +167 -0
  149. package/docs/evidence/v02/checked-region-segmentation-resource-4df544c-root-review.json +58 -0
  150. package/docs/evidence/v02/checked-region-segmentation-resource-987ac32-receipt.json +158 -0
  151. package/docs/evidence/v02/ci-012b935.json +17 -0
  152. package/docs/evidence/v02/ci-0c365cb.json +372 -0
  153. package/docs/evidence/v02/ci-185bde8.json +32 -0
  154. package/docs/evidence/v02/ci-24f849f.json +95 -0
  155. package/docs/evidence/v02/ci-25c19cd.json +375 -0
  156. package/docs/evidence/v02/ci-2922caf.json +375 -0
  157. package/docs/evidence/v02/ci-29357d7.json +29 -0
  158. package/docs/evidence/v02/ci-32aa90d.json +24 -0
  159. package/docs/evidence/v02/ci-35e3064.json +376 -0
  160. package/docs/evidence/v02/ci-4331b1b.json +384 -0
  161. package/docs/evidence/v02/ci-43b7426.json +376 -0
  162. package/docs/evidence/v02/ci-450439c.json +373 -0
  163. package/docs/evidence/v02/ci-46283fe.json +29 -0
  164. package/docs/evidence/v02/ci-4c9c09f.json +34 -0
  165. package/docs/evidence/v02/ci-5579646.json +27 -0
  166. package/docs/evidence/v02/ci-6f9cc15.json +127 -0
  167. package/docs/evidence/v02/ci-7c1051f.json +27 -0
  168. package/docs/evidence/v02/ci-9837888.json +34 -0
  169. package/docs/evidence/v02/ci-987ac32.json +29 -0
  170. package/docs/evidence/v02/ci-9d00fe5.json +25 -0
  171. package/docs/evidence/v02/ci-9f85acc.json +127 -0
  172. package/docs/evidence/v02/ci-be275a6.json +201 -0
  173. package/docs/evidence/v02/ci-c107ddf.json +372 -0
  174. package/docs/evidence/v02/ci-c35f67d.json +127 -0
  175. package/docs/evidence/v02/ci-c5eddd8.json +32 -0
  176. package/docs/evidence/v02/ci-d2042e0.json +372 -0
  177. package/docs/evidence/v02/ci-d684259.json +375 -0
  178. package/docs/evidence/v02/ci-e0c190b.json +127 -0
  179. package/docs/evidence/v02/ci-e551253.json +372 -0
  180. package/docs/evidence/v02/ci-f9d4633.json +29 -0
  181. package/docs/evidence/v02/dev1-proposal-evaluation.md +13 -0
  182. package/docs/evidence/v02/dev2-mobile-sam-proposal-oracle.md +21 -0
  183. package/docs/evidence/v02/dev2-proposal-evaluation.md +21 -0
  184. package/docs/evidence/v02/fresh-development.md +16 -0
  185. package/docs/evidence/v02/fresh-native-numeric/artifact-hashes.json +9 -0
  186. package/docs/evidence/v02/fresh-native-numeric/evaluation-root-v1.json +568 -0
  187. package/docs/evidence/v02/fresh-native-numeric/run-manifest.json +342 -0
  188. package/docs/evidence/v02/fresh-native-numeric/summary.json +5654 -0
  189. package/docs/evidence/v02/fresh-native-outline-axis/artifact-hashes.json +9 -0
  190. package/docs/evidence/v02/fresh-native-outline-axis/evaluation-root-v1.json +568 -0
  191. package/docs/evidence/v02/fresh-native-outline-axis/run-manifest.json +378 -0
  192. package/docs/evidence/v02/fresh-native-outline-axis/summary.json +5605 -0
  193. package/docs/evidence/v02/fresh-text/README.md +23 -0
  194. package/docs/evidence/v02/fresh-text/ascii-contours-v1/classify-followup-run-manifest.json +405 -0
  195. package/docs/evidence/v02/fresh-text/ascii-contours-v1/classify-followup-summary.json +1646 -0
  196. package/docs/evidence/v02/fresh-text/ascii-contours-v1/evaluation.json +568 -0
  197. package/docs/evidence/v02/fresh-text/ascii-contours-v1/original-run-manifest.json +404 -0
  198. package/docs/evidence/v02/fresh-text/ascii-contours-v1/original-summary.json +4416 -0
  199. package/docs/evidence/v02/fresh-text/ascii-luma-v1/classify-followup-run-manifest.json +405 -0
  200. package/docs/evidence/v02/fresh-text/ascii-luma-v1/classify-followup-summary.json +1646 -0
  201. package/docs/evidence/v02/fresh-text/ascii-luma-v1/evaluation.json +568 -0
  202. package/docs/evidence/v02/fresh-text/ascii-luma-v1/original-run-manifest.json +404 -0
  203. package/docs/evidence/v02/fresh-text/ascii-luma-v1/original-summary.json +4647 -0
  204. package/docs/evidence/v02/fresh-text/ascii-svg-layered-v1/classify-followup-run-manifest.json +405 -0
  205. package/docs/evidence/v02/fresh-text/ascii-svg-layered-v1/classify-followup-summary.json +846 -0
  206. package/docs/evidence/v02/fresh-text/ascii-svg-layered-v1/evaluation.json +568 -0
  207. package/docs/evidence/v02/fresh-text/ascii-svg-layered-v1/original-run-manifest.json +404 -0
  208. package/docs/evidence/v02/fresh-text/ascii-svg-layered-v1/original-summary.json +1789 -0
  209. package/docs/evidence/v02/fresh-text/no-image-control/evaluation.json +568 -0
  210. package/docs/evidence/v02/fresh-text/no-image-control/original-run-manifest.json +404 -0
  211. package/docs/evidence/v02/fresh-text/no-image-control/original-summary.json +3953 -0
  212. package/docs/evidence/v02/fresh-text/palette-grid-v1/classify-followup-run-manifest.json +405 -0
  213. package/docs/evidence/v02/fresh-text/palette-grid-v1/classify-followup-summary.json +1646 -0
  214. package/docs/evidence/v02/fresh-text/palette-grid-v1/evaluation.json +568 -0
  215. package/docs/evidence/v02/fresh-text/palette-grid-v1/original-run-manifest.json +404 -0
  216. package/docs/evidence/v02/fresh-text/palette-grid-v1/original-summary.json +3974 -0
  217. package/docs/evidence/v02/fresh-text/pixel-rle-v1/classify-followup-run-manifest.json +405 -0
  218. package/docs/evidence/v02/fresh-text/pixel-rle-v1/classify-followup-summary.json +1646 -0
  219. package/docs/evidence/v02/fresh-text/pixel-rle-v1/evaluation.json +568 -0
  220. package/docs/evidence/v02/fresh-text/pixel-rle-v1/original-run-manifest.json +404 -0
  221. package/docs/evidence/v02/fresh-text/pixel-rle-v1/original-summary.json +4945 -0
  222. package/docs/evidence/v02/fresh-text/report.json +284 -0
  223. package/docs/evidence/v02/fresh-text/svg-contours-v1/classify-followup-run-manifest.json +405 -0
  224. package/docs/evidence/v02/fresh-text/svg-contours-v1/classify-followup-summary.json +846 -0
  225. package/docs/evidence/v02/fresh-text/svg-contours-v1/evaluation.json +568 -0
  226. package/docs/evidence/v02/fresh-text/svg-contours-v1/original-run-manifest.json +404 -0
  227. package/docs/evidence/v02/fresh-text/svg-contours-v1/original-summary.json +2189 -0
  228. package/docs/evidence/v02/heldout-evaluation-20261020.md +37 -0
  229. package/docs/evidence/v02/heldout-input-derivation.md +18 -0
  230. package/docs/evidence/v02/integration-0c365cb.json +90 -0
  231. package/docs/evidence/v02/integration-25c19cd.json +52 -0
  232. package/docs/evidence/v02/integration-35e3064.json +41 -0
  233. package/docs/evidence/v02/integration-4331b1b.json +42 -0
  234. package/docs/evidence/v02/integration-4c9c09f.json +46 -0
  235. package/docs/evidence/v02/integration-8010aad.json +48 -0
  236. package/docs/evidence/v02/integration-c1aa640.json +41 -0
  237. package/docs/evidence/v02/integration-eea1790.json +46 -0
  238. package/docs/evidence/v02/integration-fa82e65.json +42 -0
  239. package/docs/evidence/v02/jpeg-transport-offline.json +268 -0
  240. package/docs/evidence/v02/jpeg-transport-offline.md +7 -0
  241. package/docs/evidence/v02/local-archive-cleanup.json +59 -0
  242. package/docs/evidence/v02/native-base64-after.json +30 -0
  243. package/docs/evidence/v02/native-base64-before.json +32 -0
  244. package/docs/evidence/v02/native-checked-region-windows-46283fe.json +248 -0
  245. package/docs/evidence/v02/native-checked-region-windows-987ac32.json +141 -0
  246. package/docs/evidence/v02/native-grabcut-windows-4c494a3-run2.json +148 -0
  247. package/docs/evidence/v02/native-grabcut-windows-4c494a3-run3.json +148 -0
  248. package/docs/evidence/v02/native-grabcut-windows-4c494a3.json +56 -0
  249. package/docs/evidence/v02/native-proposal-windows-0c365cb.json +148 -0
  250. package/docs/evidence/v02/native-proposal-windows-450439c.json +156 -0
  251. package/docs/evidence/v02/native-proposal-windows-4c9c09f-retry1.json +147 -0
  252. package/docs/evidence/v02/native-proposal-windows-4c9c09f.json +52 -0
  253. package/docs/evidence/v02/native-region-windows-efc9318.json +163 -0
  254. package/docs/evidence/v02/native-windows-eea1790-baseline.json +198 -0
  255. package/docs/evidence/v02/native-windows-eea1790.json +228 -0
  256. package/docs/evidence/v02/ordinary-luna-axis/run-manifest.json +99 -0
  257. package/docs/evidence/v02/ordinary-luna-axis/summary.json +811 -0
  258. package/docs/evidence/v02/owned-temp-cleanup-20261020-v1.json +28 -0
  259. package/docs/evidence/v02/presentation-paired-20261020.json +1438 -0
  260. package/docs/evidence/v02/proposal-resource-soak-261dc23.json +201 -0
  261. package/docs/evidence/v02/proposal-resource-soak-450439c-receipt.md +13 -0
  262. package/docs/evidence/v02/reconstructed-c03-box.json +41 -0
  263. package/docs/evidence/v02/region-seeded-dev-v1/README.md +17 -0
  264. package/docs/evidence/v02/region-seeded-dev-v1/evaluation.json +260 -0
  265. package/docs/evidence/v02/region-seeded-dev-v2/README.md +15 -0
  266. package/docs/evidence/v02/region-seeded-dev-v2/evaluation.json +232 -0
  267. package/docs/evidence/v02/region-seeded-dev-v3-candidate-only/README.md +9 -0
  268. package/docs/evidence/v02/region-seeded-dev-v3-candidate-only/control-identity-failure.json +22 -0
  269. package/docs/evidence/v02/region-seeded-dev-v3-candidate-only/evaluation.json +160 -0
  270. package/docs/evidence/v02/region-seeded-dev-v3-control-r2/README.md +9 -0
  271. package/docs/evidence/v02/region-seeded-dev-v3-control-r2/attempt-accounting.json +55 -0
  272. package/docs/evidence/v02/region-seeded-dev-v3-control-r2/evaluation.json +136 -0
  273. package/docs/evidence/v02/region-seeded-development-control-r2-freeze-20261021.json +132 -0
  274. package/docs/evidence/v02/region-seeded-development-freeze-20261021-v1.json +167 -0
  275. package/docs/evidence/v02/region-seeded-development-freeze-20261021-v2.json +186 -0
  276. package/docs/evidence/v02/region-seeded-development-freeze-20261021-v3.json +205 -0
  277. package/docs/evidence/v02/region-seeded-heldout-cancelled-before-dispatch-20261021-v2.json +20 -0
  278. package/docs/evidence/v02/region-seeded-heldout-dispatch-authorization-20261021-v3.json +47 -0
  279. package/docs/evidence/v02/region-seeded-heldout-readiness-audit-20261021-v3.json +125 -0
  280. package/docs/evidence/v02/region-seeded-heldout-run-freeze-20261021-v2.json +234 -0
  281. package/docs/evidence/v02/region-seeded-heldout-run-freeze-20261021-v3.json +357 -0
  282. package/docs/evidence/v02/region-seeded-heldout-v3/README.md +19 -0
  283. package/docs/evidence/v02/region-seeded-heldout-v3/evaluation-summary.json +445 -0
  284. package/docs/evidence/v02/region-seeded-method-selection-20261021-v2.json +66 -0
  285. package/docs/evidence/v02/region-seeded-method-selection-20261021-v3.json +120 -0
  286. package/docs/evidence/v02/region-segmentation-resource-0ba4c87-receipt.json +156 -0
  287. package/docs/evidence/v02/resource-soak-linux-8010aad.json +125 -0
  288. package/docs/evidence/v02/screen-v2-terminal-evaluation.md +22 -0
  289. package/docs/evidence/v02/seed-outline/run-manifest.json +59 -0
  290. package/docs/evidence/v02/seed-outline/summary.json +487 -0
  291. package/docs/evidence/v02/seed-unbounded/run-manifest.json +80 -0
  292. package/docs/evidence/v02/seed-unbounded/summary.json +730 -0
  293. package/docs/evidence/v02/segmentation/README.md +21 -0
  294. package/docs/evidence/v02/segmentation/component-comparison-summary.json +240 -0
  295. package/docs/evidence/v02/segmentation/provenance/MOBILE-SAM-LICENSE.txt +201 -0
  296. package/docs/evidence/v02/segmentation/provenance/OPENCV-LICENSE.txt +202 -0
  297. package/docs/evidence/v02/segmentation/provenance/mobile-sam-download-receipt.json +29 -0
  298. package/docs/evidence/v02/segmentation/provenance/mobile-sam-graph-audit.json +214 -0
  299. package/docs/evidence/v02/segmentation/provenance/mobile-sam-model-metadata.json +166 -0
  300. package/docs/evidence/v02/split-choice-noul-dev6.json +72 -0
  301. package/docs/evidence/v02/split-choice-noul-dev6.md +11 -0
  302. package/docs/evidence/v02/supported-vision-screen-20261020.md +65 -0
  303. package/docs/evidence/v02/wesnoth-1.16.11-minimap-projection-source-audit.md +56 -0
  304. package/docs/evidence/v02/wesnoth-proof-root-review-20261020-v1.json +76 -0
  305. package/docs/operations.md +8 -2
  306. package/docs/plan.md +2 -0
  307. package/docs/publishing.md +16 -1
  308. package/docs/research/text-transport-audit.md +66 -0
  309. package/docs/v02-usage.md +164 -0
  310. package/docs/vision-results.md +31 -2
  311. package/package.json +30 -5
package/docs/README.ru.md CHANGED
@@ -1,19 +1,44 @@
1
1
  # Zorya Classifier: руководство
2
2
 
3
- Zorya Classifier — библиотека для Node.js и TypeScript, которая помогает приложению принимать решения по тексту и изображениям. Вы задаёте допустимые классы или описываете искомый объект, библиотека передаёт их выбранной модели решений или языковой модели и проверяет структурированный ответ. Основной вариант — decision-модель, в примерах Luna Decisions. Обычные vision-модели без нативной классификации тоже поддерживаются через чат-адаптер. Код распространяется по MIT; веса модели в поставку не входят, запросы удалённых моделей оплачиваются отдельно; можно подключить и свой локальный сервер. Любая vision-модель, которая понимает изображения и выполняет контракт ответа, может использоваться через готовый OpenAI-совместимый адаптер или собственный `DecisionPort`. Точная проверенная совместимость и результаты перечислены в [таблице моделей](vision-results.md).
3
+ Версия 0.2 добавляет прозрачный PNG, бинарную маску, её рамку и центр. Прежний поиск области служит подсказкой для сегментации всего исходного изображения. Затем decision проверяет рамку; допускаются одно расширение маски и повторная проверка. [Руководство](v02-usage.md) описывает API, CLI и владение ресурсами.
4
+
5
+ [Независимый тест 80 случаев](evidence/v02/region-seeded-heldout-v3/README.md) прошёл согласованные критерии, но показал ограниченную полноту: 26/60 попаданий в область объекта и 8/60 полных рамок, без ложных выделений на 20 отрицательных случаях. Из 30 эталонных масок восемь достигли IoU 0,8, три не достигли, для 19 предсказание отсутствовало. Это результаты одной явно настроенной комбинации Luna/OpenAI и MobileSAM, а не гарантия для любой модели или игры.
6
+
7
+ Сравнение шести способов передачи изображения текстом завершено на свежих фотографиях и реальном интерфейсе: ни один не прошёл требования локализации. [Результаты и ограничения](evidence/v02/fresh-text/README.md) сохранены, публичный экспериментальный режим явно возвращает `UNSUPPORTED`.
8
+
9
+ Zorya Classifier — библиотека для Node.js и TypeScript с поддерживаемой классификацией по тексту и изображениям и экспериментальной, не квалифицированной для общего применения пространственной локализацией и извлечением объектов. Библиотека не выбирает и не подключает модель за приложение: клиент получает явно переданный `DecisionPort` — готовый адаптер с выбранными настройками или собственную реализацию. Модель и провайдер в примерах — лишь варианты интеграции, не значения по умолчанию. Код распространяется по MIT; веса модели в поставку не входят, запросы удалённых моделей оплачиваются отдельно; можно подключить и свой локальный сервер. Совместимость и качество зависят от выбранного маршрута. Более мощная модель может помочь, но улучшение точности не гарантировано. Проверенные комбинации и результаты перечислены в [таблице моделей](vision-results.md).
4
10
 
5
11
  Это самостоятельная библиотека: ей не нужны Zorya Games, Electron, база данных или игровой процесс. Её можно встроить в сервер, бота, инструмент обработки фотографий или собственный HTTP-сервис. Готовый постоянно работающий HTTP-сервер в пакет не входит.
6
12
 
13
+ ## Статус возможностей
14
+
15
+ Дальнейшие эксперименты по точности пространственных сценариев остановлены; ни одна стратегия локализации, извлечения или предложений масок не продвигается для общего использования. Исторические метрики в `docs/evidence/**` сохранены без переинтерпретации.
16
+
17
+ | Возможность | Статус | Примечание |
18
+ | --------------------------------------------- | ---------------- | ------------------------------------------------------------------------------ |
19
+ | `classify` с явным `DecisionPort` | Поддерживается | Один закрытый ID класса; без заявления об универсальной точности модели |
20
+ | `locate` (сетка регионов) | Экспериментально | Гипотеза по ячейке, не геометрия целого объекта и не доказательство отсутствия |
21
+ | `RefinementPort` | Экспериментально | Без общей квалификации качества |
22
+ | `locate({ mode: 'whole-object' })` | Экспериментально | Интервалы или сегментация вызывающего; без квалификации |
23
+ | `extract`, `SegmentationPort`, проверка рамки | Экспериментально | Структурный успех ≠ семантическая точность маски |
24
+ | `objectProposals`, нативные фабрики | Экспериментально | На стороне вызывающего; без квалификации |
25
+ | `experimental-text` | Отклонено | `UNSUPPORTED`, пока профиль не пройдёт отбор |
26
+
27
+ Heldout region-seeded (один задокументированный рецепт): 26/60 попаданий seed на позитивах; 8/60 полных рамок объекта; на 30 эталонных масках — 8 с IoU 0,8, 3 неудачи, 19 без предсказания. H8 DEV: 7/9 позитивов и 2/3 ложных выхода, без квалификации. Узкий исторический admission — не общая пространственная квалификация.
28
+
7
29
  ## Что умеет
8
30
 
9
- | Задача | API | Результат |
10
- | ---------------------------------------------------------- | ----------------------------------- | --------------------------------------------------------------------------------- |
11
- | Распределить обращения по отделам, определить намерение | `classify` с текстом | Один из заданных классов и ранжирование вариантов |
12
- | Проверить наличие объекта или выбрать категорию фотографии | `classify` с изображением | Один из заданных классов |
13
- | Оценить изображение с текстовым условием | `classify` с текстом и изображением | Класс с учётом обоих входов |
14
- | Найти примерную область предмета, значка или указателя | `locate` | Ячейка в координатах исходного изображения либо явная неопределённость/отсутствие |
31
+ | Задача | Статус | API | Результат |
32
+ | ---------------------------------------------------------- | ---------------- | ----------------------------------- | --------------------------------------------------------------------------------- |
33
+ | Распределить обращения по отделам, определить намерение | Поддерживается | `classify` с текстом | Один из заданных классов и ранжирование вариантов |
34
+ | Проверить наличие объекта или выбрать категорию фотографии | Поддерживается | `classify` с изображением | Один из заданных классов |
35
+ | Оценить изображение с текстовым условием | Поддерживается | `classify` с текстом и изображением | Класс с учётом обоих входов |
36
+ | Найти примерную область предмета, значка или указателя | Экспериментально | `locate` | Ячейка в координатах исходного изображения либо явная неопределённость/отсутствие |
37
+ | Получить маску, рамку, центр и прозрачный вырез предмета | Экспериментально | `extract` с явным сегментатором | Геометрия и вырез, выведенные из пикселей маски |
38
+
39
+ Для `extract` после сегментации модель получает исходную картинку с рамкой маски и отметкой прежней найденной области. Она выбирает один ответ: весь видимый объект внутри, нужно расширение или определить не удалось. При необходимости сегментатор один раз ищет внешнюю маску, содержащую прежние пиксели; её рамка проверяется повторно. Максимум получается пять модельных запросов: три на поиск области и два на проверку. Если подтверждения нет, библиотека возвращает неопределённость без частичного выреза. `verification` сохраняет проверки и результат расширения. Рамка и центр всегда вычисляются из маски; проверка рамки не гарантирует точности каждого пикселя. Своя модель подключается через `DecisionPort`, отдельная проверка — через `segmentationBoxCheck`.
15
40
 
16
- `classify` делает один запрос к выбранному API модели. `locate` делает до трёх последовательных запросов: крупная сетка → уточнение в четырёх выбранных областях → сравнение четырёх увеличенных кандидатов. Проверки присутствия входят в те же запросы. Модель выбирает варианты, а координаты вычисляет код.
41
+ Сконфигурированный `DecisionPort` выполняет запросы по контракту библиотеки. `classify` делает один запрос, а `locate` — до трёх последовательных запросов: крупная сетка → уточнение в четырёх выбранных областях → сравнение четырёх увеличенных кандидатов. Проверки присутствия входят в те же запросы. Порт отвечает за ответы, координаты вычисляет код.
17
42
 
18
43
  Библиотека не генерирует описание сцены и не ищет все экземпляры предмета: если подходящих объектов несколько, `locate` возвращает один кандидат. Выбранная ячейка может содержать только часть объекта; это не маска сегментации, не точная рамка и не доказанный центр. Дополнительный алгоритм уточнения можно подключить через `RefinementPort`.
19
44
 
@@ -102,9 +127,9 @@ const result = await client.classify({
102
127
 
103
128
  Для одной картинки поле `text` можно опустить. Принимаются `Uint8Array` и `Buffer` с одним PNG/JPEG/WebP: до 16 MiB и 16 777 216 декодированных пикселей. Ссылки на изображения публичный API не загружает — скачивание, права доступа и ограничения внешних URL остаются у вызывающего приложения.
104
129
 
105
- ## Поиск объекта и координаты
130
+ ## Поиск объекта и координаты (экспериментально)
106
131
 
107
- Также внутри `try`:
132
+ Обычный `locate` экспериментален и не квалифицирован для общего применения. Также внутри `try`:
108
133
 
109
134
  ```js
110
135
  const result = await client.locate({
@@ -133,7 +158,11 @@ if (result.status === 'located') {
133
158
  | `unknown` | Неуверенность, противоречие, отсутствие цели среди кандидатов или невозможная сетка | Уточнить цель, взять более подходящее изображение или вернуть пользователю неопределённость |
134
159
  | Исключение `ClassifierError` | Ошибка входа, сети, протокола, бюджета или жизненного цикла | Обработать код ошибки; не показывать её как отсутствие объекта |
135
160
 
136
- Небольшие значки, перекрытия, похожие предметы и сложные карты требуют собственной проверки на ваших данных. Предметные фотографии не доказывают точность на игровых мини-картах. Если нужен центр объекта или маска, это отдельный этап уточнения.
161
+ Если нужны маска, рамка или центр объекта, используйте `extract` с явно созданным сегментатором. Обычный `locate` сначала находит регион-кандидат; затем сегментатор получает seed-подсказку на всём ориентированном исходном изображении. Рамка и центр вычисляются по реальным пикселям маски, без отдельного поиска границ или подтверждения рамки языковой моделью. Пример и детали владения ресурсами приведены в [руководстве 0.2](v02-usage.md). Это технический путь обработки, а не гарантия точности на всех фото.
162
+
163
+ В проверенном сценарии v2 приложение сначала вызывает `classify` для наличия цели и запускает `extract` только после ответа `present`. Это явная композиция приложения: один запрос классификации плюс до трёх запросов поиска. Сам `extract` дополнительную классификацию не вставляет. Ошибку классификации нельзя выдавать за отсутствие цели; обе операции должны использовать общий сигнал отмены и абсолютный срок выполнения.
164
+
165
+ Встроенный MobileSAM получает точку в центре найденной области и обрабатывает весь исходник; текст названия предмета он не понимает. Поэтому иногда он выделяет деталь, например фару вместо автомобиля. Успешный `extracted` подтверждает корректность маски и файлов, а точность распознавания оценивается отдельно. На полном DEV40 для v2 было 18/30 попаданий области в рамку цели, 5/30 совпадений рамки маски и 0 ложных вырезок на 10 отрицательных примерах. Это разные метрики. [Независимый отчёт](evidence/v02/region-seeded-dev-v2/README.md) сохраняет ошибки и ограничения; другой сегментатор подключается через тот же `SegmentationPort`.
137
166
 
138
167
  ## Отмена, нагрузка и ошибки
139
168
 
@@ -174,7 +203,7 @@ try {
174
203
 
175
204
  ## Командная строка
176
205
 
177
- CLI требует явный `ZORYA_MODEL`; по умолчанию используется `ZORYA_MODE=decisions`. Для обычной языковой модели или прямого чат-сервера установите `ZORYA_MODE=chat`. Для OpenRouter задайте также `OPENROUTER_API_KEY` и `ZORYA_PROVIDER`. Для прямого API или локального сервера задайте полный `ZORYA_ENDPOINT` и при необходимости отдельный `ZORYA_API_KEY`; ключ OpenRouter туда не передаётся. Необязательные `ZORYA_REASONING_EFFORT` и `ZORYA_RESPONSE_FORMAT` используйте только при поддержке сервером. Например, для основного маршрута Luna Decisions:
206
+ CLI требует явный `ZORYA_MODEL`; режим CLI по умолчанию — `ZORYA_MODE=decisions`. Это настройка команды, а не выбор модели внутри библиотеки. Для обычной языковой модели или прямого чат-сервера установите `ZORYA_MODE=chat`. Для OpenRouter задайте также `OPENROUTER_API_KEY` и `ZORYA_PROVIDER`. Для прямого API или локального сервера задайте полный `ZORYA_ENDPOINT` и при необходимости отдельный `ZORYA_API_KEY`; ключ OpenRouter туда не передаётся. Необязательные `ZORYA_REASONING_EFFORT` и `ZORYA_RESPONSE_FORMAT` используйте только при поддержке сервером. Например, одна из конфигураций Luna Decisions:
178
207
 
179
208
  ```sh
180
209
  export ZORYA_MODE=decisions
@@ -223,7 +252,7 @@ const client = createClassifier({ decision })
223
252
 
224
253
  [Таблица проверенных моделей](vision-results.md) содержит названия, провайдеров, число примеров, ошибки, точность, задержки и цену. Там отдельно указаны полноценная проверка на корпусе, короткий screening и тесты адаптера с искусственным сервером. Необозначенная модель не считается автоматически проверенной.
225
254
 
226
- Исторический Jev-прогон дал 55/60 на фото и 30/30 на авторских текстовых примерах. Это baseline прежнего адаптера, а не доказательство качества другой модели. Подробности и исходные ошибки сохранены в [исторических результатах](results.md). Локализация остаётся экспериментальной; ячейка не является точной маской или центром объекта.
255
+ Исторический Jev-прогон дал 55/60 на фото и 30/30 на авторских текстовых примерах. Это baseline прежнего адаптера, а не доказательство качества или превосходства другой модели. Результаты не позволяют предполагать, что более мощная модель обязательно повысит точность. Подробности и исходные ошибки сохранены в [исторических результатах](results.md). Локализация остаётся экспериментальной; ячейка не является точной маской или центром объекта.
227
256
 
228
257
  ## Разработка и следующие документы
229
258
 
@@ -241,5 +270,5 @@ npm run format:check
241
270
  - [Архитектура](architecture.md): слои, порты, отмена и владение ресурсами.
242
271
  - [Эксплуатация](operations.md): интеграция в сервис, расходы и завершение работы.
243
272
  - [Воспроизведение benchmark](benchmarks.md): лицензированные фотографии и отдельный запуск платных проверок.
244
- - [Безопасность](../SECURITY.md): ключи, Git, npm-архивы и ограничения сканирования.
273
+ - [Безопасность](https://github.com/zoomplus/zorya-classifier/blob/main/SECURITY.md): ключи, Git, npm-архивы и ограничения сканирования.
245
274
  - [Подготовка публикации](publishing.md): GitHub/npm и необходимая авторизация владельца.
@@ -1,8 +1,121 @@
1
- # Acceptance: standalone0.1.0 preview
1
+ # Acceptance: standalone library
2
2
 
3
- This acceptance concerns the extracted MIT Node.js library, not the Zorya desktop application, installer, microphone or game session. Native Luna Decisions is the primary documented route; ordinary vision chat, direct OpenAI-compatible servers and custom DecisionPort implementations remain alternatives. Jev is optional historical compatibility.
3
+ This acceptance concerns the extracted MIT Node.js library, not the Zorya desktop application, installer, microphone or game session. The caller supplies a `DecisionPort` or explicitly configures an adapter; model/provider recipes below are examples, not library defaults. Closed `classify` and explicitly configured provider/transport adapters are supported integration paths. Region `locate`, whole-object location, extraction, `RefinementPort`, segmentation/box-check composition, `objectProposals`, and native segmentation factories are experimental and unqualified; public API symbols carry `@experimental`. Further spatial accuracy experiments are stopped; no strategy is promoted. Jev is optional historical compatibility.
4
4
 
5
- ## Executed checks and release gates
5
+ ## Current 0.2 acceptance
6
+
7
+ The original-region/full-source-segmentation workflow, closed box check and single enclosing-mask correction are implemented. The caller selects every decision model, provider and segmenter. Classification and the default region API remain compatible. All six text-only encoders failed their separate qualification and remain unsupported.
8
+
9
+ The [independent frozen heldout evaluation](evidence/v02/region-seeded-heldout-v3/README.md) passed its predeclared criteria on all 80 candidate and 80 image-free control cases. Candidate classification was 65/80. Positive seed hits were 26/60, complete mask-derived boxes 8/60, and false seeds/extractions 0/20 negatives. Of 30 exact-canvas mask references, eight reached IoU 0.8, three did not and 19 had no predicted mask. Both paired positive-photo seed intervals were [0.500, 0.833]; neither measures whole-object quality. The corpus contains official photos and one controlled UI/game family each, not general game coverage. Two HTTP 502 failures and unknown charges remain counted.
10
+
11
+ The [fresh checked-flow resource run](evidence/v02/checked-region-segmentation-resource-4df544c-receipt.json) passed every strict monotonic-duration guard after the harness-only deadline repair. It recorded 7,212.61 seconds, 3,295 successful operations and 4,942 matching child starts/closes with none left. [Independent root recomputation](evidence/v02/checked-region-segmentation-resource-4df544c-root-review.json) rehashed all 59 pinned sources and confirmed idle-median growth of 51.44 MiB RSS, 8.61 MiB heap and 5.57 MiB array buffers; external memory decreased. All fixed thresholds pass. This is bounded resource evidence, not proof of zero retained memory.
12
+
13
+ [Native Windows installed-archive checks](evidence/v02/native-checked-region-windows-987ac32.json) cover the same 114 compiled runtime files. The [565-test hosted matrix](evidence/v02/ci-f9d4633.json) passed Windows/Linux × Node 22/24. The later evaluator-only missing-byte-count compatibility fix preserves pinned assets, bounded reads, hashes, canvas/pixel checks and every scoring criterion. Final source gates, exact installed archive, runtime parity, redacted security scans, final-source CI and registry publication are recorded separately in the external release manifest. Historical interrupted and rejected runs below remain preserved.
14
+
15
+ ## Implementation and development history
16
+
17
+ The latest owner correction adds a closed post-segmentation containment check and at most one actual enclosing-mask repair. The original three-Choice region search stays compatible; coordinates and cutouts still come only from mask pixels. A default checker reuses the injected decision port, while an optional custom checker remains caller-owned. An unresolved check returns unknown without a partial cutout. The [updated plan](0.2.0-plan.md) records contracts, ownership, bounded calls and execution waves.
18
+
19
+ A [three-call DEV component probe](evidence/v02/checked-region-component-v1/README.md) rejected the headlight-only Car box, accepted the Knife box, and accepted the actual enclosing Car box. This demonstrates the correction hypothesis on two exposed images; it does not qualify general accuracy. The old v2 blind freeze was [cancelled before dispatch](evidence/v02/region-seeded-heldout-cancelled-before-dispatch-20261021-v2.json); all 80 unused cases remain sealed.
20
+
21
+ The corrected checked-flow runtime is integrated at `987ac32`. All 563 offline tests and strict source/build/format gates pass at `29357d7`, including a real public producer-to-evaluator fixture with controlled fetches and the per-variant freeze verifier. [All four hosted Windows/Linux × Node 22/24 jobs](evidence/v02/ci-29357d7.json) and their installed-archive checks passed. The [native Windows installed-archive check](evidence/v02/native-checked-region-windows-987ac32.json) passed actual segmentation, enclosing-mask expansion, cancellation, capacity and disposal on the unchanged compiled runtime: ten owned child starts matched ten closes, with none retained and zero provider HTTP calls. These are transport, wiring and lifecycle checks, not real-photo accuracy or game navigation.
22
+
23
+ The first checked-flow resource attempt was [interrupted after a public-transport preparation defect was reproduced](evidence/v02/checked-region-resource-interrupted-2b0d09f.json). The corrected runtime prepares the full rendered source through the existing raster image-state port, preserving mask coordinates; real native and ordinary public adapters are covered on 64×48 and 1920×1080 sources. The [completed corrected-runtime run](evidence/v02/checked-region-segmentation-resource-987ac32-receipt.json) preserves 3,176 successful measured operations, 4,764 matching child starts/closes, no retained child and memory growth below the fixed thresholds. It is **not qualified**: one timer-based idle window measured 29,999.622479 ms instead of the required 30,000 ms, so the original strict duration guard failed despite more than 7,211 monotonic process seconds. No rounding or retrospective waiver is applied. A harness-only absolute-deadline wait fix and a fresh full run are required; runtime bytes and the blind cohort remain unchanged.
24
+
25
+ The [v3 candidate-only evaluation](evidence/v02/region-seeded-dev-v3-candidate-only/README.md) scored all 40 cases: 6/30 positive mask-derived boxes matched, with zero false locations on ten negatives; one of seven exact-canvas mask references reached IoU 0.8. It retains six failed provider calls and their unknown charges. The original [v3 development freeze](evidence/v02/region-seeded-development-freeze-20261021-v3.json) incorrectly reused the candidate prompt policy when calculating the control identity. The evaluator rejected that mismatch; the original control remains preserved and unscored. The [separate prospective control-R2 freeze](evidence/v02/region-seeded-development-control-r2-freeze-20261021.json) was verified before a new complete control40. Its [strict paired evaluation](evidence/v02/region-seeded-dev-v3-control-r2/README.md) reuses only the immutable correctly pinned candidate: coarse positive-photo seed difference +0.625, 95% interval [0.375, 0.875]; exact-mask foreground seed interval [0.4, 1.0] on five comparable photo pairs. These are seed metrics, not whole-object or mask accuracy. Development admission passes; the [conditional method selection](evidence/v02/region-seeded-method-selection-20261021-v3.json) freezes the unchanged recipe before any new blind data. The unused blind cohort remains undispatched. No text-only encoder qualified, and no 0.2 npm release is claimed.
26
+
27
+ The new [v3 blind freeze](evidence/v02/region-seeded-heldout-run-freeze-20261021-v3.json) binds 80 unused cases, unchanged source/oracle pins, distinct ordered candidate/control identities and the original admission criteria. Both offline preflights verified all 80 images with zero provider calls after method selection. An [independent metadata audit](evidence/v02/region-seeded-heldout-readiness-audit-20261021-v3.json) preserves the rejected first draft's JSON property-order error and confirms the corrected identities. Actual dispatch remains disabled until the required checked-flow resource gate passes and a separate authorization is recorded.
28
+
29
+ ## Baseline before checked expansion
30
+
31
+ The agreed primary flow is the original three-Choice region search followed by one caller-owned segmentation of the full oriented source. The selected cell is a prompt, not a crop limiting the object. Cutout pixels, bounding rectangle and centre come from the mask. The implementation was integrated at `c6b8069`; its 54 runtime source files remain unchanged. At `65c785f`, all 512 offline tests, strict TypeScript/ESLint, boundaries, dead-code checks, build and formatting pass. Caller-owned model/segmenter configuration and default region behavior are retained.
32
+
33
+ The [native Windows installed-archive check](evidence/v02/native-region-windows-efc9318.json) passed with the new full-source point-prompt flow: the mask extended beyond its seed, PNG alpha and mask/bounds/center/offset agreed, transparent input produced a valid empty mask, and nine owned child starts matched nine closes. Physical cancellation, bounded queuing, caller ownership and cleanup passed with zero HTTP. This is wiring/lifecycle evidence, not photo accuracy. [All four hosted Windows/Linux × Node 22/24 jobs passed for `c5eddd8`](evidence/v02/ci-c5eddd8.json); final release-source CI and archive parity remain mandatory.
34
+
35
+ The [first complete region-seeded DEV40](evidence/v02/region-seeded-dev-v1/README.md) failed: 5/30 positive mask-derived boxes matched, 1/10 verified negatives produced a false seed and cutout, and 1/7 exact-canvas mask references reached IoU 0.8. The separately recorded classification correctly rejected that false target. A [new presence-first caller recipe](evidence/v02/region-seeded-development-freeze-20261021-v2.json) reuses that existing classification to skip localization after absence or error, without changing the library or adding a request. Its complete candidate/control DEV40 rerun passed independent development admission: zero false seeds/extractions on ten negatives, 18/30 coarse seed-box intersections, 5/30 mask-derived box matches, and 1/7 exact-canvas masks reaching IoU 0.8. The paired positive-photo seed proxy is +0.625 with 95% interval [0.375, 0.875]; it does not measure whole-object accuracy. Six 502s and unknown charges remain counted. This new run, rather than the earlier post-hoc filter, is the development evidence; mask/box quality remains low. The old box-confirmation blind run was [cancelled before dispatch](evidence/v02/box-heldout-cancelled-before-dispatch-20261021-v1.json); its unused 80-case cohort remains sealed. No release or blind accuracy qualification is claimed.
36
+
37
+ The [two-hour `450439c` proposal baseline](evidence/v02/proposal-resource-soak-450439c-receipt.md) terminated after 7,210.99 monotonic seconds and 3,022 successful measured operations, with 3,022 child starts/closes and none retained. Idle RSS grew 228.3 MiB, exceeding the investigation threshold; that research path remains unqualified for sustained resource use. This does not establish its cause. The later [original-region segmentation baseline](evidence/v02/region-segmentation-resource-0ba4c87-receipt.json) completed after 7,208.68 monotonic seconds, with an independent same-process age witness, 4,537 successful operations and 4,537 owned child starts/closes. Idle RSS rose 62.63 MiB and heap 5.74 MiB, below the fixed investigation thresholds; external/array-buffer growth was negligible. This is threshold evidence for the earlier flow, not proof of no retained memory or qualification of the later checked-containment runtime. Its separate two-hour run remains active.
38
+
39
+ | Gate | Baseline workflow |
40
+ | ---------------------------------- | ------------------------------------------------------------------------------------------ |
41
+ | Source checks | Pass: 512 tests and strict checks at `65c785f`; final release checks remain |
42
+ | Real image quality | DEV v1 failed; presence-first v2 passed development admission; blind qualification pending |
43
+ | Installed archive / Windows native | Native new-flow wiring passed; final release archive and runtime parity still required |
44
+ | Two-hour resources | Original-region segmentation baseline passed; checked-containment run remains separate |
45
+ | Text-only encoders | None qualified; experimental public image selector rejects explicitly |
46
+ | Publication | Pending mandatory gates |
47
+
48
+ ## Historical gate state before the region-segmentation clarification
49
+
50
+ The integrated executable passes 471 Linux offline tests, formatting, strict source checks and the installed-archive consumer at `9f85acc`. [All four Windows/Linux × Node 22/24 jobs passed for `9f85acc`](evidence/v02/ci-9f85acc.json), including the new HELDOUT profiles, evaluator metadata correction, explicit-thread resource harness, archive and formatting steps. [The `6f9cc15` run](evidence/v02/ci-6f9cc15.json), [the `e0c190b` run](evidence/v02/ci-e0c190b.json), [the `c35f67d` run](evidence/v02/ci-c35f67d.json) and [the earlier `450439c` run](evidence/v02/ci-450439c.json) remain preserved. [Native Windows installed-archive acceptance](evidence/v02/native-proposal-windows-450439c.json) passes on the changed runtime: eight child starts/closes, none left, physical cancellation and caller ownership. Its 107-file installed manifest matches the reviewed archive exactly. Independent Gitleaks scanned 104 commits / 8.58 MB with no findings. The evaluator-only metadata correction passes these source checks and does not change runtime or scoring. Earlier [c107 CI](evidence/v02/ci-c107ddf.json) and [integration evidence](evidence/v02/integration-25c19cd.json) remain preserved. Final release source still needs its own checks.
51
+
52
+ The frozen runtime used for v4 had all 53 source files and 106 compiled runtime files byte-identical to `0c365cb`. The new box-confirmation development hypothesis changes the proposal process and presenter, so the historical native/resource receipts below do not automatically cover its new bytes. Fresh native Windows acceptance has passed; the new two-thread resource run remains active. The first proposal resource run completed its configured wall-clock phases, but its observed process lifetime and summed monotonic operation durations did not prove the required physical duration. It is retained as historical evidence. Replacement harness `261dc23` uses monotonic phase deadlines, enforces the full duration minima, and has a separate kernel-uptime observer. Its [fresh two-hour run passed](https://github.com/zoomplus/zorya-classifier/blob/36818582091bfd19951631f358183bdb9ffd1e11/docs/evidence/v02/proposal-resource-soak-261dc23.md): 7,212.6 monotonic seconds, an independent live process-age witness at 7,200.68 seconds, and 2,158 native starts/closes in the measurement window with none left. Idle heap, external and array-buffer growth pass the fixed limits; RSS grew 115.76 MiB, below the 128 MiB threshold. Root independently checked parity of all 55 pinned files. This fixture run establishes resource/lifecycle behavior; its shared-host timing does not qualify model quality or production latency.
53
+
54
+ The [first frozen blind candidate](evidence/v02/heldout-evaluation-20261020.md) failed: 3/60 positive whole-object boxes matched, there were 2/20 false locations against a limit of one, and the paired photo bootstrap interval was [0, 0.20], whose lower bound must be positive. Four of six scored mask instances reached IoU 0.8; nineteen reference instances were unavailable. Mask and box metrics remain separate. The no-image control completed all 40 photos with no successful location. No alternative is selected from these revealed heldout results.
55
+
56
+ The [six-case split Choice/NoUL pilot](evidence/v02/split-choice-noul-dev6.md) failed its predeclared positive gate: classification 4/6, positive whole-object matches 0/2, false locations 0/4 verified negatives, and one failed localization. The [split categorical-presence follow-up](evidence/v02/categorical-presence-dev6.md) also produced no locations. Neither failed split profile advanced to full DEV40.
57
+
58
+ The distinct native categorical batch comparison completed both original DEV40 profiles: [preserving the neutral instruction](evidence/v02/categorical-dev40-preserve.json) reached 3/30 positive whole-object matches, while [target alone](evidence/v02/categorical-dev40-target-only.json) reached 0/30. Both classify 35/40 and have zero false locations on ten negatives. Preserving the instruction is [frozen as the development selection](evidence/v02/categorical-vision-method-selection.json), before new heldout pixels or per-case truth were opened. Its eight 502 failures and eight unknown charges remain counted. The second profile has four such failures. Timing is unranked under concurrent native stress; no latency tie-break was needed. This caller-owned recipe does not become a library default or qualify blind accuracy. The new 80-case cohort has independent photo, controlled Mousepad UI and controlled Minetest minimap source oracles. Its [first setup attempt failed before HTTP](evidence/v02/categorical-heldout-predispatch-20261020-v3.json); the separate [v4 freeze](evidence/v02/categorical-heldout-run-freeze-20261020-v4.json) binds the corrected common photo instruction, unchanged images/targets/truth and the exact executable producer closure. Both measurements completed before independent truth evaluation. The [v4 result failed qualification](https://github.com/zoomplus/zorya-classifier/blob/36818582091bfd19951631f358183bdb9ffd1e11/docs/evidence/v02/categorical-heldout-v4/README.md): 1/60 positive whole-object boxes, zero false locations on 20 negatives, and paired photo bootstrap interval [0, 0.10]. Classification is 69/80, including ten false positives; the no-image control has zero positive locations. All 456 physical calls, seven unknown charges and failures remain counted. The initial mask section has no joined references; the separate official index has 32 masks on 21 photos, with 30 masks using a different full-frame canvas. A separate exploratory normalized-canvas calculation records seven scored reference instances, three at IoU 0.8, and 25 unavailable predictions; exact alignment remains unqualified and cannot change the box/paired failure. These cases are now exposed regression data; a changed method requires new development and a fresh blind cohort.
59
+
60
+ The [paired segmentation component comparison](evidence/v02/segmentation/component-comparison-summary.json) uses the same five public DEV photos and independent masks for both MobileSAM and GrabCut. Its corrected, oracle-assisted seed panel gives mean per-case mask IoU 0.859 versus 0.595; its 53-file runtime snapshot matches `c107ddf`, before the two later proposal prompt/presentation changes. The native backend implementations are unchanged. This supports a component comparison under supplied geometry, not end-to-end accuracy or a library-selected backend.
61
+
62
+ The new proposal development hypothesis separates mask completeness from whole-box completeness. It selects the same seeded instance by its actual foreground-derived rectangle, renders that rectangle, and confirms only the chosen candidate at source resolution. It retains source/ROI/seed checks and the same failure thresholds; no ground-truth padding or coordinates enter production. This changes two runtime files and is not a qualified replacement. The named [box-confirmation DEV40](evidence/v02/box-confirmation-dev40/report.json) completed independently: classification 35/40, whole-object matches 5/30 (photo 4/16, controlled map 1/7, UI 0/7), and zero false locations on ten negatives. Eight provider failures and unknown costs remain counted. Only one mask-annotated case returned a mask; neither of its two reference instances reaches IoU 0.8. These development results do not qualify release or extraction. A new two-hour monotonic run is active against `450439c` with two native threads; its interrupted one-thread setup run is retained as a failure, and no terminal resource result is claimed yet. The separate [native-only refinement component](evidence/v02/box-confirmation-dev40/component-refinement.json) reuses all eight predicted boxes/seeds and has no passing mask reference; it does not demonstrate a refinement benefit and no additional refiner is promoted. The [development selection](evidence/v02/box-confirmation-method-selection-20261020-v1.json) freezes the current recipe for a new independent blind cohort. The [corrected source-exclusion audit](evidence/v02/box-heldout-exclusion-audit-20261020-v1.json) covers all 160 exposed photos and their source groups; new source JPEG and official mask canvases must match exactly before admission.
63
+
64
+ The [new HELDOUT preparation](evidence/v02/box-heldout-source-review-20261020-v1.json) has separate strict candidate/control profiles and an 82-file source closure independently checked with the TypeScript parser. All 53 runtime sources still match the current resource/Windows-tested runtime. New synthetic normalization checks exercise both profiles successfully; no new blind request has been dispatched. The [photo cohort seal](evidence/v02/box-heldout-photo-seal-20261020-v1.json) records 30 positive/ten negative fresh photos with exact mask canvases, and the [independently reviewed Calculator proof](evidence/v02/calculator-proof-root-review-20261020-v1.json) supports [a sealed controlled UI20 cohort](evidence/v02/box-heldout-ui-seal-20261020-v1.json). The [controlled map20](evidence/v02/box-heldout-map-seal-20261021-v1.json) and [combined corpus/assets](evidence/v02/box-heldout-combined-seal-20261021-v1.json) are now sealed. The [new strict input/source freeze](evidence/v02/box-heldout-run-freeze-20261021-v1.json) binds the unchanged selection and 82-file producer; its SHA-256 is `31e6b96b485b1dccbbe10b2c5e222ca0c20f3adbe25ee027a682595a136d8650`. Resource completion, oracle-source integration and final source/CI review remain dispatch prerequisites.
65
+
66
+ The [excluded Wesnoth proof](evidence/v02/wesnoth-proof-root-review-20261020-v1.json) now independently confirms the source-derived minimap placement across 51 villages and all 1,297 changed pixels. Exact float32 repeated sampling resolves the original three edge discrepancies without padding or fitting. The projected support is still an upper bound, not a mask; the sealed controlled map20 uses isolated A/B/A marker deltas to establish visible boxes, with its per-case provenance kept separately. No fresh cohort image or per-case truth was read by this independent proof review, and no model accuracy is claimed from it.
67
+
68
+ A separate [reconstructed C03 diagnostic](evidence/v02/reconstructed-c03-box.json) finds box IoU 0.874 and reference-box coverage 0.986 against the original Dog annotation. The original producer rejected completeness and returned `unknown`; its mask was not saved. This replay does not repair that result, prove the original mask bytes, or measure mask IoU. A matching box alone cannot show that the mask-completeness verdict was wrong.
69
+
70
+ | Gate | Current status |
71
+ | ------------------------------------ | --------------------------------------------------------------------------------------------- |
72
+ | Source checks and installed consumer | Pass: 471 Linux tests / installed consumer at `9f85acc`; final release checks remain required |
73
+ | Hosted Windows/Linux × Node 22/24 | Pass at `9f85acc` on all four jobs; final release source CI remains required |
74
+ | Windows native execution | Pass for changed runtime in reviewed Windows archive; controlled input only |
75
+ | Two-hour resource soak | Old snapshot passed; fresh `450439c` two-thread run is active, no result yet |
76
+ | First frozen blind vision candidate | Failed both false-location and paired-bootstrap gates |
77
+ | Second frozen blind vision candidate | Failed: 1/60 whole boxes; paired lower bound zero; new development required |
78
+ | Text-only encoders | None qualified; public experimental image selector returns `UNSUPPORTED` |
79
+ | Publication | Pending all mandatory gates |
80
+
81
+ ## 0.2 development snapshot, 2026-10-20
82
+
83
+ The release is **not qualified or published yet**. The following table and paragraphs preserve earlier snapshots; the current gate state above takes precedence.
84
+
85
+ | Gate | Current evidence and remaining work |
86
+ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
87
+ | Runtime and installed archive | [Repaired runtime snapshot `0c365cb`](evidence/v02/integration-0c365cb.json); its 55 runtime/harness files remain unchanged in `24f849f`. The latter passes 368 offline source tests. |
88
+ | Windows native execution | [Actual installed-archive CPU acceptance](evidence/v02/native-proposal-windows-0c365cb.json): public locate/extract, physical cancellation, capacity and caller ownership; eight child starts/closes and none left. This uses controlled input, not a real game. |
89
+ | Hosted CI | [All four OS/Node jobs passed for `0c365cb`](evidence/v02/ci-0c365cb.json). [The later `24f849f` run](https://github.com/zoomplus/zorya-classifier/actions/runs/39431706865) passed source checks but rejected a machine-local path in documentation during archive inspection. That failure must be repaired without weakening the scanner, then the final source must pass again. |
90
+ | Resource retention | The original wall-clock proposal run has ended and is retained, but does not prove the required physical duration. The replacement monotonic run is in progress; the earlier `8010aad` result does not cover this pipeline. |
91
+ | Vision quality | [Complete repaired DEV2](evidence/v02/dev2-proposal-evaluation.md): 35/40 classifications correct, 1/30 positive whole-object matches, no false locations on ten negatives, and no mask reaching IoU 0.8. This is insufficient to qualify a winner. |
92
+ | Additional vision development | A completed ordinary-Luna photo screen returned no whole-object locations, mostly because of its 45-second operation deadline. The paired Qwen screen stopped on an unsupported route/configuration; those failures are not a measure of Qwen's visual accuracy. Failed and incomplete records remain preserved. Supported routes require separate frozen runs. |
93
+ | Text-only images | All six encoders remain unqualified and the public experimental selector rejects explicitly. |
94
+ | Blind qualification and publication | The first frozen HELDOUT run completed and failed qualification. A new development method requires a fresh blind cohort. GitHub/npm publication follows qualification, final archive inspection and final CI. |
95
+
96
+ Whole-object location, explicit extraction, optional native adapters and CLI are implemented and integrated. [Snapshot evidence](evidence/v02/integration-8010aad.json) records source commit, actual installed-archive hash and check results. The 254-test snapshot passed source gates and the independent consumer tested the old and new APIs with zero provider HTTP calls. Subsequent diagnostic/corpus integration passed 256 tests; these counts are offline evidence, not model accuracy.
97
+
98
+ The installed consumer imports core and segmentation entries and compiles declarations without ONNX Runtime. It exercises cutout/mask output with a controlled segmenter and proves caller ownership. The [native CPU smoke](https://github.com/zoomplus/zorya-classifier/blob/main/benchmarks/v02/native-smoke-evidence.md) separately exercised real MobileSAM on five licensed dev photographs with independent instance masks. These are distinct tests.
99
+
100
+ The configured two-hour Linux CPU resource run completed against the frozen native sources of `8010aad`: ten minutes of warmup followed by two idle windows and the 6,540-second busy phase. Its [numeric report](evidence/v02/resource-soak-linux-8010aad.json) records 4,756 segmented operations, matching child starts/closes and no owned children left. Before/after idle-median growth was approximately 7.4 MiB heap, 11.2 MiB external, 6.2 MiB array buffers and 43.8 MiB RSS, within the plan's thresholds. Sampling was scheduled every five seconds; actual gaps are recorded. Native Windows CPU component acceptance passed against the pinned installed archive: imports/declarations, real inference, cancellation, queue capacity and disposal left zero owned children. The [hardened report](evidence/v02/native-windows-eea1790.json) separates those lifecycle checks from mask quality. These tests use oracle boxes, not end-to-end localization. Live whole-object qualification and the experimental encoder's independent development/heldout gates remain pending. Historical 0.1 results below do not qualify these additions.
101
+
102
+ Hosted CI for source `32aa90d` passed every Windows/Linux × Node 22/24 job, including a clean installation, source checks, installed archive and formatting. [CI evidence](evidence/v02/ci-32aa90d.json) records the executed run; the final release still needs its own run. The earlier lockfile failure is retained separately. The [paired numeric/axis-ruler diagnostic](evidence/v02/presentation-paired-20261020.json) found no located positive target on the old exposed panel; neither vision presentation is qualified by that pilot.
103
+
104
+ The subsequent [CI run for `9d00fe5`](evidence/v02/ci-9d00fe5.json) passed all four Windows/Linux × Node 22/24 jobs with 316 offline tests and the installed-archive checks. Earlier platform-path and formatting failures remain preserved. This verifies that source snapshot, not a later untested release or real-provider accuracy.
105
+
106
+ All six text-image encoders remain research-only. The [fresh independent comparison](evidence/v02/fresh-text/README.md) is complete for photographs and real UI: every encoder has zero correct whole-object matches, and some violate the negative-case gate. None qualifies for heldout promotion. The initial classification harness defect and corrected classification-only follow-ups are preserved separately; they do not overwrite the localization runs. Failed protocol/rate-limit/truncated-generation diagnostics remain recorded. The public experimental image selector rejects explicitly. Historical controlled map/UI renders with model-assisted labels remain an exploratory supplement: their source licensing and split are recorded, but they do not close the independent-ground-truth gate.
107
+
108
+ Subsequent [whole-object prompt/presentation experiments](evidence/v02/boundary-variants.md) found one correctly bounded Car example after removing the separate seed crop and outlining that seed on the original. Boat still returned unknown; this is development evidence, not qualification. A [controlled real-UI oracle](https://github.com/zoomplus/zorya-classifier/blob/main/benchmarks/v02/corpus/dev-independent-ui/README.md) now independently derives seven button boxes from GTK accessibility allocations and verifies all painted edges in the captured pixels. Its three negatives are scoped to the completely inventoried visible toolbar. It is one controlled source family, not a diverse natural-UI benchmark.
109
+
110
+ The five-photo native reports also retain a subsequently discovered fixture limitation: the original Hat seed contains zero ground-truth foreground pixels, and the Cat seed center is background. Their historical results are preserved. These invalid or ambiguous grounding prompts must not be interpreted as a clean segmentation-quality comparison; corrected oracle prompts require a separate manifest and report. This does not change the physical lifecycle/resource scope of the original run.
111
+
112
+ The corrected installed-archive [Windows GrabCut component run](evidence/v02/native-grabcut-windows-4c494a3-run3.json) passed actual inference and lifecycle checks: ten child starts and ten closes, cancellation joined the physical close, three queued operations completed and one exceeded capacity, and the coordinator removed its own temporary directory after worker exit. Its five photo masks all remain below IoU 0.8, so lifecycle acceptance does not qualify mask quality. The first two harness failures are retained alongside the successful run. MobileSAM's oracle-box comparison reaches the threshold on four of five photos; this remains a component intervention, not end-to-end localization.
113
+
114
+ The [fresh independent 30-case development comparison](evidence/v02/fresh-development.md) is complete for numeric and outlined-axis vision variants: both classify 26/30, but whole-object localization reaches only 0/16 and 1/16 photographs respectively and no UI positives. These results remain unqualified. All provider failures, timeouts, unknowns and unknown charges are included. The new independent Freeciv map oracle is separately documented; its same-coordinate positives do not establish positional diversity. Heldout inputs and labels remain blind until a candidate is frozen.
115
+
116
+ The optional pixel-mask proposal path is now integrated in source `4c9c09f`, with [353 passing offline tests and an installed consumer](evidence/v02/integration-4c9c09f.json). The consumer compiles declarations and exercises both whole-object and cutout output without ONNX Runtime. A separately pinned native Linux smoke exercises the real CPU proposal adapter, physical cancellation, queue capacity and parent loss. The [native Windows installed-archive run](evidence/v02/native-proposal-windows-4c9c09f-retry1.json) also passes actual public locate/extract, caller ownership and cleanup: eight child starts, eight closes and zero owned children. Its initial checksum-constant harness failure is retained. These synthetic checks establish wiring and lifecycle, not photo accuracy. End-to-end masks will be measured independently of whole-object boxes. The matching hosted CI source/pack steps passed on all four OS/Node jobs; a single test-formatting failure is [preserved](evidence/v02/ci-4c9c09f.json), and final release CI remains mandatory.
117
+
118
+ ## Historical 0.1 executed checks and release gates
6
119
 
7
120
  | Check | Evidence |
8
121
  | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
package/docs/api.md CHANGED
@@ -1,24 +1,30 @@
1
1
  # Public API
2
2
 
3
- `createClassifier({ decision, timeoutMs?, concurrency?, maxQueue?, refinement? })` creates an owned client. Defaults: 45,000ms absolute budget including queue/image work/provider work; two active operations; sixteen waiters. Configured maxima: 120s, four active,32 queued. Input images are at most16MiB and16,777,216 decoded pixels; single PNG/JPEG/WebP only. The adapter accepts prepared PNG/JPEG with sides280..1568 and a32MiB total request cap. Byte inputs are copied before the first await, including Buffer views.
3
+ Spatial localization, whole-object location, extraction, `RefinementPort`, caller-owned segmentation/box-check composition, `objectProposals`, and native segmentation factories are **experimental and unqualified** for general use (TypeScript `@experimental` on the corresponding public types and methods). Closed `classify` and explicitly configured `DecisionPort`/transport adapters remain supported; they do not imply universal model accuracy. Further spatial accuracy experiments are stopped; no strategy is promoted.
4
+
5
+ `createClassifier({ decision, timeoutMs?, concurrency?, maxQueue?, maxInputBytes?, refinement?, segmentation?, objectProposals? })` creates an owned client. Defaults: 45,000ms absolute budget including queue/image work/provider work; two active operations; sixteen waiters; 64 MiB total admitted input bytes, reserved before copying. Configured maxima: 120s, four active,32 queued,256 MiB admitted input. Input images are at most16MiB and16,777,216 decoded pixels, with source sides at most16,384; single PNG/JPEG/WebP only. The vision adapter accepts prepared PNG/JPEG with sides280..1568 and a32MiB total request cap. Byte inputs are copied before the first await, including Buffer views.
6
+
7
+ The caller supplies the `DecisionPort`; the library never chooses a model, provider or endpoint. You may inject a port directly or explicitly construct one of the adapters below. Their model/provider values are examples or benchmark recipes, not defaults, and stronger models do not guarantee higher accuracy. Optional segmentation adapters are configured separately and require caller-installed runtime packages and caller-supplied local assets.
8
+
9
+ The [0.2 guide](v02-usage.md) documents `extract`, mask-derived `locate({ mode: 'whole-object', ... })`, optional native adapters and the reserved experimental representation selector. Default region behavior is unchanged. The primary object flow runs the original region locator, then prompts the caller-configured segmenter on the full oriented source image; the actual mask determines bounds, center and cutout. A closed containment check then sees the full source with the actual mask-derived box and seed anchor. An incomplete box can trigger one optional `SegmentationPort.expand(input, previousMask)` and one final check; missing support or unresolved verification returns `unknown/segmentation-uncertain`. The previous mask is full-source binary-u8. `segmentationBoxCheck` can inject a custom checker; otherwise the same caller-supplied `decision` is reused. `verification.checks` retains each closed decision and `verification.expansion` records the correction path; all decision receipts contribute to localization metadata. This checks box containment separately from pixel-mask quality, without an extent search. Native factories are exported from `zorya-classifier/segmentation`; the caller supplies and disposes the segmenter separately. `objectProposals` and interval-based whole-object location remain optional legacy strategies. The segmentation entry also exports `packBinaryMask`/`unpackBinaryMask` for custom adapters.
4
10
 
5
11
  `classify({ input, classes, instructions?, signal? })`: input is a string or `{ text?, image? }` with at least one field. Classes are2..255 distinct IDs plus descriptions. IDs match `[a-zA-Z][a-zA-Z0-9_-]*`; descriptions at most300 chars. Text is at most32,000 chars, custom instructions4,000. Define explicit none/other behavior in your classes. With ordinary vision models the result contains `choice` (first ranked ID), `ranking`, `probabilities: null`, `nativeChoice: null`, empty `tied`, and metadata. No rank is converted to a fabricated probability. Optional native integrations instead retain raw probabilities, stable maximum/ties, native choice/confidence and optional quantization annotation. Confidence is never a calibrated spatial guarantee.
6
12
 
7
- `locate({ image, target, exclusions?, roi?, signal? })`: target at most2,000 chars; up to16 exclusions of500 chars. ROI uses integer `left/top/width/height` in EXIF-oriented source pixels. Return coordinates reference that oriented image; metadata names this space and dimensions. Rectangles include left/top and exclude right/bottom. Normalized rectangle fields are divided by image dimensions. Tiny/impossible bounded grids return `unknown/layout-limit`.
13
+ `locate({ image, target, exclusions?, roi?, signal? })` (**experimental**): target at most2,000 chars; up to16 exclusions of500 chars. ROI uses integer `left/top/width/height` in EXIF-oriented source pixels. Return coordinates reference that oriented image; metadata names this space and dimensions. Rectangles include left/top and exclude right/bottom. Normalized rectangle fields are divided by image dimensions. Tiny/impossible bounded grids return `unknown/layout-limit`.
8
14
 
9
- `located` returns a selected grid region, normalized region, third-stage selection evidence and optional refinement. `not-found/absent-in-evaluated-region` is based on the initial independent presence check. A target missing from later shortlisted cells yields `unknown/candidate-union-empty`, not global absence. Ordinary models return present/absent/unknown as an independent categorical predicate. Legacy Noul0.5 abstains; contradictory presence/selection returns unknown. Multiple physical matching objects are permitted; this is an any-instance locator.
15
+ `located` from default region mode returns a selected grid region, normalized region, third-stage selection evidence and optional refinement. `not-found/absent-in-evaluated-region` is based on the initial independent presence check. A target missing from later shortlisted cells yields `unknown/candidate-union-empty`, not global absence. Ordinary models return present/absent/unknown as an independent categorical predicate. Legacy Noul0.5 abstains; contradictory presence/selection returns unknown. Multiple physical matching objects are permitted; this is an any-instance locator. With an explicit `segmentation` port, `locate({ mode: 'whole-object' })` and `extract` use the region seed plus full-source segmentation; reported bounds and center come from the valid mask.
10
16
 
11
17
  The algorithm searches4×4 coarse cells, keeps four source-distinct maxima, pads each by half a coarse cell within ROI, partitions each into at most49 fine cells (global≤196, side≤256), then compares the four best fine cells as enlarged A–D/none. Edges count as matches. Scores/rank hints are not sent to the final comparison. No cell-center correction is presented as object segmentation.
12
18
 
13
- `RefinementPort.refine({ image, target, region, signal })` is optional trusted code. It receives a private oriented-source byte copy. A returned refined rectangle must fit the source and intersect the selected cell. It does not replace the original area evidence. No built-in heavy refiner is downloaded.
19
+ `RefinementPort.refine({ image, target, region, signal })` (**experimental**) is optional trusted code. It receives a private oriented-source byte copy. A returned refined rectangle must fit the source and intersect the selected cell. It does not replace the original area evidence. No built-in heavy refiner is downloaded.
14
20
 
15
21
  `dispose()` cancels current/queued work, rejects further calls and waits for physical settlement. Injected ports must honor cancellation. Native image work retains its concurrency slot until completion, even if cancellation has already been requested.
16
22
 
17
23
  `ClassifierError.code`: INVALID_INPUT, INVALID_RESPONSE, TIMEOUT, ABORTED, CAPACITY, DISPOSED, PROVIDER, AUTHENTICATION, UNSUPPORTED, RESOURCE_LIMIT. Transport failures throw; they are not successful negative classifications. Provider metadata uses null for unknown model/provider/request/cost. Localization adds knownCostUsd and unknownCostCount; knownCostUsd alone is not a complete bill when unknownCostCount>0.
18
24
 
19
- ## Native decision models (primary integration)
25
+ ## Optional native decision adapter
20
26
 
21
- `createOpenRouterDecisions({ apiKey, model, provider, providerName?, responseModelIds?, probabilityRoundingStep?, fetch?, maxRequestBytes?, maxResponseBytes? })` uses the typed `/api/alpha/decisions` endpoint. The primary documented route is `openai/gpt-6-luna-decisions` / `openai`. Model and provider are required; `provider.only` disables fallback. Compatible native models can be supplied explicitly; vision support and factual quality must be checked per model. Jev is not required.
27
+ `createOpenRouterDecisions({ apiKey, model, provider, providerName?, responseModelIds?, probabilityRoundingStep?, fetch?, maxRequestBytes?, maxResponseBytes? })` uses the typed `/api/alpha/decisions` endpoint. One documented example route is `openai/gpt-6-luna-decisions` / `openai`. Model and provider are required; `provider.only` disables fallback. Compatible native models can be supplied explicitly; vision support and factual quality must be checked per model. Jev is not required. The adapter is opt-in and is never selected by the library on its own.
22
28
 
23
29
  The adapter sends the exact Choice criteria and independent Noul questions, preserving genuine raw distributions and metadata. Internal chat-only `rankingSize` hints are stripped from the native wire request. Model/provider identity, question correspondence, complete finite probabilities and the categorical maximum are verified. Valid date-stamped model snapshots are accepted. `probabilityRoundingStep` is unset by default: a selected model does not inherit Jev's observed0.01 wire quantization. Set it explicitly only with supporting provider/wire evidence; values are still never normalized.
24
30
 
@@ -1,20 +1,33 @@
1
1
  # Architecture and lifecycle
2
2
 
3
- The public factory composes a DecisionPort and a Sharp-backed RasterPort. Processes orchestrate classify/locate; features contain pure Choice interpretation, grid geometry and prompt construction; entities define validated public contracts; infrastructure owns provider HTTP and image processing. No application runtime, game-state schema or workspace import is required.
3
+ Closed `classify` and injected `DecisionPort`/adapter transport are supported integration paths. Region `locate`, whole-object location, extraction, `RefinementPort`, caller-owned segmentation and box-check composition, `ObjectProposalPort`, and explicit native segmentation factories are experimental and unqualified; they are labeled `@experimental` on the public API. No spatial or extraction strategy is promoted; evidence under `docs/evidence/**` remains historical.
4
+
5
+ The public factory composes the caller-supplied `DecisionPort` and a Sharp-backed `RasterPort`. The library does not select a model, provider or endpoint; applications either inject an existing port or explicitly build one with a supported adapter. Processes orchestrate classify/locate; features contain pure Choice interpretation, grid geometry and prompt construction; entities define validated public contracts; infrastructure owns provider HTTP and image processing. No application runtime, game-state schema or workspace import is required.
6
+
7
+ The primary 0.2 object path preserves the original region locator. Its selected seed prompts an explicitly configured segmenter on the full oriented source image; actual mask pixels determine bounds, center and the optional cutout. A generic closed containment checker receives the full source with the mask-derived box and original seed anchor. It uses the injected decision port and a presentation port; the process allows at most one actual enclosing-mask correction and a final check. The segmenter can implement optional `expand`; corrected foreground must strictly contain the old visible foreground and grow the real box within the hard ROI. The process rejects unresolved checks without publishing a partial cutout. Its absolute deadline, cancellation and byte ownership cover every stage. No additional extent search or model-generated coordinates are used. `locate({ mode: 'whole-object' })` and `extract` use the same mask-derived geometry when a segmenter is configured. Boundary-interval location and `ObjectProposalPort` remain optional legacy strategies with their own request flows.
8
+
9
+ Extraction composes the selected locator with a caller-owned `SegmentationPort` and a `CutoutRasterPort`; processes import neither Sharp nor native inference. Explicitly created native adapters own their workers and queues, while the caller supplies and manages their optional runtime packages and local model assets. No weights are selected, installed or downloaded by the library. [Operation and ownership details](v02-usage.md) are explicit; no experimental text-image profile is publicly qualified yet.
4
10
 
5
11
  ```mermaid
6
12
  flowchart LR
7
13
  I[Owned input snapshot] --> G[Bounded operation queue]
8
14
  G --> C[Classify: closed class ranking]
9
- G --> L[Locate: coarse ranking]
10
- L --> F[Fine-grid ranking]
11
- F --> V[Candidate comparison]
12
- V --> R[Source region]
13
- R --> O[Optional injected refinement]
15
+ G --> L[Original region locator: up to three requests]
16
+ L --> S[Caller-owned segmenter on full source with seed prompt]
17
+ S --> M[Validate mask and derive visible bounds / center]
18
+ M --> B[Closed box check on full source and seed anchor]
19
+ B -->|complete| X[Optional transparent cutout]
20
+ B -->|unknown| U[Explicit unresolved result]
21
+ B -->|needs expansion| E[At most one actual enclosing-mask correction]
22
+ E --> R[Validate foreground containment and recheck actual box]
23
+ R -->|complete| X
24
+ R -->|unresolved / no parent| U
14
25
  ```
15
26
 
16
27
  One deadline covers the whole operation, including queue time. AbortSignal passes through every boundary; guards after awaits reject late results. Physical Sharp/provider work retains its slot until its promise settles. Timers/listeners are cleared in finally. There is no import-time worker, automatic retry, persistent image cache, database or background polling loop.
17
28
 
29
+ The box renderer preserves the full source canvas. The injected raster `imageState` then prepares the whole rendered image for the transport, preserving aspect ratio with explicit scale/padding metadata and prepared sides between 280 and 1568 pixels. This never crops to the selected box and never changes the mask's source-space coordinates. Public-adapter regressions exercise both 64×48 and 1920×1080 inputs; DecisionPort-only fixtures do not exercise transport size validation.
30
+
18
31
  Transport validates complete question/answer correspondence, probabilities, identity and byte limits. Errors omit credentials, provider bodies and raw user media. Raw images exist only for the active operation unless an explicit caller-owned diagnostic wrapper records requests. Scores are not mixed across Choice distributions or interpreted as pixel/pose confidence.
19
32
 
20
33
  Image handling normalizes EXIF orientation, validates bounded decode, crops in source pixels and prepares PNG presentations with recorded aspect-ratio/padding transforms. Labels map to exact canonical rectangles. Original and clean crops remain available alongside grid overlays. Final candidate pixels are source crops enlarged with integer nearest-neighbor scale.
@@ -23,10 +36,12 @@ Extraction differences from the gaming service: the public result is an area; mu
23
36
 
24
37
  ESLint catches common promise/race/interval errors and architectural checks reject private imports/cycles. These checks cannot prove native memory safety; tests additionally exercise cancellation, queue overload, late completion, input mutation and repeated lifecycle disposal.
25
38
 
39
+ Knip checks the dynamically started native-worker entry. Its dependency allowlist contains only `onnxruntime-node`: Knip 5 flags referenced optional peers, while this package intentionally loads it only inside the explicit MobileSAM worker. The installed-archive check proves that core and segmentation entries import and their declarations compile without ONNX; requesting MobileSAM then fails explicitly. Other dependency/export checks remain enabled.
40
+
26
41
  ## Model and provider independence
27
42
 
28
43
  `createOpenAICompatibleVision` accepts a trusted direct chat-completions endpoint, model ID, optional key/custom headers, and the same bounded transport policies. `createOpenRouterVision` adds explicit OpenRouter-only routing around that transport. Neither requires a native classifier endpoint. The core knows only `DecisionPort`; a non-OpenAI-compatible SDK can implement that port without changing geometry or lifecycle.
29
44
 
30
45
  Ordinary language models receive images/text, closed option descriptions and a JSON answer schema. They return ranked IDs and independent categorical presence evidence. These are validated against the exact supplied questions/options; no ranks are converted to fake probabilities. The optional legacy native integration retains probability-valued answers for compatibility and historical benchmarking. A malformed/refused/truncated answer remains an error; it is never silently retried through another backend.
31
46
 
32
- The primary native integration is `createOpenRouterDecisions` with explicit model/provider, initially Luna Decisions. It shares bounded snapshots/HTTP cleanup with the optional Jev wrapper and strips internal rank-count hints from the typed wire request. Native probability checks remain separate from ordinary chat ranking. Jev-specific quantization is never silently applied to another model.
47
+ `createOpenRouterDecisions` is one optional adapter for a caller-chosen native model/provider. Luna Decisions appears in examples and benchmark recipes; it is not a library default. The adapter shares bounded snapshots/HTTP cleanup with the optional Jev wrapper and strips internal rank-count hints from the typed wire request. Native probability checks remain separate from ordinary chat ranking. Jev-specific quantization is never silently applied to another model. Results from one route do not imply that a stronger model will improve every task.
@@ -12,6 +12,16 @@ Metrics include classification accuracy/macro-F 1/confusion, errors in the denom
12
12
 
13
13
  Offline fixture tests validate mechanics only. Actual provider outcomes are recorded in [results](results.md), acceptance and the run reports. Keep failed and incomplete runs. Never silently retry errors, alter labels or discard difficult images to improve headline metrics.
14
14
 
15
+ ## 0.2 checked region and segmentation recipe
16
+
17
+ The [region-seeded runner](https://github.com/zoomplus/zorya-classifier/blob/main/benchmarks/v02/region-seeded-runner.md) records the original region search separately from full-source segmentation and up to two closed visible-box checks. The caller configures the model, native adapter and presence guard explicitly. Its [v3 development freeze](evidence/v02/region-seeded-development-freeze-20261021-v3.json), [prospective control-R2 correction](evidence/v02/region-seeded-development-control-r2-freeze-20261021.json) and [independent results](evidence/v02/region-seeded-dev-v3-control-r2/README.md) retain the original identity-authoring failure. A separate offline verifier rejects reuse of candidate prompt policies in the control identity before dispatch.
18
+
19
+ The historical hash helper serializes JSON in insertion order; it does not sort every object's keys. Freeze the exact producer-shaped object for each variant, including its distinct prompt policy. Reordering a spread can change its digest even when the values look equivalent. Keep failed pre-dispatch drafts rather than changing the historical hash algorithm. The [all-attempt ledger](evidence/v02/region-seeded-dev-v3-control-r2/attempt-accounting.json) includes charges from the original unscored control as well as the valid pair.
20
+
21
+ These research runners preserve host-specific historical default paths. In another checkout, pass explicit `--image-root`, `--photo-inputs`, `--ui-inputs`, `--map-inputs`, `--encoder` and `--decoder` paths; use `--env-file` for the explicitly authorized paid run. Keep the corresponding input SHA-256 flags and phase freeze consistent. Core library clients take explicit ports and do not read these benchmark configuration files.
22
+
23
+ Region-fragment hits, mask-derived box matches and exact-canvas mask IoU are different measurements. The image-free control has no segmenter and cannot produce an object mask. The current comparison uses all 40 cases per profile, including unknowns/errors, and reports native quality separately from semantic model decisions. Its 20 photos, ten controlled UI captures and ten controlled map captures do not establish broad game or UI coverage. The [conditional selection](evidence/v02/region-seeded-method-selection-20261021-v3.json) precedes any new blind pixels or truth; the [acceptance record](acceptance.md) determines current release eligibility.
24
+
15
25
  ## Current native Luna Decisions reproduction
16
26
 
17
27
  For an independent fresh run of the selected non-Jev route, fetch the corpus, set your own `OPENROUTER_API_KEY`, then explicitly opt in:
@@ -0,0 +1,26 @@
1
+ # Caller-owned categorical presence composition
2
+
3
+ `examples/categorical-presence-port.ts` shows how to wrap an injected public `DecisionPort` for services that answer closed Choice questions. The wrapper sends the original Choice questions and translated presence questions together in one delegate call. The translated classes are `present`, `absent`, and `unknown`; their instructions retain the exact original proposition. Existing scored Choice answers are returned unchanged. For translated questions, a valid probability distribution is reduced to the first maximum in criteria order, while a rank-only answer remains categorical and does not acquire invented scores.
4
+
5
+ The example is source code in this repository, not an npm subpath export. To adapt it in an application, install the public package and its direct Zod dependency, copy the example source into your project, and inject a `DecisionPort` you have configured:
6
+
7
+ ```sh
8
+ npm install zorya-classifier zod@3.25.76
9
+ ```
10
+
11
+ ```ts
12
+ import { createClassifier, type DecisionPort } from 'zorya-classifier'
13
+ import { createCategoricalPresencePort } from './categorical-presence-port.js'
14
+
15
+ declare const configuredDecision: DecisionPort // supplied by your application
16
+
17
+ const classifier = createClassifier({
18
+ decision: createCategoricalPresencePort(configuredDecision),
19
+ timeoutMs: 120_000, // benchmark recipe limit; production callers should choose their own deadline
20
+ })
21
+ // After your operations finish, await classifier.dispose().
22
+ ```
23
+
24
+ The caller owns the wrapped port and its delegate. Inject the returned port into `createClassifier({ decision: ... })`; choose and configure the actual service outside this example. The wrapper snapshots the request before awaiting, validates closed IDs and answer shape, passes through the caller's `AbortSignal`, and fails if cancellation arrives during the delegate call. To preserve auditability, record the delegate's raw response at the transport boundary before this wrapper converts it.
25
+
26
+ This composition mirrors the categorical protocol selected in development. That profile still requires independent blind qualification; neither the source example nor fixture tests qualify a model or make this a default SDK behavior. The 120-second timeout is the benchmark recipe, not a recommended universal production setting. The offline tests exercise only local fixtures; they make no provider or native calls.