indw 1.0__tar.gz

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 (431) hide show
  1. indw-1.0/LICENSE +190 -0
  2. indw-1.0/NOTICE +17 -0
  3. indw-1.0/PKG-INFO +279 -0
  4. indw-1.0/README.md +219 -0
  5. indw-1.0/app/cli.py +34 -0
  6. indw-1.0/app/commands/__init__.py +16 -0
  7. indw-1.0/app/commands/audit.py +22 -0
  8. indw-1.0/app/commands/benchmark.py +15 -0
  9. indw-1.0/app/commands/doctor.py +22 -0
  10. indw-1.0/app/commands/merge.py +43 -0
  11. indw-1.0/app/commands/test.py +20 -0
  12. indw-1.0/app/commands/validate.py +15 -0
  13. indw-1.0/app/workflows.py +70 -0
  14. indw-1.0/indw.egg-info/PKG-INFO +279 -0
  15. indw-1.0/indw.egg-info/SOURCES.txt +429 -0
  16. indw-1.0/indw.egg-info/dependency_links.txt +1 -0
  17. indw-1.0/indw.egg-info/entry_points.txt +2 -0
  18. indw-1.0/indw.egg-info/requires.txt +46 -0
  19. indw-1.0/indw.egg-info/top_level.txt +2 -0
  20. indw-1.0/pyproject.toml +85 -0
  21. indw-1.0/setup.cfg +4 -0
  22. indw-1.0/src/indw/__init__.py +42 -0
  23. indw-1.0/src/indw/_compat.py +35 -0
  24. indw-1.0/src/indw/clean/__init__.py +29 -0
  25. indw-1.0/src/indw/clean/artifact/calibrate.py +80 -0
  26. indw-1.0/src/indw/clean/artifact/confidence.py +132 -0
  27. indw-1.0/src/indw/clean/artifact/decompose.py +265 -0
  28. indw-1.0/src/indw/clean/artifact/discovery_clean.py +57 -0
  29. indw-1.0/src/indw/clean/artifact/discovery_config.py +74 -0
  30. indw-1.0/src/indw/clean/artifact/discovery_corpus.py +364 -0
  31. indw-1.0/src/indw/clean/artifact/discovery_engine.py +229 -0
  32. indw-1.0/src/indw/clean/artifact/discovery_registry.py +191 -0
  33. indw-1.0/src/indw/clean/artifact/discovery_structural.py +48 -0
  34. indw-1.0/src/indw/clean/artifact/discovery_validation.py +54 -0
  35. indw-1.0/src/indw/clean/artifact/engine.py +161 -0
  36. indw-1.0/src/indw/clean/artifact/evidence.py +73 -0
  37. indw-1.0/src/indw/clean/artifact/evidence_cache.py +348 -0
  38. indw-1.0/src/indw/clean/artifact/evidence_engine.py +328 -0
  39. indw-1.0/src/indw/clean/artifact/evidence_features.py +197 -0
  40. indw-1.0/src/indw/clean/artifact/evidence_model.py +536 -0
  41. indw-1.0/src/indw/clean/artifact/evidence_util.py +71 -0
  42. indw-1.0/src/indw/clean/artifact/novelty.py +34 -0
  43. indw-1.0/src/indw/clean/artifact/positional.py +29 -0
  44. indw-1.0/src/indw/clean/artifact/registry.py +139 -0
  45. indw-1.0/src/indw/clean/artifact/safeguards.py +42 -0
  46. indw-1.0/src/indw/clean/artifact/strip.py +144 -0
  47. indw-1.0/src/indw/clean/artifact/trim.py +76 -0
  48. indw-1.0/src/indw/clean/corpus.py +712 -0
  49. indw-1.0/src/indw/clean/document/adaptive.py +161 -0
  50. indw-1.0/src/indw/clean/document/boilerplate.py +71 -0
  51. indw-1.0/src/indw/clean/document/clean.py +56 -0
  52. indw-1.0/src/indw/clean/document/code_preservation.py +287 -0
  53. indw-1.0/src/indw/clean/document/compression.py +109 -0
  54. indw-1.0/src/indw/clean/document/config.py +148 -0
  55. indw-1.0/src/indw/clean/document/conversation.py +219 -0
  56. indw-1.0/src/indw/clean/document/dedup.py +33 -0
  57. indw-1.0/src/indw/clean/document/html.py +189 -0
  58. indw-1.0/src/indw/clean/document/license.py +702 -0
  59. indw-1.0/src/indw/clean/document/metrics.py +293 -0
  60. indw-1.0/src/indw/clean/document/normalize.py +136 -0
  61. indw-1.0/src/indw/clean/document/patterns.py +96 -0
  62. indw-1.0/src/indw/clean/document/segment.py +217 -0
  63. indw-1.0/src/indw/clean/document/stage_manifest.py +94 -0
  64. indw-1.0/src/indw/clean/document/stats.py +134 -0
  65. indw-1.0/src/indw/clean/document/ui.py +103 -0
  66. indw-1.0/src/indw/clean/document/validate.py +105 -0
  67. indw-1.0/src/indw/clean/document/value.py +557 -0
  68. indw-1.0/src/indw/clean/gate/evaluate.py +502 -0
  69. indw-1.0/src/indw/clean/gate/policy.py +88 -0
  70. indw-1.0/src/indw/clean/meta/clean.py +225 -0
  71. indw-1.0/src/indw/clean/meta/foundation.py +505 -0
  72. indw-1.0/src/indw/clean/meta/patterns.py +358 -0
  73. indw-1.0/src/indw/clean/meta/stats.py +72 -0
  74. indw-1.0/src/indw/clean/meta/strip.py +319 -0
  75. indw-1.0/src/indw/clean/semantic/boilerplate.py +102 -0
  76. indw-1.0/src/indw/clean/semantic/classifier.py +174 -0
  77. indw-1.0/src/indw/clean/semantic/clean.py +145 -0
  78. indw-1.0/src/indw/clean/semantic/config.py +114 -0
  79. indw-1.0/src/indw/clean/semantic/embedded.py +396 -0
  80. indw-1.0/src/indw/clean/semantic/fingerprints.py +89 -0
  81. indw-1.0/src/indw/clean/semantic/ocr_normalize.py +91 -0
  82. indw-1.0/src/indw/clean/semantic/pipeline.py +241 -0
  83. indw-1.0/src/indw/clean/semantic/report.py +126 -0
  84. indw-1.0/src/indw/clean/semantic/routing.py +146 -0
  85. indw-1.0/src/indw/clean/semantic/scoring.py +86 -0
  86. indw-1.0/src/indw/clean/semantic/section_artifacts.py +345 -0
  87. indw-1.0/src/indw/clean/semantic/spec.py +8 -0
  88. indw-1.0/src/indw/clean/semantic/structure.py +241 -0
  89. indw-1.0/src/indw/clean/semantic/thresholds.py +52 -0
  90. indw-1.0/src/indw/clean/structure/__init__.py +35 -0
  91. indw-1.0/src/indw/clean/structure/extract.py +121 -0
  92. indw-1.0/src/indw/clean/structure/labeled_qa.py +104 -0
  93. indw-1.0/src/indw/clean/structure/reference_sections.py +87 -0
  94. indw-1.0/src/indw/config/__init__.py +44 -0
  95. indw-1.0/src/indw/config/defaults.py +147 -0
  96. indw-1.0/src/indw/config/loader.py +215 -0
  97. indw-1.0/src/indw/config/resolve.py +171 -0
  98. indw-1.0/src/indw/config/validation.py +103 -0
  99. indw-1.0/src/indw/dedup/__init__.py +21 -0
  100. indw-1.0/src/indw/dedup/backends/__init__.py +21 -0
  101. indw-1.0/src/indw/dedup/backends/fuzzy.py +7 -0
  102. indw-1.0/src/indw/dedup/embed/__init__.py +10 -0
  103. indw-1.0/src/indw/dedup/embed/ann.py +61 -0
  104. indw-1.0/src/indw/dedup/embed/candidate.py +84 -0
  105. indw-1.0/src/indw/dedup/embed/cluster.py +45 -0
  106. indw-1.0/src/indw/dedup/embed/config.py +59 -0
  107. indw-1.0/src/indw/dedup/embed/contracts.py +104 -0
  108. indw-1.0/src/indw/dedup/embed/e5.py +324 -0
  109. indw-1.0/src/indw/dedup/embed/pipeline.py +212 -0
  110. indw-1.0/src/indw/dedup/embed/pools/__init__.py +0 -0
  111. indw-1.0/src/indw/dedup/embed/pools/gpu_worker.py +34 -0
  112. indw-1.0/src/indw/dedup/embed/providers.py +93 -0
  113. indw-1.0/src/indw/dedup/embed/representative.py +20 -0
  114. indw-1.0/src/indw/dedup/embed/similarity.py +36 -0
  115. indw-1.0/src/indw/dedup/embed/threshold.py +47 -0
  116. indw-1.0/src/indw/dedup/exact.py +173 -0
  117. indw-1.0/src/indw/dedup/fuzzy.py +110 -0
  118. indw-1.0/src/indw/dedup/normalize.py +58 -0
  119. indw-1.0/src/indw/dedup/replay.py +68 -0
  120. indw-1.0/src/indw/dedup/semantic.py +140 -0
  121. indw-1.0/src/indw/dedup/service/__init__.py +3 -0
  122. indw-1.0/src/indw/dedup/service/exact_shard.py +106 -0
  123. indw-1.0/src/indw/dedup/storage.py +60 -0
  124. indw-1.0/src/indw/extract/__init__.py +20 -0
  125. indw-1.0/src/indw/extract/assess/doc_type.py +64 -0
  126. indw-1.0/src/indw/extract/assess/engine.py +226 -0
  127. indw-1.0/src/indw/extract/assess/feedback.py +79 -0
  128. indw-1.0/src/indw/extract/assess/metrics.py +116 -0
  129. indw-1.0/src/indw/extract/assess/quality.py +70 -0
  130. indw-1.0/src/indw/extract/core/clean.py +389 -0
  131. indw-1.0/src/indw/extract/core/context.py +312 -0
  132. indw-1.0/src/indw/extract/core/profile.py +223 -0
  133. indw-1.0/src/indw/extract/core/units.py +1020 -0
  134. indw-1.0/src/indw/extract/nav/context.py +442 -0
  135. indw-1.0/src/indw/extract/nav/metrics.py +138 -0
  136. indw-1.0/src/indw/extract/nav/template.py +83 -0
  137. indw-1.0/src/indw/extract/roles/education.py +551 -0
  138. indw-1.0/src/indw/extract/roles/forum.py +733 -0
  139. indw-1.0/src/indw/extract/roles/publication.py +1053 -0
  140. indw-1.0/src/indw/extract/roles/units.py +246 -0
  141. indw-1.0/src/indw/extract/sections/boundaries.py +535 -0
  142. indw-1.0/src/indw/extract/sections/classify.py +594 -0
  143. indw-1.0/src/indw/extract/sections/integrity.py +462 -0
  144. indw-1.0/src/indw/extract/sections/quality.py +440 -0
  145. indw-1.0/src/indw/extract/sections/scratch.py +37 -0
  146. indw-1.0/src/indw/extract/sections/semantic.py +522 -0
  147. indw-1.0/src/indw/extract/structure/aggregate.py +773 -0
  148. indw-1.0/src/indw/extract/structure/analyze.py +150 -0
  149. indw-1.0/src/indw/extract/structure/document.py +67 -0
  150. indw-1.0/src/indw/extract/structure/inline.py +457 -0
  151. indw-1.0/src/indw/extract/structure/recovery.py +68 -0
  152. indw-1.0/src/indw/extract/structure/segment.py +129 -0
  153. indw-1.0/src/indw/filter/__init__.py +23 -0
  154. indw-1.0/src/indw/filter/content/code.py +681 -0
  155. indw-1.0/src/indw/filter/content/domain.py +65 -0
  156. indw-1.0/src/indw/filter/content/filters.py +504 -0
  157. indw-1.0/src/indw/filter/content/metadata.py +143 -0
  158. indw-1.0/src/indw/filter/decide/calibrate.py +207 -0
  159. indw-1.0/src/indw/filter/decide/curator.py +92 -0
  160. indw-1.0/src/indw/filter/decide/engine.py +302 -0
  161. indw-1.0/src/indw/filter/decide/policy.py +374 -0
  162. indw-1.0/src/indw/filter/decide/threshold.py +160 -0
  163. indw-1.0/src/indw/filter/gate/diagnostics.py +90 -0
  164. indw-1.0/src/indw/filter/gate/quality.py +528 -0
  165. indw-1.0/src/indw/filter/gate/reports.py +153 -0
  166. indw-1.0/src/indw/filter/gate/scorer.py +77 -0
  167. indw-1.0/src/indw/filter/language/bridge.py +54 -0
  168. indw-1.0/src/indw/filter/language/confidence.py +42 -0
  169. indw-1.0/src/indw/filter/language/config.py +132 -0
  170. indw-1.0/src/indw/filter/language/detect.py +168 -0
  171. indw-1.0/src/indw/filter/language/fast_detector.py +86 -0
  172. indw-1.0/src/indw/filter/language/mixed.py +85 -0
  173. indw-1.0/src/indw/filter/language/reports.py +127 -0
  174. indw-1.0/src/indw/filter/language/script.py +339 -0
  175. indw-1.0/src/indw/filter/language/script_metrics.py +157 -0
  176. indw-1.0/src/indw/filter/language/script_opt.py +141 -0
  177. indw-1.0/src/indw/filter/language/script_orch.py +84 -0
  178. indw-1.0/src/indw/filter/language/script_policy.py +40 -0
  179. indw-1.0/src/indw/filter/language/script_table.py +127 -0
  180. indw-1.0/src/indw/filter/language/stats.py +39 -0
  181. indw-1.0/src/indw/filter/language/telemetry.py +161 -0
  182. indw-1.0/src/indw/filter/language/token_metrics.py +121 -0
  183. indw-1.0/src/indw/filter/language/validation.py +218 -0
  184. indw-1.0/src/indw/filter/license/classifier.py +68 -0
  185. indw-1.0/src/indw/filter/license/config.py +89 -0
  186. indw-1.0/src/indw/filter/license/detector.py +188 -0
  187. indw-1.0/src/indw/filter/license/manifest.py +70 -0
  188. indw-1.0/src/indw/filter/license/normalize.py +140 -0
  189. indw-1.0/src/indw/filter/license/policy.py +244 -0
  190. indw-1.0/src/indw/filter/license/record.py +74 -0
  191. indw-1.0/src/indw/filter/license/reports.py +104 -0
  192. indw-1.0/src/indw/filter/license/schema.py +101 -0
  193. indw-1.0/src/indw/filter/license/source_policy.py +157 -0
  194. indw-1.0/src/indw/filter/pii/config.py +130 -0
  195. indw-1.0/src/indw/filter/pii/context.py +72 -0
  196. indw-1.0/src/indw/filter/pii/detect.py +76 -0
  197. indw-1.0/src/indw/filter/pii/entities.py +182 -0
  198. indw-1.0/src/indw/filter/pii/redaction.py +25 -0
  199. indw-1.0/src/indw/filter/pii/reports.py +96 -0
  200. indw-1.0/src/indw/filter/pii/risk.py +91 -0
  201. indw-1.0/src/indw/filter/pii/secrets.py +206 -0
  202. indw-1.0/src/indw/filter/pii/validation.py +180 -0
  203. indw-1.0/src/indw/filter/refine/audit.py +124 -0
  204. indw-1.0/src/indw/filter/refine/corpus.py +226 -0
  205. indw-1.0/src/indw/filter/refine/processor.py +102 -0
  206. indw-1.0/src/indw/filter/refine/rewrite.py +146 -0
  207. indw-1.0/src/indw/filter/refine/settings.py +74 -0
  208. indw-1.0/src/indw/filter/refine/truncation.py +189 -0
  209. indw-1.0/src/indw/filter/score/adaptive.py +65 -0
  210. indw-1.0/src/indw/filter/score/analysis.py +274 -0
  211. indw-1.0/src/indw/filter/score/artifacts.py +174 -0
  212. indw-1.0/src/indw/filter/score/builder.py +167 -0
  213. indw-1.0/src/indw/filter/score/canonical.py +112 -0
  214. indw-1.0/src/indw/filter/score/continuous.py +199 -0
  215. indw-1.0/src/indw/filter/score/engine.py +41 -0
  216. indw-1.0/src/indw/filter/score/signals.py +179 -0
  217. indw-1.0/src/indw/filter/score/types.py +108 -0
  218. indw-1.0/src/indw/filter/spec/document.py +163 -0
  219. indw-1.0/src/indw/filter/spec/export.py +44 -0
  220. indw-1.0/src/indw/filter/spec/pipeline.py +441 -0
  221. indw-1.0/src/indw/filter/spec/quality.py +412 -0
  222. indw-1.0/src/indw/filter/spec/validate.py +39 -0
  223. indw-1.0/src/indw/filter/stage0/admission.py +68 -0
  224. indw-1.0/src/indw/filter/stage0/audit.py +528 -0
  225. indw-1.0/src/indw/filter/stage0/engine.py +289 -0
  226. indw-1.0/src/indw/filter/stage0/verify.py +316 -0
  227. indw-1.0/src/indw/filter/toxicity/classifier_labels.py +10 -0
  228. indw-1.0/src/indw/filter/toxicity/config.py +138 -0
  229. indw-1.0/src/indw/filter/toxicity/context.py +100 -0
  230. indw-1.0/src/indw/filter/toxicity/detect.py +90 -0
  231. indw-1.0/src/indw/filter/toxicity/patterns.py +62 -0
  232. indw-1.0/src/indw/filter/toxicity/reports.py +96 -0
  233. indw-1.0/src/indw/filter/toxicity/rule_scorer.py +89 -0
  234. indw-1.0/src/indw/filter/toxicity/rules.py +83 -0
  235. indw-1.0/src/indw/filter/toxicity/scorer.py +126 -0
  236. indw-1.0/src/indw/filter/toxicity/validation.py +146 -0
  237. indw-1.0/src/indw/ingest/__init__.py +18 -0
  238. indw-1.0/src/indw/ingest/download.py +199 -0
  239. indw-1.0/src/indw/ingest/format.py +165 -0
  240. indw-1.0/src/indw/ingest/hash.py +65 -0
  241. indw-1.0/src/indw/ingest/hf_datasets.py +79 -0
  242. indw-1.0/src/indw/ingest/hf_env.py +12 -0
  243. indw-1.0/src/indw/ingest/log.py +57 -0
  244. indw-1.0/src/indw/ingest/resume.py +39 -0
  245. indw-1.0/src/indw/ingest/run.py +166 -0
  246. indw-1.0/src/indw/ingest/sink.py +132 -0
  247. indw-1.0/src/indw/ingest/transcript.py +56 -0
  248. indw-1.0/src/indw/schedule/__init__.py +18 -0
  249. indw-1.0/src/indw/schedule/admission/__init__.py +21 -0
  250. indw-1.0/src/indw/schedule/admission/tier01.py +90 -0
  251. indw-1.0/src/indw/schedule/admission/tiers.py +35 -0
  252. indw-1.0/src/indw/schedule/admission/tracker.py +61 -0
  253. indw-1.0/src/indw/schedule/apply/coordinator.py +165 -0
  254. indw-1.0/src/indw/schedule/apply/dedup.py +121 -0
  255. indw-1.0/src/indw/schedule/apply/lifecycle.py +145 -0
  256. indw-1.0/src/indw/schedule/apply/merge.py +284 -0
  257. indw-1.0/src/indw/schedule/apply/serialize.py +79 -0
  258. indw-1.0/src/indw/schedule/architecture/__init__.py +26 -0
  259. indw-1.0/src/indw/schedule/architecture/classify.py +76 -0
  260. indw-1.0/src/indw/schedule/architecture/graph.py +67 -0
  261. indw-1.0/src/indw/schedule/architecture/ownership.py +131 -0
  262. indw-1.0/src/indw/schedule/architecture/resources.py +44 -0
  263. indw-1.0/src/indw/schedule/backends/__init__.py +13 -0
  264. indw-1.0/src/indw/schedule/backends/config.py +40 -0
  265. indw-1.0/src/indw/schedule/backends/contract.py +30 -0
  266. indw-1.0/src/indw/schedule/backends/dask.py +131 -0
  267. indw-1.0/src/indw/schedule/backends/factory.py +27 -0
  268. indw-1.0/src/indw/schedule/backends/local.py +76 -0
  269. indw-1.0/src/indw/schedule/backends/multiprocess.py +120 -0
  270. indw-1.0/src/indw/schedule/backends/thread.py +121 -0
  271. indw-1.0/src/indw/schedule/config/hardware.py +140 -0
  272. indw-1.0/src/indw/schedule/config/pin.py +47 -0
  273. indw-1.0/src/indw/schedule/config/policy.py +356 -0
  274. indw-1.0/src/indw/schedule/config/resolve.py +80 -0
  275. indw-1.0/src/indw/schedule/config/tune.py +258 -0
  276. indw-1.0/src/indw/schedule/core.py +128 -0
  277. indw-1.0/src/indw/schedule/dispatch/alloc.py +289 -0
  278. indw-1.0/src/indw/schedule/dispatch/lanes.py +178 -0
  279. indw-1.0/src/indw/schedule/dispatch/parallel.py +802 -0
  280. indw-1.0/src/indw/schedule/dispatch/workers.py +252 -0
  281. indw-1.0/src/indw/schedule/graph/__init__.py +3 -0
  282. indw-1.0/src/indw/schedule/graph/artifacts.py +33 -0
  283. indw-1.0/src/indw/schedule/graph/config.py +30 -0
  284. indw-1.0/src/indw/schedule/graph/envelope.py +5 -0
  285. indw-1.0/src/indw/schedule/graph/queues.py +161 -0
  286. indw-1.0/src/indw/schedule/graph/runner.py +297 -0
  287. indw-1.0/src/indw/schedule/ingest/coordinator.py +20 -0
  288. indw-1.0/src/indw/schedule/intel/coordination.py +106 -0
  289. indw-1.0/src/indw/schedule/intel/fingerprints.py +171 -0
  290. indw-1.0/src/indw/schedule/intel/genome.py +229 -0
  291. indw-1.0/src/indw/schedule/intel/hardware.py +109 -0
  292. indw-1.0/src/indw/schedule/intel/incremental.py +192 -0
  293. indw-1.0/src/indw/schedule/intel/inheritance.py +55 -0
  294. indw-1.0/src/indw/schedule/intel/lci_graph.py +599 -0
  295. indw-1.0/src/indw/schedule/intel/lci_router.py +112 -0
  296. indw-1.0/src/indw/schedule/intel/merge_session.py +72 -0
  297. indw-1.0/src/indw/schedule/intel/pci.py +307 -0
  298. indw-1.0/src/indw/schedule/intel/pools/__init__.py +0 -0
  299. indw-1.0/src/indw/schedule/intel/pools/acim.py +43 -0
  300. indw-1.0/src/indw/schedule/intel/pools/pci.py +41 -0
  301. indw-1.0/src/indw/schedule/intel/promotion.py +138 -0
  302. indw-1.0/src/indw/schedule/intel/router.py +117 -0
  303. indw-1.0/src/indw/schedule/intel/scores.py +86 -0
  304. indw-1.0/src/indw/schedule/intel/session.py +417 -0
  305. indw-1.0/src/indw/schedule/intel/store.py +289 -0
  306. indw-1.0/src/indw/schedule/mix/config.py +80 -0
  307. indw-1.0/src/indw/schedule/mix/curriculum.py +97 -0
  308. indw-1.0/src/indw/schedule/mix/mixture_planner.py +130 -0
  309. indw-1.0/src/indw/schedule/mix/plan.py +83 -0
  310. indw-1.0/src/indw/schedule/mix/sampler.py +181 -0
  311. indw-1.0/src/indw/schedule/mix/telemetry.py +116 -0
  312. indw-1.0/src/indw/schedule/monitor/audit.py +23 -0
  313. indw-1.0/src/indw/schedule/monitor/budget.py +33 -0
  314. indw-1.0/src/indw/schedule/monitor/cost.py +183 -0
  315. indw-1.0/src/indw/schedule/monitor/cpu.py +17 -0
  316. indw-1.0/src/indw/schedule/monitor/doc.py +264 -0
  317. indw-1.0/src/indw/schedule/monitor/invariants.py +105 -0
  318. indw-1.0/src/indw/schedule/monitor/live.py +211 -0
  319. indw-1.0/src/indw/schedule/monitor/obs.py +123 -0
  320. indw-1.0/src/indw/schedule/monitor/pipeline_exporter.py +744 -0
  321. indw-1.0/src/indw/schedule/read/gates.py +163 -0
  322. indw-1.0/src/indw/schedule/read/ingest.py +38 -0
  323. indw-1.0/src/indw/schedule/read/preprocess.py +53 -0
  324. indw-1.0/src/indw/schedule/read/probe.py +230 -0
  325. indw-1.0/src/indw/schedule/read/sources.py +57 -0
  326. indw-1.0/src/indw/schedule/routing/__init__.py +0 -0
  327. indw-1.0/src/indw/schedule/routing/admission.py +24 -0
  328. indw-1.0/src/indw/schedule/row/index.py +127 -0
  329. indw-1.0/src/indw/schedule/row/provenance.py +37 -0
  330. indw-1.0/src/indw/schedule/row/reject.py +58 -0
  331. indw-1.0/src/indw/schedule/row/resolve.py +40 -0
  332. indw-1.0/src/indw/schedule/row/signals.py +55 -0
  333. indw-1.0/src/indw/schedule/stages/__init__.py +21 -0
  334. indw-1.0/src/indw/schedule/stages/artifact_cleaning.py +11 -0
  335. indw-1.0/src/indw/schedule/stages/classification.py +96 -0
  336. indw-1.0/src/indw/schedule/stages/contracts.py +71 -0
  337. indw-1.0/src/indw/schedule/stages/curator.py +20 -0
  338. indw-1.0/src/indw/schedule/stages/engine.py +325 -0
  339. indw-1.0/src/indw/schedule/stages/knowledge.py +16 -0
  340. indw-1.0/src/indw/schedule/stages/normalization.py +11 -0
  341. indw-1.0/src/indw/schedule/stages/pools/__init__.py +20 -0
  342. indw-1.0/src/indw/schedule/stages/pools/chain.py +111 -0
  343. indw-1.0/src/indw/schedule/stages/pools/clean.py +57 -0
  344. indw-1.0/src/indw/schedule/stages/pools/filter.py +58 -0
  345. indw-1.0/src/indw/schedule/stages/pools/preprocess.py +67 -0
  346. indw-1.0/src/indw/schedule/stages/pools/stage0.py +93 -0
  347. indw-1.0/src/indw/schedule/stages/quality.py +20 -0
  348. indw-1.0/src/indw/schedule/stages/rewrite.py +17 -0
  349. indw-1.0/src/indw/schedule/stages/runner.py +121 -0
  350. indw-1.0/src/indw/schedule/stages/structural_repair.py +61 -0
  351. indw-1.0/src/indw/schedule/stages/validation.py +15 -0
  352. indw-1.0/src/indw/schedule/state/artifacts.py +358 -0
  353. indw-1.0/src/indw/schedule/state/checkpoint.py +770 -0
  354. indw-1.0/src/indw/schedule/state/context.py +130 -0
  355. indw-1.0/src/indw/schedule/state/lock.py +135 -0
  356. indw-1.0/src/indw/schedule/state/sessions.py +81 -0
  357. indw-1.0/src/indw/schedule/state/setup.py +235 -0
  358. indw-1.0/src/indw/schedule/state/survivor.py +87 -0
  359. indw-1.0/src/indw/store/corpus/manifest.py +80 -0
  360. indw-1.0/src/indw/store/corpus/registry.py +134 -0
  361. indw-1.0/src/indw/store/eval/compare.py +121 -0
  362. indw-1.0/src/indw/store/eval/config.py +87 -0
  363. indw-1.0/src/indw/store/eval/decision.py +93 -0
  364. indw-1.0/src/indw/store/eval/diversity.py +51 -0
  365. indw-1.0/src/indw/store/eval/evaluator.py +153 -0
  366. indw-1.0/src/indw/store/eval/knowledge.py +18 -0
  367. indw-1.0/src/indw/store/eval/metrics.py +79 -0
  368. indw-1.0/src/indw/store/eval/reports.py +102 -0
  369. indw-1.0/src/indw/store/eval/scoring.py +53 -0
  370. indw-1.0/src/indw/store/eval/validation.py +214 -0
  371. indw-1.0/src/indw/store/export/config.py +73 -0
  372. indw-1.0/src/indw/store/export/export_items.py +9 -0
  373. indw-1.0/src/indw/store/export/fast_export.py +173 -0
  374. indw-1.0/src/indw/store/export/memmap_stream.py +159 -0
  375. indw-1.0/src/indw/store/export/packed_stream.py +323 -0
  376. indw-1.0/src/indw/store/export/packing/__init__.py +12 -0
  377. indw-1.0/src/indw/store/export/packing/binpack.py +234 -0
  378. indw-1.0/src/indw/store/export/packing/collate.py +53 -0
  379. indw-1.0/src/indw/store/export/packing/config.py +35 -0
  380. indw-1.0/src/indw/store/export/pipeline.py +117 -0
  381. indw-1.0/src/indw/store/export/prefetch.py +101 -0
  382. indw-1.0/src/indw/store/export/replay_export.py +49 -0
  383. indw-1.0/src/indw/store/export/shard_io.py +113 -0
  384. indw-1.0/src/indw/store/export/shard_meta.py +129 -0
  385. indw-1.0/src/indw/store/export/splits.py +37 -0
  386. indw-1.0/src/indw/store/io/atomic.py +101 -0
  387. indw-1.0/src/indw/store/io/cache.py +101 -0
  388. indw-1.0/src/indw/store/io/columnar.py +73 -0
  389. indw-1.0/src/indw/store/io/json_codec.py +33 -0
  390. indw-1.0/src/indw/store/io/jsonl.py +93 -0
  391. indw-1.0/src/indw/store/io/retry.py +106 -0
  392. indw-1.0/src/indw/tools/__init__.py +0 -0
  393. indw-1.0/src/indw/tools/metrics/alerts.py +57 -0
  394. indw-1.0/src/indw/tools/metrics/config.py +70 -0
  395. indw-1.0/src/indw/tools/metrics/pipeline_health.py +198 -0
  396. indw-1.0/src/indw/tools/metrics/recovery.py +65 -0
  397. indw-1.0/src/indw/tools/metrics/regression.py +191 -0
  398. indw-1.0/src/indw/tools/metrics/reject_log.py +74 -0
  399. indw-1.0/src/indw/tools/metrics/reports.py +114 -0
  400. indw-1.0/src/indw/tools/metrics/snapshot.py +153 -0
  401. indw-1.0/src/indw/tools/metrics/stage_profile.py +134 -0
  402. indw-1.0/src/indw/tools/metrics/storage.py +71 -0
  403. indw-1.0/src/indw/tools/metrics/trends.py +86 -0
  404. indw-1.0/src/indw/tools/metrics/validation.py +199 -0
  405. indw-1.0/src/indw/tools/reports/__init__.py +0 -0
  406. indw-1.0/src/indw/tools/reports/admission_cost.py +187 -0
  407. indw-1.0/src/indw/tools/reports/audit_left/artifact_leakage.py +105 -0
  408. indw-1.0/src/indw/tools/reports/audit_left/pipeline.py +344 -0
  409. indw-1.0/src/indw/tools/reports/audit_left/validation.py +526 -0
  410. indw-1.0/src/indw/tools/reports/batch_efficiency_audit.py +174 -0
  411. indw-1.0/src/indw/tools/reports/benchmark/__init__.py +21 -0
  412. indw-1.0/src/indw/tools/reports/benchmark/scale.py +462 -0
  413. indw-1.0/src/indw/tools/reports/dask_integration.py +149 -0
  414. indw-1.0/src/indw/tools/reports/execution_consolidation.py +210 -0
  415. indw-1.0/src/indw/tools/reports/fast/__init__.py +0 -0
  416. indw-1.0/src/indw/tools/reports/fast/analyze.py +521 -0
  417. indw-1.0/src/indw/tools/reports/fast/patterns.py +22 -0
  418. indw-1.0/src/indw/tools/reports/fast/report.py +95 -0
  419. indw-1.0/src/indw/tools/reports/fast/sample.py +81 -0
  420. indw-1.0/src/indw/tools/reports/fast/stats.py +110 -0
  421. indw-1.0/src/indw/tools/reports/foundation_cost.py +154 -0
  422. indw-1.0/src/indw/tools/reports/heavy_cost.py +169 -0
  423. indw-1.0/src/indw/tools/reports/library_migration.py +216 -0
  424. indw-1.0/src/indw/tools/reports/pipeline_audit.py +216 -0
  425. indw-1.0/src/indw/tools/reports/pipeline_tune_report.py +144 -0
  426. indw-1.0/src/indw/tools/reports/production_scale_report.py +354 -0
  427. indw-1.0/src/indw/tools/reports/stabilization_audit.py +362 -0
  428. indw-1.0/src/indw/tools/reports/stage0_cost.py +164 -0
  429. indw-1.0/src/indw/util/hf_tokenizers.py +21 -0
  430. indw-1.0/src/indw/util/stable_hash.py +41 -0
  431. indw-1.0/src/indw/util/stats.py +15 -0
indw-1.0/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2024 Instant Contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
indw-1.0/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ INDW (Instant Data Workflow)
2
+ Copyright 2024 INDW Contributors
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ Third-party dependencies are listed in pyproject.toml and are subject to
17
+ their respective licenses.
indw-1.0/PKG-INFO ADDED
@@ -0,0 +1,279 @@
1
+ Metadata-Version: 2.4
2
+ Name: indw
3
+ Version: 1.0
4
+ Summary: INDW — Instant Data Workflow: corpus ingestion, quality filtering, semantic cleaning, deduplication, and deterministic merge scheduling
5
+ Author: INDW Contributors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://developers.udinmo.com/
8
+ Project-URL: Documentation, https://developers.udinmo.com/docs/data-workflow/getting-started/overview
9
+ Project-URL: Repository, https://github.com/InstantAI-Labs/InstantAI-Data-Workflow
10
+ Project-URL: Issues, https://github.com/InstantAI-Labs/InstantAI-Data-Workflow/issues
11
+ Project-URL: Changelog, https://github.com/InstantAI-Labs/InstantAI-Data-Workflow/blob/main/CHANGELOG.md
12
+ Keywords: indw,nlp,corpus,data-pipeline,dedup,ml-data
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: NOTICE
24
+ Requires-Dist: numpy>=1.24.0
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: tqdm>=4.66.0
27
+ Requires-Dist: orjson>=3.9.0
28
+ Requires-Dist: cachetools>=5.3.0
29
+ Requires-Dist: tenacity>=8.2.0
30
+ Requires-Dist: trafilatura>=2.0.0
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=8.0; extra == "dev"
33
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
34
+ Requires-Dist: pytest-xdist>=3.5; extra == "dev"
35
+ Provides-Extra: language
36
+ Requires-Dist: langid>=1.1.6; extra == "language"
37
+ Provides-Extra: dedup
38
+ Requires-Dist: datasketch>=1.6.0; extra == "dedup"
39
+ Provides-Extra: ann
40
+ Requires-Dist: faiss-cpu>=1.7.4; extra == "ann"
41
+ Provides-Extra: compress
42
+ Requires-Dist: zstandard>=0.22.0; extra == "compress"
43
+ Provides-Extra: embedding
44
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "embedding"
45
+ Provides-Extra: distributed
46
+ Requires-Dist: dask>=2024.1.0; extra == "distributed"
47
+ Requires-Dist: distributed>=2024.1.0; extra == "distributed"
48
+ Provides-Extra: token
49
+ Requires-Dist: tokenizers>=0.15.0; extra == "token"
50
+ Provides-Extra: train
51
+ Requires-Dist: torch; extra == "train"
52
+ Requires-Dist: tokenizers>=0.15.0; extra == "train"
53
+ Provides-Extra: monitor
54
+ Requires-Dist: prometheus_client>=0.20.0; extra == "monitor"
55
+ Requires-Dist: opentelemetry-api>=1.24.0; extra == "monitor"
56
+ Requires-Dist: opentelemetry-sdk>=1.24.0; extra == "monitor"
57
+ Provides-Extra: all
58
+ Requires-Dist: indw[ann,compress,dedup,dev,distributed,embedding,language,monitor,token,train]; extra == "all"
59
+ Dynamic: license-file
60
+
61
+ # INDW
62
+
63
+ <p align="left">
64
+ <img src="docs/images/logo.svg" alt="INDW" width="48" />
65
+ </p>
66
+
67
+ **INDW** (Instant Data Workflow) is an open-source framework for production corpus pipelines. It ingests raw document collections, applies multi-tier quality filtering and semantic cleaning, deduplicates content, and produces deterministic merge output suitable for large-scale model training and evaluation.
68
+
69
+ INDW is designed for operators who need predictable behavior at scale: the same configuration and input corpus yield the same acceptance decisions and output hash whether you run on a laptop, a multi-core server, or a Dask cluster.
70
+
71
+ ## Features
72
+
73
+ - **Stage0 fast filtering** — reject junk, boilerplate, and low-value documents before expensive processing
74
+ - **PCI admission gates** — tiered quality control with configurable thresholds
75
+ - **ACIM artifact discovery** — identify and trim structural noise while preserving content
76
+ - **LCI routing** — intelligence-guided document routing for heavy stages
77
+ - **Knowledge extraction** — structure recovery and section-aware processing
78
+ - **Semantic cleaning** — HTML normalization, boilerplate removal, OCR-aware repair
79
+ - **Deduplication** — exact, fuzzy (MinHash), and semantic (embedding) modes
80
+ - **Deterministic merge** — strict sequence-ordered apply with hash-verifiable JSONL output
81
+ - **Execution backends** — `local`, `thread`, `multiprocess`, `dask` without changing pipeline logic
82
+
83
+ ## Architecture
84
+
85
+ INDW runs a single canonical execution graph. Documents flow through ingest and Stage0, pass admission tiers, enter parallel heavy stage pools (cleaning, extraction, dedup, quality scoring), and are written by an ordered apply coordinator.
86
+
87
+ ```
88
+ Ingest → Stage0 → Admission → Heavy pools → Apply → Output
89
+ ```
90
+
91
+ Heavy stage logic is backend-agnostic. Worker pools, thread pools, or Dask workers execute the same graph; only the transport layer changes.
92
+
93
+ ![INDW architecture](docs/images/architecture.svg)
94
+
95
+ See [Architecture overview](docs/architecture/overview.mdx) for capability details.
96
+
97
+ ## Installation
98
+
99
+ ```bash
100
+ pip install -e ".[dev,language]"
101
+ ```
102
+
103
+ With distributed execution support:
104
+
105
+ ```bash
106
+ pip install -e ".[dev,language,distributed]"
107
+ ```
108
+
109
+ Or use Make:
110
+
111
+ ```bash
112
+ make install-dev
113
+ indw doctor
114
+ ```
115
+
116
+ Full instructions: [Installation](docs/getting-started/installation.mdx).
117
+
118
+ ## Quick start
119
+
120
+ Prepare raw JSONL under `raw/<source>/data.jsonl`, then run:
121
+
122
+ ```bash
123
+ indw merge ./raw ./out/filtered.jsonl --work-dir ./work --workers 2 --fresh
124
+ indw validate
125
+ ```
126
+
127
+ Python API:
128
+
129
+ ```python
130
+ from indw.filter.spec.quality import QualityPipelineConfig
131
+ from indw.schedule import merge_with_quality
132
+
133
+ merge_with_quality(
134
+ "./raw", "./out/filtered.jsonl",
135
+ quality_config=QualityPipelineConfig(),
136
+ work_dir="./work",
137
+ workers=2,
138
+ fresh=True,
139
+ )
140
+ ```
141
+
142
+ See [Quickstart](docs/getting-started/quickstart.mdx) and [First pipeline](docs/getting-started/first-pipeline.mdx).
143
+
144
+ ## CLI
145
+
146
+ | Command | Purpose |
147
+ |---------|---------|
148
+ | `indw doctor` | Verify install and dependencies |
149
+ | `indw merge` | Run quality merge on a raw corpus |
150
+ | `indw validate` | Parity and acceptance validation |
151
+ | `indw test` | Run test profiles (`unit`, `parity`, `critical`) |
152
+ | `indw audit` | Operational audit reports |
153
+ | `indw benchmark` | Production scale benchmark |
154
+
155
+ ```bash
156
+ indw merge ./raw ./out/filtered.jsonl --work-dir ./work --workers 4 --backend multiprocess
157
+ indw audit --kind production
158
+ ```
159
+
160
+ Reference: [CLI commands](docs/cli/commands.mdx).
161
+
162
+ ## Configuration
163
+
164
+ INDW accepts YAML quality profiles, environment variables, and Python dataclasses. Example:
165
+
166
+ ```python
167
+ import yaml
168
+ from pathlib import Path
169
+ from indw.filter.spec.quality import QualityPipelineConfig
170
+
171
+ raw = yaml.safe_load(Path("configs/filtering/quality_fast_first.yaml").read_text())
172
+ cfg = QualityPipelineConfig.from_dict(raw)
173
+ ```
174
+
175
+ Key environment variables:
176
+
177
+ | Variable | Purpose |
178
+ |----------|---------|
179
+ | `INSTANT_PIPELINE_BACKEND` | `local`, `thread`, `multiprocess`, `dask` |
180
+ | `INSTANT_DASK_SCHEDULER` | Dask scheduler address |
181
+ | `INSTANT_MERGE_HW_PROBE` | Hardware tuning probe |
182
+
183
+ Precedence: CLI flags override environment; environment overrides YAML defaults.
184
+
185
+ Details: [Configuration](docs/getting-started/configuration.mdx).
186
+
187
+ ## Pipeline
188
+
189
+ The merge pipeline is configured through `QualityPipelineConfig`. Stages include preprocessing, Stage0 content filters, admission tiers, semantic cleaning, knowledge extraction, dedup, and quality gates. Survivors are emitted in document sequence order.
190
+
191
+ Work directories retain checkpoints for resume, resolved configuration snapshots, and optional audit JSON.
192
+
193
+ Guide: [Filtering](docs/guides/filtering.mdx) · [Scheduler](docs/guides/scheduler.mdx)
194
+
195
+ ## Scaling
196
+
197
+ Scale horizontally by increasing `--workers` with the `multiprocess` backend, or attach a Dask cluster:
198
+
199
+ ```bash
200
+ export INSTANT_PIPELINE_BACKEND=dask
201
+ export DASK_SCHEDULER_ADDRESS=tcp://scheduler:8786
202
+ indw merge ./raw ./out/filtered.jsonl --workers 8
203
+ ```
204
+
205
+ Output hash remains stable across worker counts and backends when configuration is unchanged.
206
+
207
+ Guides: [Distributed](docs/guides/distributed.mdx) · [Dask](docs/guides/dask.mdx) · [Scaling](docs/architecture/scaling.mdx)
208
+
209
+ ## Documentation
210
+
211
+ Full documentation: **[docs/README.mdx](docs/README.mdx)**
212
+
213
+ | Section | Topics |
214
+ |---------|--------|
215
+ | [Getting started](docs/getting-started/installation.mdx) | Install, quickstart, first pipeline |
216
+ | [Guides](docs/guides/ingestion.mdx) | Ingestion through distributed execution |
217
+ | [CLI](docs/cli/commands.mdx) | Commands and workflows |
218
+ | [Configuration](docs/configuration/pipeline.mdx) | Pipeline, datasets, outputs, env |
219
+ | [Architecture](docs/architecture/overview.mdx) | Execution graph, Stage0, scheduler |
220
+ | [Developer](docs/developer/contributing.mdx) | Contributing, testing, extensions |
221
+ | [Reference](docs/reference/api.mdx) | API, CLI, configuration keys |
222
+
223
+ ## Examples
224
+
225
+ | Example | Description |
226
+ |---------|-------------|
227
+ | `examples/merge_local.py` | Local single-worker merge |
228
+ | `examples/merge_custom_config.py` | YAML quality profile |
229
+ | `examples/merge_custom_output.py` | Custom output and work paths |
230
+ | `examples/merge_dask.py` | Dask backend |
231
+
232
+ ## Contributing
233
+
234
+ Contributions are welcome. Run `indw validate` before submitting pipeline changes.
235
+
236
+ See [Contributing](docs/developer/contributing.mdx).
237
+
238
+ ## License
239
+
240
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
241
+
242
+ ## Determinism and validation
243
+
244
+ INDW treats reproducibility as a first-class requirement. The apply coordinator writes survivors in strict document sequence. The canonical output hash (`sorted_output_hash`) is stable across worker counts and execution backends when the quality configuration and input corpus are unchanged.
245
+
246
+ Run acceptance checks after pipeline changes:
247
+
248
+ ```bash
249
+ indw validate
250
+ ```
251
+
252
+ This executes the parity suite: local vs multiprocess backend match, workers=1 vs workers=N hash match, and tier admission consistency.
253
+
254
+ ## Optional capabilities
255
+
256
+ Install extras only when needed:
257
+
258
+ | Extra | Capability |
259
+ |-------|------------|
260
+ | `language` | Language detection (langid) |
261
+ | `dedup` | Fuzzy MinHash dedup |
262
+ | `ann` | ANN index for semantic dedup |
263
+ | `embedding` | Sentence-transformer providers |
264
+ | `distributed` | Dask cluster backend |
265
+ | `monitor` | Prometheus and OpenTelemetry hooks |
266
+
267
+ ```bash
268
+ pip install -e ".[all]"
269
+ ```
270
+
271
+ ## Observability
272
+
273
+ Merge runs emit stage metrics, scheduler reports, and optional Stage0 audit events. Use `indw audit --kind pipeline` with a populated work directory to inspect architecture and throughput estimates. Production certification uses `indw audit --kind production` and `indw benchmark`.
274
+
275
+ Work directories are the operational source of truth for a run: resolved config, checkpoints, filtered output, and JSON audit artifacts.
276
+
277
+ ## Support and community
278
+
279
+ Report issues through the project issue tracker. Security disclosures follow [SECURITY.md](SECURITY.md). Documentation corrections and guide contributions are welcome via pull request; see [Contributing](docs/developer/contributing.mdx).