straw-queue 0.1.3__tar.gz → 0.1.5__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 (404) hide show
  1. straw_queue-0.1.5/.agents/skills/straw-protocol-review/SKILL.md +77 -0
  2. straw_queue-0.1.5/.agents/skills/straw-protocol-review/agents/openai.yaml +4 -0
  3. {straw_queue-0.1.3 → straw_queue-0.1.5}/.github/workflows/tests.yml +60 -1
  4. {straw_queue-0.1.3 → straw_queue-0.1.5}/.github/workflows/wheels.yml +13 -3
  5. straw_queue-0.1.5/CHANGELOG.md +136 -0
  6. straw_queue-0.1.5/CHANGELOG_zh.md +97 -0
  7. straw_queue-0.1.5/CONTRIBUTING.md +138 -0
  8. straw_queue-0.1.5/CONTRIBUTING_zh.md +79 -0
  9. {straw_queue-0.1.3 → straw_queue-0.1.5}/Cargo.lock +1 -1
  10. straw_queue-0.1.5/Cargo.toml +63 -0
  11. {straw_queue-0.1.3 → straw_queue-0.1.5}/PKG-INFO +17 -29
  12. {straw_queue-0.1.3 → straw_queue-0.1.5}/README.md +16 -28
  13. {straw_queue-0.1.3 → straw_queue-0.1.5}/README_zh.md +13 -18
  14. {straw_queue-0.1.3 → straw_queue-0.1.5}/docs/BENCHMARKS.md +75 -0
  15. {straw_queue-0.1.3 → straw_queue-0.1.5}/docs/BENCHMARKS_zh.md +39 -0
  16. straw_queue-0.1.5/docs/DESIGN.md +323 -0
  17. straw_queue-0.1.5/docs/DESIGN_zh.md +202 -0
  18. straw_queue-0.1.5/docs/FILESYSTEM.md +230 -0
  19. straw_queue-0.1.5/docs/FILESYSTEM_zh.md +125 -0
  20. {straw_queue-0.1.3 → straw_queue-0.1.5}/docs/FORMAT.md +141 -9
  21. straw_queue-0.1.5/docs/FORMAT_zh.md +161 -0
  22. straw_queue-0.1.5/docs/README.md +17 -0
  23. straw_queue-0.1.5/docs/README_zh.md +14 -0
  24. {straw_queue-0.1.3 → straw_queue-0.1.5}/docs/USAGE.md +121 -17
  25. {straw_queue-0.1.3 → straw_queue-0.1.5}/docs/USAGE_zh.md +78 -6
  26. {straw_queue-0.1.3 → straw_queue-0.1.5}/pyproject.toml +12 -2
  27. straw_queue-0.1.5/rust/access.rs +18 -0
  28. straw_queue-0.1.5/rust/bounds.rs +88 -0
  29. straw_queue-0.1.5/rust/catalog_append.rs +66 -0
  30. straw_queue-0.1.5/rust/catalog_decode.rs +284 -0
  31. straw_queue-0.1.5/rust/catalog_event.rs +85 -0
  32. straw_queue-0.1.5/rust/catalog_frame.rs +151 -0
  33. straw_queue-0.1.5/rust/catalog_gc.rs +47 -0
  34. straw_queue-0.1.5/rust/catalog_json.rs +179 -0
  35. straw_queue-0.1.5/rust/catalog_log.rs +302 -0
  36. straw_queue-0.1.5/rust/catalog_namespace.rs +135 -0
  37. straw_queue-0.1.5/rust/catalog_primitives.rs +62 -0
  38. straw_queue-0.1.5/rust/catalog_runtime.rs +363 -0
  39. straw_queue-0.1.5/rust/catalog_state.rs +185 -0
  40. straw_queue-0.1.5/rust/catalog_target.rs +94 -0
  41. straw_queue-0.1.5/rust/catalog_transaction.rs +102 -0
  42. straw_queue-0.1.5/rust/closure.rs +262 -0
  43. straw_queue-0.1.5/rust/closure_node.rs +226 -0
  44. straw_queue-0.1.5/rust/consumption.rs +79 -0
  45. {straw_queue-0.1.3 → straw_queue-0.1.5}/rust/coordinator.rs +1028 -473
  46. straw_queue-0.1.5/rust/directory.rs +63 -0
  47. straw_queue-0.1.5/rust/directory_io.rs +27 -0
  48. straw_queue-0.1.5/rust/discovery.rs +30 -0
  49. straw_queue-0.1.5/rust/extent_retry.rs +91 -0
  50. straw_queue-0.1.5/rust/file_adapter.rs +140 -0
  51. straw_queue-0.1.5/rust/file_primitives.rs +46 -0
  52. straw_queue-0.1.5/rust/finalization.rs +90 -0
  53. straw_queue-0.1.5/rust/framing.rs +207 -0
  54. straw_queue-0.1.5/rust/gc.rs +2839 -0
  55. straw_queue-0.1.5/rust/gc_batch.rs +108 -0
  56. straw_queue-0.1.5/rust/gc_collection.rs +379 -0
  57. straw_queue-0.1.5/rust/gc_io.rs +90 -0
  58. straw_queue-0.1.5/rust/gc_mark.rs +58 -0
  59. straw_queue-0.1.5/rust/gc_receipt.rs +37 -0
  60. straw_queue-0.1.5/rust/gc_writer.rs +772 -0
  61. straw_queue-0.1.5/rust/holding.rs +21 -0
  62. straw_queue-0.1.5/rust/identities.rs +45 -0
  63. straw_queue-0.1.5/rust/incomplete.rs +74 -0
  64. straw_queue-0.1.5/rust/journal.rs +624 -0
  65. straw_queue-0.1.5/rust/journal_append.rs +40 -0
  66. straw_queue-0.1.5/rust/journal_io.rs +52 -0
  67. straw_queue-0.1.5/rust/journal_owner.rs +169 -0
  68. straw_queue-0.1.5/rust/journal_primitives.rs +16 -0
  69. straw_queue-0.1.5/rust/journal_recovery.rs +81 -0
  70. straw_queue-0.1.5/rust/journal_state.rs +98 -0
  71. straw_queue-0.1.5/rust/json_update.rs +64 -0
  72. {straw_queue-0.1.3 → straw_queue-0.1.5}/rust/lib.rs +97 -0
  73. straw_queue-0.1.5/rust/namespace_identity.rs +138 -0
  74. straw_queue-0.1.5/rust/namespace_step.rs +86 -0
  75. straw_queue-0.1.5/rust/namespace_target.rs +125 -0
  76. straw_queue-0.1.5/rust/payload.rs +86 -0
  77. straw_queue-0.1.5/rust/pending.rs +21 -0
  78. straw_queue-0.1.5/rust/protocol.rs +157 -0
  79. {straw_queue-0.1.3 → straw_queue-0.1.5}/rust/python.rs +118 -18
  80. straw_queue-0.1.5/rust/queue_admin.rs +269 -0
  81. straw_queue-0.1.5/rust/queue_application.rs +276 -0
  82. straw_queue-0.1.5/rust/queue_commit.rs +146 -0
  83. straw_queue-0.1.5/rust/queue_event.rs +71 -0
  84. straw_queue-0.1.5/rust/queue_gc.rs +255 -0
  85. straw_queue-0.1.5/rust/queue_gc_prepare.rs +80 -0
  86. straw_queue-0.1.5/rust/queue_handoff.rs +181 -0
  87. straw_queue-0.1.5/rust/queue_history.rs +469 -0
  88. straw_queue-0.1.5/rust/queue_metadata.rs +156 -0
  89. straw_queue-0.1.5/rust/queue_progress.rs +315 -0
  90. straw_queue-0.1.5/rust/queue_reader.rs +179 -0
  91. straw_queue-0.1.5/rust/queue_receipt.rs +83 -0
  92. straw_queue-0.1.5/rust/queue_replay.rs +359 -0
  93. straw_queue-0.1.5/rust/queue_retirement.rs +129 -0
  94. straw_queue-0.1.5/rust/queue_roots.rs +459 -0
  95. straw_queue-0.1.5/rust/queue_state.rs +161 -0
  96. straw_queue-0.1.5/rust/queue_task.rs +170 -0
  97. straw_queue-0.1.5/rust/queue_transition.rs +313 -0
  98. straw_queue-0.1.5/rust/reclamation.rs +17 -0
  99. straw_queue-0.1.5/rust/record_index.rs +304 -0
  100. straw_queue-0.1.5/rust/record_manifest.rs +258 -0
  101. straw_queue-0.1.5/rust/reference_node.rs +355 -0
  102. straw_queue-0.1.5/rust/reference_validation.rs +187 -0
  103. straw_queue-0.1.5/rust/replay.rs +41 -0
  104. straw_queue-0.1.5/rust/request.rs +108 -0
  105. straw_queue-0.1.5/rust/selection.rs +16 -0
  106. straw_queue-0.1.5/rust/staging_consumption.rs +247 -0
  107. straw_queue-0.1.5/rust/store.rs +2660 -0
  108. straw_queue-0.1.5/rust/stream.rs +32 -0
  109. straw_queue-0.1.5/rust/traversal.rs +27 -0
  110. straw_queue-0.1.5/rust/typed.rs +27 -0
  111. straw_queue-0.1.5/rust/wal.rs +77 -0
  112. straw_queue-0.1.5/rust/wal_append.rs +82 -0
  113. straw_queue-0.1.5/rust/wal_device.rs +46 -0
  114. straw_queue-0.1.5/rust/wal_file.rs +408 -0
  115. straw_queue-0.1.5/rust/wal_recovery.rs +171 -0
  116. straw_queue-0.1.5/rust/wal_sink.rs +101 -0
  117. straw_queue-0.1.5/rust/wal_source.rs +169 -0
  118. straw_queue-0.1.5/rust/writer_gate.rs +497 -0
  119. straw_queue-0.1.5/rust/writer_gate_flow.rs +235 -0
  120. straw_queue-0.1.5/rust/writer_ownership.rs +194 -0
  121. straw_queue-0.1.5/rust/writer_registry.rs +444 -0
  122. straw_queue-0.1.5/rust/writer_retirement.rs +128 -0
  123. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/errors.py +8 -0
  124. straw_queue-0.1.5/src/straw/inspect.py +206 -0
  125. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/store.py +43 -7
  126. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/tensor.py +14 -3
  127. straw_queue-0.1.5/tests/native.rs +601 -0
  128. straw_queue-0.1.5/tests/test_artifact_privacy.py +175 -0
  129. straw_queue-0.1.5/tests/test_catalog_encoding.py +145 -0
  130. straw_queue-0.1.5/tests/test_commit_consumption.py +241 -0
  131. straw_queue-0.1.5/tests/test_commit_protocol.py +48 -0
  132. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_consumer_rewind.py +168 -2
  133. straw_queue-0.1.5/tests/test_dependency_traversal.py +102 -0
  134. straw_queue-0.1.5/tests/test_durable_handoff.py +170 -0
  135. straw_queue-0.1.5/tests/test_extent_bounds.py +211 -0
  136. straw_queue-0.1.5/tests/test_extent_visibility.py +301 -0
  137. straw_queue-0.1.5/tests/test_gc_batch.py +180 -0
  138. straw_queue-0.1.5/tests/test_gc_missing_parent.py +129 -0
  139. straw_queue-0.1.5/tests/test_gc_receipts.py +145 -0
  140. straw_queue-0.1.5/tests/test_incomplete_publication.py +223 -0
  141. straw_queue-0.1.5/tests/test_journal_contract.py +28 -0
  142. straw_queue-0.1.5/tests/test_json_roundtrip.py +39 -0
  143. straw_queue-0.1.5/tests/test_lease_selection.py +49 -0
  144. straw_queue-0.1.5/tests/test_metadata_recovery.py +44 -0
  145. straw_queue-0.1.5/tests/test_offline_aliases.py +60 -0
  146. straw_queue-0.1.5/tests/test_offline_inspection.py +112 -0
  147. straw_queue-0.1.5/tests/test_offline_recovery.py +115 -0
  148. straw_queue-0.1.5/tests/test_online_gc.py +589 -0
  149. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_packed_store.py +5 -2
  150. straw_queue-0.1.5/tests/test_path_identity.py +148 -0
  151. straw_queue-0.1.5/tests/test_pending_publication.py +81 -0
  152. straw_queue-0.1.5/tests/test_provisional_holds.py +221 -0
  153. straw_queue-0.1.5/tests/test_publication_handoff.py +136 -0
  154. straw_queue-0.1.5/tests/test_publication_preparation.py +177 -0
  155. straw_queue-0.1.5/tests/test_queue_gc_roots.py +100 -0
  156. straw_queue-0.1.5/tests/test_request_replay.py +120 -0
  157. straw_queue-0.1.5/tests/test_resume_workflow.py +212 -0
  158. straw_queue-0.1.5/tests/test_staging_consumption.py +223 -0
  159. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_streaming_write.py +6 -6
  160. straw_queue-0.1.5/tests/test_task_recovery.py +61 -0
  161. straw_queue-0.1.5/tests/test_tensor_granularity.py +98 -0
  162. straw_queue-0.1.5/tests/test_tensor_preflight.py +77 -0
  163. straw_queue-0.1.5/tests/test_verification_runner.py +68 -0
  164. straw_queue-0.1.5/tests/test_visibility_probe.py +61 -0
  165. straw_queue-0.1.5/tests/test_wal_recovery.py +91 -0
  166. straw_queue-0.1.5/tests/test_writer_access.py +40 -0
  167. straw_queue-0.1.5/tests/test_writer_retirement.py +154 -0
  168. straw_queue-0.1.5/tools/check_artifact_privacy.py +123 -0
  169. {straw_queue-0.1.3 → straw_queue-0.1.5}/tools/check_wheel.py +13 -5
  170. straw_queue-0.1.5/tools/release_build.py +51 -0
  171. straw_queue-0.1.5/verification/README.md +20 -0
  172. straw_queue-0.1.5/verification/README_zh.md +20 -0
  173. straw_queue-0.1.5/verification/common/README.md +19 -0
  174. straw_queue-0.1.5/verification/common/probes/runtime_performance.py +273 -0
  175. straw_queue-0.1.5/verification/common/tla/EnvironmentCatalog.tla +18 -0
  176. straw_queue-0.1.5/verification/common/tla/EnvironmentGraph.tla +11 -0
  177. straw_queue-0.1.5/verification/common/tla/EnvironmentInputs.tla +9 -0
  178. straw_queue-0.1.5/verification/common/tla/EnvironmentNamespace.tla +5 -0
  179. straw_queue-0.1.5/verification/common/tla/EnvironmentPersistence.tla +30 -0
  180. straw_queue-0.1.5/verification/common/tla/EnvironmentProgress.tla +8 -0
  181. straw_queue-0.1.5/verification/common/tla/EnvironmentRead.tla +13 -0
  182. straw_queue-0.1.5/verification/environment_contracts.json +1526 -0
  183. straw_queue-0.1.5/verification/gc/README.md +33 -0
  184. straw_queue-0.1.5/verification/gc/probes/catalog_discovery_fault.c +62 -0
  185. straw_queue-0.1.5/verification/gc/probes/catalog_discovery_probe.py +110 -0
  186. straw_queue-0.1.5/verification/gc/probes/gc_history_probe.py +115 -0
  187. straw_queue-0.1.5/verification/gc/probes/gc_parent_fault.c +81 -0
  188. straw_queue-0.1.5/verification/gc/probes/gc_parent_probe.py +197 -0
  189. straw_queue-0.1.5/verification/gc/probes/gc_receipt_probe.py +81 -0
  190. straw_queue-0.1.5/verification/gc/probes/gc_stat_fault.c +46 -0
  191. straw_queue-0.1.5/verification/gc/probes/gc_stat_probe.py +92 -0
  192. straw_queue-0.1.5/verification/gc/tla/EnvironmentParentRepair.tla +12 -0
  193. straw_queue-0.1.5/verification/gc/tla/EnvironmentWriter.tla +16 -0
  194. straw_queue-0.1.5/verification/gc/tla/EnvironmentWriterRetirement.tla +11 -0
  195. straw_queue-0.1.5/verification/gc/tla/GCBatchDeletion.cfg +6 -0
  196. straw_queue-0.1.5/verification/gc/tla/GCBatchDeletion.tla +53 -0
  197. straw_queue-0.1.5/verification/gc/tla/GCDeletion.cfg +6 -0
  198. straw_queue-0.1.5/verification/gc/tla/GCDeletion.tla +41 -0
  199. straw_queue-0.1.5/verification/gc/tla/GCDiscovery.cfg +9 -0
  200. straw_queue-0.1.5/verification/gc/tla/GCDiscovery.tla +49 -0
  201. straw_queue-0.1.5/verification/gc/tla/GCParentRepair.cfg +8 -0
  202. straw_queue-0.1.5/verification/gc/tla/GCParentRepair.tla +60 -0
  203. straw_queue-0.1.5/verification/gc/tla/GCReceipt.cfg +6 -0
  204. straw_queue-0.1.5/verification/gc/tla/GCReceipt.tla +54 -0
  205. straw_queue-0.1.5/verification/gc/tla/WriterLifetime.cfg +8 -0
  206. straw_queue-0.1.5/verification/gc/tla/WriterLifetime.tla +56 -0
  207. straw_queue-0.1.5/verification/gc/tla/WriterRetirement.cfg +9 -0
  208. straw_queue-0.1.5/verification/gc/tla/WriterRetirement.tla +118 -0
  209. straw_queue-0.1.5/verification/measurements/20261026-release-100gb.json +82 -0
  210. straw_queue-0.1.5/verification/measurements/20261026-release-comparison.json +3310 -0
  211. straw_queue-0.1.5/verification/measurements/20261026-release-visibility.json +69 -0
  212. straw_queue-0.1.5/verification/offline/README.md +24 -0
  213. straw_queue-0.1.5/verification/offline/probes/offline_alias_probe.py +157 -0
  214. straw_queue-0.1.5/verification/offline/probes/offline_guard_fault.c +62 -0
  215. straw_queue-0.1.5/verification/offline/probes/offline_guard_probe.py +193 -0
  216. straw_queue-0.1.5/verification/offline/tla/EnvironmentBindings.tla +6 -0
  217. straw_queue-0.1.5/verification/offline/tla/EnvironmentOffline.tla +9 -0
  218. straw_queue-0.1.5/verification/offline/tla/OfflineAliases.cfg +9 -0
  219. straw_queue-0.1.5/verification/offline/tla/OfflineAliases.tla +54 -0
  220. straw_queue-0.1.5/verification/offline/tla/OfflineCleanup.cfg +13 -0
  221. straw_queue-0.1.5/verification/offline/tla/OfflineCleanup.tla +54 -0
  222. straw_queue-0.1.5/verification/offline/tla/OfflineRoots.cfg +11 -0
  223. straw_queue-0.1.5/verification/offline/tla/OfflineRoots.tla +70 -0
  224. straw_queue-0.1.5/verification/protocol/README.md +45 -0
  225. straw_queue-0.1.5/verification/protocol/probes/commit_cleanup_probe.py +111 -0
  226. straw_queue-0.1.5/verification/protocol/probes/consumption_probe.py +175 -0
  227. straw_queue-0.1.5/verification/protocol/probes/handoff_extent_probe.rs +179 -0
  228. straw_queue-0.1.5/verification/protocol/probes/handoff_probe.py +144 -0
  229. straw_queue-0.1.5/verification/protocol/probes/lease_selection_probe.py +99 -0
  230. straw_queue-0.1.5/verification/protocol/probes/provisional_hold_probe.py +128 -0
  231. straw_queue-0.1.5/verification/protocol/probes/queue_record_probe.rs +383 -0
  232. straw_queue-0.1.5/verification/protocol/probes/reactivation_peer_probe.py +70 -0
  233. straw_queue-0.1.5/verification/protocol/probes/reactivation_probe.rs +200 -0
  234. straw_queue-0.1.5/verification/protocol/probes/workflow_extent_probe.rs +263 -0
  235. straw_queue-0.1.5/verification/protocol/tla/CommitApplication.cfg +7 -0
  236. straw_queue-0.1.5/verification/protocol/tla/CommitApplication.tla +51 -0
  237. straw_queue-0.1.5/verification/protocol/tla/CommitCleanup.cfg +10 -0
  238. straw_queue-0.1.5/verification/protocol/tla/CommitCleanup.tla +60 -0
  239. straw_queue-0.1.5/verification/protocol/tla/Completion.cfg +9 -0
  240. straw_queue-0.1.5/verification/protocol/tla/Completion.tla +76 -0
  241. straw_queue-0.1.5/verification/protocol/tla/CrossLogComposition.cfg +10 -0
  242. straw_queue-0.1.5/verification/protocol/tla/CrossLogComposition.tla +124 -0
  243. straw_queue-0.1.5/verification/protocol/tla/DurableHandoff.cfg +9 -0
  244. straw_queue-0.1.5/verification/protocol/tla/DurableHandoff.tla +171 -0
  245. straw_queue-0.1.5/verification/protocol/tla/EnvironmentApplication.tla +10 -0
  246. straw_queue-0.1.5/verification/protocol/tla/EnvironmentClock.tla +5 -0
  247. straw_queue-0.1.5/verification/protocol/tla/EnvironmentCommitCleanup.tla +9 -0
  248. straw_queue-0.1.5/verification/protocol/tla/EnvironmentConsumption.tla +6 -0
  249. straw_queue-0.1.5/verification/protocol/tla/EnvironmentCrossComposition.tla +14 -0
  250. straw_queue-0.1.5/verification/protocol/tla/EnvironmentCrossLog.tla +22 -0
  251. straw_queue-0.1.5/verification/protocol/tla/EnvironmentHandoff.tla +8 -0
  252. straw_queue-0.1.5/verification/protocol/tla/EnvironmentReaders.tla +5 -0
  253. straw_queue-0.1.5/verification/protocol/tla/EnvironmentRequest.tla +6 -0
  254. straw_queue-0.1.5/verification/protocol/tla/EnvironmentTraining.tla +11 -0
  255. straw_queue-0.1.5/verification/protocol/tla/Ownership.cfg +10 -0
  256. straw_queue-0.1.5/verification/protocol/tla/Ownership.tla +142 -0
  257. straw_queue-0.1.5/verification/protocol/tla/ProvisionalHold.cfg +7 -0
  258. straw_queue-0.1.5/verification/protocol/tla/ProvisionalHold.tla +93 -0
  259. straw_queue-0.1.5/verification/protocol/tla/PublicationHandoff.cfg +8 -0
  260. straw_queue-0.1.5/verification/protocol/tla/PublicationHandoff.tla +75 -0
  261. straw_queue-0.1.5/verification/protocol/tla/QueueRecordWorkflow.cfg +9 -0
  262. straw_queue-0.1.5/verification/protocol/tla/QueueRecordWorkflow.tla +79 -0
  263. straw_queue-0.1.5/verification/protocol/tla/ReactivationRace.cfg +9 -0
  264. straw_queue-0.1.5/verification/protocol/tla/ReactivationRace.tla +79 -0
  265. straw_queue-0.1.5/verification/protocol/tla/ReactivationScan.cfg +9 -0
  266. straw_queue-0.1.5/verification/protocol/tla/ReactivationScan.tla +64 -0
  267. straw_queue-0.1.5/verification/protocol/tla/RequestReplay.cfg +8 -0
  268. straw_queue-0.1.5/verification/protocol/tla/RequestReplay.tla +62 -0
  269. straw_queue-0.1.5/verification/protocol/tla/SharedRecordWorkflow.cfg +8 -0
  270. straw_queue-0.1.5/verification/protocol/tla/SharedRecordWorkflow.tla +71 -0
  271. straw_queue-0.1.5/verification/protocol/tla/StagingConsumption.cfg +7 -0
  272. straw_queue-0.1.5/verification/protocol/tla/StagingConsumption.tla +77 -0
  273. straw_queue-0.1.5/verification/protocol/tla/TrainingResume.cfg +6 -0
  274. straw_queue-0.1.5/verification/protocol/tla/TrainingResume.tla +47 -0
  275. straw_queue-0.1.5/verification/runners/check_tla.py +1380 -0
  276. straw_queue-0.1.5/verification/runners/environment_manifest.py +181 -0
  277. straw_queue-0.1.5/verification/storage/README.md +53 -0
  278. straw_queue-0.1.5/verification/storage/probes/catalog_encoding_probe.py +120 -0
  279. straw_queue-0.1.5/verification/storage/probes/dependency_probe.py +98 -0
  280. straw_queue-0.1.5/verification/storage/probes/directory_sync_fault.c +43 -0
  281. straw_queue-0.1.5/verification/storage/probes/directory_sync_probe.py +153 -0
  282. straw_queue-0.1.5/verification/storage/probes/extent_visibility_probe.py +420 -0
  283. straw_queue-0.1.5/verification/storage/probes/filesystem_bandwidth_probe.py +239 -0
  284. straw_queue-0.1.5/verification/storage/probes/incomplete_cleanup_fault.c +77 -0
  285. straw_queue-0.1.5/verification/storage/probes/incomplete_publication_probe.py +212 -0
  286. straw_queue-0.1.5/verification/storage/probes/large_extent_probe.rs +139 -0
  287. straw_queue-0.1.5/verification/storage/probes/namespace_lookup_count.c +30 -0
  288. straw_queue-0.1.5/verification/storage/probes/path_identity_probe.py +295 -0
  289. straw_queue-0.1.5/verification/storage/probes/pending_publication_probe.py +166 -0
  290. straw_queue-0.1.5/verification/storage/probes/positioned_extent_probe.rs +255 -0
  291. straw_queue-0.1.5/verification/storage/probes/preparation_fault.c +81 -0
  292. straw_queue-0.1.5/verification/storage/probes/preparation_probe.py +161 -0
  293. straw_queue-0.1.5/verification/storage/probes/publication_finalize_probe.py +170 -0
  294. straw_queue-0.1.5/verification/storage/probes/publication_retry_probe.py +149 -0
  295. straw_queue-0.1.5/verification/storage/probes/publication_sync_fault.c +43 -0
  296. straw_queue-0.1.5/verification/storage/probes/read_latency_probe.py +243 -0
  297. straw_queue-0.1.5/verification/storage/probes/read_latency_trace.c +164 -0
  298. straw_queue-0.1.5/verification/storage/probes/read_lookup_fault.c +117 -0
  299. straw_queue-0.1.5/verification/storage/probes/read_lookup_probe.py +231 -0
  300. straw_queue-0.1.5/verification/storage/probes/standalone_extent_probe.rs +106 -0
  301. straw_queue-0.1.5/verification/storage/probes/tensor_granularity_probe.py +87 -0
  302. straw_queue-0.1.5/verification/storage/probes/typed_preflight_probe.py +140 -0
  303. straw_queue-0.1.5/verification/storage/probes/writer_access_probe.py +114 -0
  304. straw_queue-0.1.5/verification/storage/probes/writer_lifetime_probe.py +143 -0
  305. straw_queue-0.1.5/verification/storage/tla/DependencyTraversal.cfg +8 -0
  306. straw_queue-0.1.5/verification/storage/tla/DependencyTraversal.tla +36 -0
  307. straw_queue-0.1.5/verification/storage/tla/DirectoryDurability.cfg +11 -0
  308. straw_queue-0.1.5/verification/storage/tla/DirectoryDurability.tla +63 -0
  309. straw_queue-0.1.5/verification/storage/tla/EnvironmentAuthentication.tla +6 -0
  310. straw_queue-0.1.5/verification/storage/tla/EnvironmentIncomplete.tla +8 -0
  311. straw_queue-0.1.5/verification/storage/tla/EnvironmentLocalAccess.tla +7 -0
  312. straw_queue-0.1.5/verification/storage/tla/EnvironmentLookup.tla +9 -0
  313. straw_queue-0.1.5/verification/storage/tla/EnvironmentPreparation.tla +8 -0
  314. straw_queue-0.1.5/verification/storage/tla/EnvironmentTyped.tla +8 -0
  315. straw_queue-0.1.5/verification/storage/tla/EnvironmentVisibility.tla +10 -0
  316. straw_queue-0.1.5/verification/storage/tla/ExtentVisibility.cfg +11 -0
  317. straw_queue-0.1.5/verification/storage/tla/ExtentVisibility.tla +79 -0
  318. straw_queue-0.1.5/verification/storage/tla/IncompletePublication.cfg +9 -0
  319. straw_queue-0.1.5/verification/storage/tla/IncompletePublication.tla +71 -0
  320. straw_queue-0.1.5/verification/storage/tla/NamespaceIdentity.cfg +10 -0
  321. straw_queue-0.1.5/verification/storage/tla/NamespaceIdentity.tla +62 -0
  322. straw_queue-0.1.5/verification/storage/tla/PendingPublication.cfg +9 -0
  323. straw_queue-0.1.5/verification/storage/tla/PendingPublication.tla +61 -0
  324. straw_queue-0.1.5/verification/storage/tla/PublicationFinalization.cfg +8 -0
  325. straw_queue-0.1.5/verification/storage/tla/PublicationFinalization.tla +58 -0
  326. straw_queue-0.1.5/verification/storage/tla/PublicationPreparation.cfg +7 -0
  327. straw_queue-0.1.5/verification/storage/tla/PublicationPreparation.tla +69 -0
  328. straw_queue-0.1.5/verification/storage/tla/PublicationRetry.cfg +9 -0
  329. straw_queue-0.1.5/verification/storage/tla/PublicationRetry.tla +50 -0
  330. straw_queue-0.1.5/verification/storage/tla/RangeRead.cfg +11 -0
  331. straw_queue-0.1.5/verification/storage/tla/RangeRead.tla +76 -0
  332. straw_queue-0.1.5/verification/storage/tla/ReadAttempt.cfg +12 -0
  333. straw_queue-0.1.5/verification/storage/tla/ReadAttempt.tla +72 -0
  334. straw_queue-0.1.5/verification/storage/tla/ReadLookup.cfg +12 -0
  335. straw_queue-0.1.5/verification/storage/tla/ReadLookup.tla +77 -0
  336. straw_queue-0.1.5/verification/storage/tla/TypedRead.cfg +8 -0
  337. straw_queue-0.1.5/verification/storage/tla/TypedRead.tla +47 -0
  338. straw_queue-0.1.5/verification/storage/tla/WriterAccess.cfg +7 -0
  339. straw_queue-0.1.5/verification/storage/tla/WriterAccess.tla +53 -0
  340. straw_queue-0.1.5/verification/wal/README.md +26 -0
  341. {straw_queue-0.1.3/verification → straw_queue-0.1.5/verification/wal/checks}/crash_campaign.py +2 -2
  342. straw_queue-0.1.5/verification/wal/probes/catalog_fsync_fault.c +29 -0
  343. straw_queue-0.1.5/verification/wal/probes/catalog_history_probe.py +157 -0
  344. straw_queue-0.1.5/verification/wal/probes/catalog_replay_probe.py +126 -0
  345. straw_queue-0.1.5/verification/wal/tla/CatalogReadBuffer.cfg +10 -0
  346. straw_queue-0.1.5/verification/wal/tla/CatalogReadBuffer.tla +67 -0
  347. straw_queue-0.1.5/verification/wal/tla/CatalogReplay.cfg +7 -0
  348. straw_queue-0.1.5/verification/wal/tla/CatalogReplay.tla +58 -0
  349. straw_queue-0.1.5/verification/wal/tla/CatalogTransaction.cfg +8 -0
  350. straw_queue-0.1.5/verification/wal/tla/CatalogTransaction.tla +93 -0
  351. straw_queue-0.1.5/verification/wal/tla/EnvironmentWal.tla +20 -0
  352. straw_queue-0.1.5/verification/wal/tla/WalRecovery.cfg +8 -0
  353. straw_queue-0.1.5/verification/wal/tla/WalRecovery.tla +89 -0
  354. straw_queue-0.1.3/CHANGELOG.md +0 -79
  355. straw_queue-0.1.3/CHANGELOG_zh.md +0 -40
  356. straw_queue-0.1.3/CONTRIBUTING.md +0 -42
  357. straw_queue-0.1.3/CONTRIBUTING_zh.md +0 -27
  358. straw_queue-0.1.3/Cargo.toml +0 -34
  359. straw_queue-0.1.3/docs/APPLICATIONS.md +0 -51
  360. straw_queue-0.1.3/docs/APPLICATIONS_zh.md +0 -28
  361. straw_queue-0.1.3/docs/BUILDING.md +0 -167
  362. straw_queue-0.1.3/docs/BUILDING_zh.md +0 -104
  363. straw_queue-0.1.3/docs/DESIGN.md +0 -86
  364. straw_queue-0.1.3/docs/DESIGN_zh.md +0 -57
  365. straw_queue-0.1.3/docs/FILESYSTEM.md +0 -105
  366. straw_queue-0.1.3/docs/FILESYSTEM_zh.md +0 -63
  367. straw_queue-0.1.3/docs/FORMAT_zh.md +0 -116
  368. straw_queue-0.1.3/docs/PROTOCOL_AND_VERIFICATION.md +0 -237
  369. straw_queue-0.1.3/docs/PROTOCOL_AND_VERIFICATION_zh.md +0 -122
  370. straw_queue-0.1.3/docs/README.md +0 -18
  371. straw_queue-0.1.3/docs/README_zh.md +0 -18
  372. straw_queue-0.1.3/docs/VERIFICATION.md +0 -106
  373. straw_queue-0.1.3/docs/VERIFICATION_zh.md +0 -73
  374. straw_queue-0.1.3/rust/gc.rs +0 -494
  375. straw_queue-0.1.3/rust/journal.rs +0 -184
  376. straw_queue-0.1.3/rust/payload.rs +0 -40
  377. straw_queue-0.1.3/rust/store.rs +0 -1163
  378. straw_queue-0.1.3/src/straw/inspect.py +0 -128
  379. straw_queue-0.1.3/tests/native.rs +0 -183
  380. straw_queue-0.1.3/tests/test_extent_visibility.py +0 -126
  381. straw_queue-0.1.3/tests/test_online_gc.py +0 -276
  382. {straw_queue-0.1.3 → straw_queue-0.1.5}/LICENSE +0 -0
  383. {straw_queue-0.1.3 → straw_queue-0.1.5}/examples/multiprocess.py +0 -0
  384. {straw_queue-0.1.3 → straw_queue-0.1.5}/examples/records.py +0 -0
  385. {straw_queue-0.1.3 → straw_queue-0.1.5}/examples/tensors.py +0 -0
  386. {straw_queue-0.1.3 → straw_queue-0.1.5}/examples/work_queue.py +0 -0
  387. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/__init__.py +0 -0
  388. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/backend.py +0 -0
  389. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/benchmark.py +0 -0
  390. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/coordinator.py +0 -0
  391. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/journal.py +0 -0
  392. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/protocol.py +0 -0
  393. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/reporting.py +0 -0
  394. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/rpc.py +0 -0
  395. {straw_queue-0.1.3 → straw_queue-0.1.5}/src/straw/tracing.py +0 -0
  396. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_benchmark_profile.py +0 -0
  397. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_filesystem_queue.py +0 -0
  398. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_gc_extent_validation.py +0 -0
  399. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_read_session.py +0 -0
  400. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_tensor.py +0 -0
  401. {straw_queue-0.1.3 → straw_queue-0.1.5}/tests/test_unlimited_capacity.py +0 -0
  402. {straw_queue-0.1.3/verification → straw_queue-0.1.5/verification/gc/probes}/gc_cross_client.py +0 -0
  403. {straw_queue-0.1.3/verification → straw_queue-0.1.5/verification/gc/probes}/gc_scale.py +0 -0
  404. {straw_queue-0.1.3/verification → straw_queue-0.1.5/verification/protocol/checks}/ownership_model.py +0 -0
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: straw-protocol-review
3
+ description: Review or change straw's persistence, ownership, recovery, GC, publication and read protocols. Use for protocol review, TODO acceptance, TLA+ changes, or Rust changes affecting durable ordering, crash/retry, request/attempt/epoch admission, reader roots or authentication. Compare the human protocol document to TLA+, then TLA+ to actual implementation; identify discrepancies and validate fixes with relevant regressions.
4
+ ---
5
+
6
+ # straw 协议审查
7
+
8
+ 以仓库根目录为工作目录。先读 `docs/DESIGN_zh.md`
9
+ (英文版去掉 `_zh`),再按三部分中的“模型与实现对应”定位模型、调用链和测试。
10
+ 文档是人审查的规则入口;映射表只是导航,不能替代阅读当前源码。
11
+
12
+ ## 1. 确定规则与范围
13
+
14
+ 从用户要求、diff 和 `TODO.md` 确定受影响的规则:
15
+
16
+ - **分布式协议 C1/C2/C4**:跨日志 handoff、请求/attempt/epoch、checkpoint 回退。
17
+ - **WAL 与数据 I/O C3/R1–R4**:日志与派生状态恢复、准备与发布重试、认证读取、独立可见性与有限重试。
18
+ - **所有权与 GC G1–G4**:完整根、认证与缓存、删除屏障与回执、writer 退休和条件活性。
19
+
20
+ 追踪一条完整流程,包括入口、成功返回、报错但已生效、崩溃恢复和重复调用。
21
+ 区分 accepted、applied、protected、reclaimed。禁止通过扩大环境假设或把失败步骤
22
+ 合成原子动作来消除反例。没有格式变化就保留现有 wire format 和 API。
23
+
24
+ ## 2. 文档 → TLA+
25
+
26
+ 逐条检查对应 `.tla`、`.cfg` 和 `verification/runners/check_tla.py` 的实际配置:
27
+
28
+ 1. 文档的状态、前置条件、持久化点、错误路径分别对应哪些变量和动作?
29
+ 2. 锁、write、sync、apply、release、unlink、目录屏障、receipt 的可观察顺序是否保留?
30
+ 3. 关键性质是否在运行配置中启用?正例能否成功,避免“一律拒绝”假安全?
31
+ 4. 负例是否因为指定不变量/时序性质失败?解析错误、超时和工具错误不是有效反例。
32
+ 5. 有限实例抽象了什么?跨日志模型的完整事务不能替代 WAL 的碎片写入模型。
33
+ 6. 活性是否单列公平性、锁/I/O 返回、环境稳定和实际调用者继续重试?永久 owner
34
+ 与永久无效输入应有独立安全/拒绝场景,不能假设它们最终消失或成功。
35
+
36
+ 审查 `verification/environment_contracts.json` 和 `docs/DESIGN_zh.md#environment`:
37
+ 环境保证与 straw 调用者义务分别列出。尤其不能把“已认证闭包”“正确根集合”或
38
+ “正确 callback”当成外部保证,跳过实际构造与调用。
39
+
40
+ ## 3. TLA+ → 实现
41
+
42
+ 从公开入口向下读真实 Rust/Python/FFI 调用路径,不能只核对同名 helper。
43
+ 对每个关键动作记录:实际函数、guard、数据身份、持久化效果、错误后可用状态和恢复入口。
44
+ 同时检查返回值和后续调用者是否真的遵守 guard。
45
+
46
+ 重点反查这些越界:
47
+
48
+ - queue WAL 确认前释放 staging/根;旧 handoff 消耗新一代 staging。
49
+ - 部分 apply、I/O 错误或 caught unwind 后仍允许写入、缓存回复或 GC;恢复用了另一条日志。
50
+ - stale attempt/epoch 被新请求接受;旧成功请求因数据已回收而不能重放。
51
+ - reader/checkpoint/其他队列/传递依赖根遗漏;锁外认证后没有锁内重查。
52
+ - 缓存跨 pool/run/namespace/reference 复用;既有可变 owner 名不保护所请求的根。
53
+ - unlink/NotFound 后目录屏障未完成就记回执;回执删除永久 tombstone。
54
+ - writer fence 未排空旧 I/O;未认证结果就恢复 staging;release 与登记 settlement 混成一步。
55
+ - warm index cache 跳过 frame/envelope/payload 校验;失败读取不关闭重开;永久损坏被当成功。
56
+
57
+ 对发现的实现错误,先保留可失败的实际回归,再修复并跑正常路径。
58
+ 修改模型和文档时同步中英文、规则 ID、映射和环境登记;不添加重复的协议正文。
59
+ 普通确定性 helper 优先编译器、Clippy 和有意义的边界测试,不重建局部证明体系。
60
+
61
+ ## 4. 验证与交付
62
+
63
+ 按风险运行 `CONTRIBUTING.md#checks` 中的命令。模型改动至少运行对应 area、
64
+ 关联组合模型和环境登记检查;完整版本验收运行全部保留模型、Rust/FFI 回归及 crash campaign。
65
+ 运行 Python 测试前确认加载的 native 扩展由当前源码构建,避免测试旧 wheel。
66
+ 只有新的修改、失败或未解决疑点才需要重复已通过的检查。
67
+
68
+ 输出须能让人复查:
69
+
70
+ - 结论及受影响规则;文档→TLA、TLA→实现分别有哪些一致点和差异。
71
+ - 每个问题的具体触发/崩溃窗口、影响、源码位置、复现及修复证据。
72
+ - 实际运行命令、输入/工具版本或哈希、结果,以及未运行的部分。
73
+ - 有意保留的抽象差异、环境前提和剩余风险;没有发现问题时也报告这些边界。
74
+ - 删除验证时说明原来防止的错误、保留证据、减少的保证与维护成本;性能只报可比实测。
75
+
76
+ 有限模型检查、源码审查和具体回归是三种不同证据。不能把 CI 全绿写成完整实现等价证明,
77
+ 也不能仅删除 TODO 或改标记来宣布完成。只有对应交付物与验收结果齐全才勾选。
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "straw 协议审查"
3
+ short_description: "Review straw docs, TLA+ models and implementation consistency"
4
+ default_prompt: "Use $straw-protocol-review to review the affected protocol flows, compare docs to TLA+ and TLA+ to implementation, and validate any fixes with relevant evidence."
@@ -2,13 +2,48 @@ name: tests
2
2
 
3
3
  on:
4
4
  push:
5
+ branches: ['**']
5
6
  pull_request:
6
7
  workflow_dispatch:
8
+ workflow_call:
7
9
 
8
10
  permissions:
9
11
  contents: read
10
12
 
11
13
  jobs:
14
+ formal:
15
+ name: TLA+ / shard ${{ matrix.shard }}
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 60
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: '3.12'
27
+ - uses: actions/setup-java@v4
28
+ with:
29
+ distribution: temurin
30
+ java-version: '17'
31
+ - name: Check specifications and expected counterexamples
32
+ run: >-
33
+ python verification/runners/check_tla.py
34
+ --shard-index ${{ matrix.shard }} --shard-count 16
35
+ - uses: actions/upload-artifact@v4
36
+ if: always()
37
+ with:
38
+ name: tla-verification-${{ matrix.shard }}
39
+ path: |
40
+ target/tla/report.json
41
+ target/tla/environment_contracts.json
42
+ target/tla/**/*.log
43
+ target/tla/**/*.tla
44
+ target/tla/**/*.cfg
45
+ if-no-files-found: error
46
+
12
47
  checks:
13
48
  name: Rust tests and code checks
14
49
  runs-on: ubuntu-latest
@@ -23,6 +58,8 @@ jobs:
23
58
  python-version: '3.12'
24
59
  - name: Install formatters
25
60
  run: python -m pip install 'black>=24.8' 'isort>=5.13'
61
+ - name: Check environment contract inventory
62
+ run: python verification/runners/environment_manifest.py --check
26
63
  - name: Check formatting
27
64
  run: |
28
65
  cargo fmt --check
@@ -54,7 +91,7 @@ jobs:
54
91
  python -m pip install 'build>=1.2' 'twine>=5' 'numpy>=1.24' 'pytest>=8'
55
92
  python -m pip install 'torch>=2.3' --index-url https://download.pytorch.org/whl/cpu
56
93
  - name: Build the wheel
57
- run: python -m build --wheel
94
+ run: python tools/release_build.py python -m build --wheel
58
95
  - name: Check package metadata
59
96
  run: python -m twine check dist/*
60
97
  - name: Run all Python and protocol tests against the installed wheel
@@ -67,3 +104,25 @@ jobs:
67
104
  name: test-report-py${{ matrix.python }}
68
105
  path: wheel-check.json
69
106
  if-no-files-found: warn
107
+
108
+ verification:
109
+ name: Verification passed
110
+ needs: [formal, checks, python]
111
+ if: always()
112
+ runs-on: ubuntu-latest
113
+ timeout-minutes: 5
114
+ steps:
115
+ - name: Require every verification job to succeed
116
+ env:
117
+ RESULTS: ${{ toJSON(needs) }}
118
+ run: |
119
+ python3 - <<'PY'
120
+ import json
121
+ import os
122
+
123
+ results = json.loads(os.environ["RESULTS"])
124
+ assert set(results) == {"formal", "checks", "python"}
125
+ failed = {name: job["result"] for name, job in results.items() if job["result"] != "success"}
126
+ if failed:
127
+ raise SystemExit(f"Verification did not pass: {failed}")
128
+ PY
@@ -7,7 +7,11 @@ on:
7
7
  permissions:
8
8
  contents: read
9
9
  jobs:
10
+ verification:
11
+ name: Verify the release source
12
+ uses: ./.github/workflows/tests.yml
10
13
  build:
14
+ needs: verification
11
15
  runs-on: ubuntu-latest
12
16
  timeout-minutes: 30
13
17
  strategy:
@@ -21,7 +25,11 @@ jobs:
21
25
  target: x86_64
22
26
  # The action adds --manylinux; do not also pass --compatibility in args.
23
27
  manylinux: '2_28'
28
+ before-script-linux: |
29
+ export CARGO_ENCODED_RUSTFLAGS="$(python3 tools/release_build.py --print-flags)"
24
30
  args: --release --locked --strip --out dist --interpreter /opt/python/cp${{ matrix.python-tag }}-cp${{ matrix.python-tag }}/bin/python
31
+ - name: Check release artifact privacy
32
+ run: python3 tools/check_artifact_privacy.py dist/*.whl
25
33
  - uses: actions/upload-artifact@v4
26
34
  with:
27
35
  name: wheel-cp${{ matrix.python-tag }}-linux-x86_64
@@ -63,6 +71,7 @@ jobs:
63
71
  name: wheel-check-cp${{ matrix.tag }}
64
72
  path: wheel-check.json
65
73
  sdist:
74
+ needs: verification
66
75
  runs-on: ubuntu-latest
67
76
  timeout-minutes: 30
68
77
  steps:
@@ -73,9 +82,10 @@ jobs:
73
82
  python-version: '3.12'
74
83
  - run: python -m pip install 'build>=1.2' 'twine>=5' 'numpy>=1.24' 'pytest>=8'
75
84
  - run: python -m pip install 'torch>=2.3' --index-url https://download.pytorch.org/whl/cpu
76
- - run: python -m build --sdist
85
+ - run: python tools/release_build.py python -m build --sdist
77
86
  - run: python -m twine check dist/*
78
- - run: python -m pip wheel --no-deps dist/*.tar.gz --wheel-dir rebuilt
87
+ - run: python tools/release_build.py python -m pip wheel --no-deps dist/*.tar.gz --wheel-dir rebuilt
88
+ - run: python tools/check_artifact_privacy.py dist/*.tar.gz rebuilt/*.whl
79
89
  - run: python -m twine check rebuilt/*
80
90
  - run: python tools/check_wheel.py rebuilt/*.whl --tests --report wheel-check.json
81
91
  - uses: actions/upload-artifact@v4
@@ -90,7 +100,7 @@ jobs:
90
100
  path: wheel-check.json
91
101
  publish:
92
102
  name: Publish to PyPI
93
- needs: [smoke, sdist]
103
+ needs: [verification, smoke, sdist]
94
104
  if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
95
105
  runs-on: ubuntu-latest
96
106
  timeout-minutes: 10
@@ -0,0 +1,136 @@
1
+ # Changelog
2
+
3
+ [中文版](CHANGELOG_zh.md)
4
+
5
+ ## 0.1.5
6
+
7
+ ### Ownership safety
8
+
9
+ - Fix reactivation reusing an existing public owner without checking that it protects the requested root, including owner changes after authentication outside the lock. Check the retained pack closure both initially and under the fresh lock; internal queue owners bind the reference digest. Correct reuse still succeeds; public owner reuse adds closure/metadata checks.
10
+ - Preserve public APIs, WAL/pack formats and durability ordering. Add regressions for existing-owner and post-authentication changes, and for staging remaining protected until queue WAL confirmation.
11
+
12
+ ### Specification, verification and maintenance
13
+
14
+ - Remove all Verus source, inline specifications, ghost state, library contracts, runner, negative controls and CI; simplify Rust wrappers. Remove six deterministic local TLA+ models while retaining complete protocol models and product fault regressions.
15
+ - Extend cross-log attempt/epoch and checkpoint rewind, WAL caller/cache, reactivation, authenticated read, writer retirement and conditional-progress scenarios. Distinguish model checking, execution tests and source review without claiming complete implementation equivalence.
16
+ - Merge design, protocol, environmental premises and model-to-code correspondence into the [design and spec](docs/DESIGN.md). Move application integration into usage and checks/builds/releases into contributing; update both languages and add the `straw-protocol-review` skill.
17
+ - Delete per-iteration proof, measurement and acceptance reports. Retain only three public benchmarks cited by the performance guide and explicitly list them in source-package manifests. Their results describe the original 0.1.4 candidate, not this version's performance.
18
+
19
+ ## 0.1.4
20
+
21
+ ### Recovery and continuation
22
+
23
+ - Preserve producer continuation payloads and independent reader, consumer and checkpoint roots during online GC. Sampling can resume from its durable continuation after process failure. Training applications must select and load a checkpoint with matching model/optimizer state and data cursors, and retain data needed for replay; straw does not automatically load a model checkpoint or recreate reclaimed data.
24
+ - Resolve durable receipts before reopening old references when retrying accepted consumer-state, batch-plan, batch-ready and checkpoint-registration requests. Identical retries can succeed after those references have been legitimately reclaimed, without creating new ownership.
25
+ - Persist staging cleanup intent, dependency recipes and generation-specific completion receipts. Recovery can finish an accepted handoff after a lost reply without releasing a later staging generation of the same reference.
26
+ - Quarantine uncertain WAL writes, partial state application and caught Rust callback panics until recovery. Reject malformed journal/catalog events before appending, preserve confirmed prefixes during rebuild and reject changed pool/run or log identity. Harden counter arithmetic and deduplicate repeated task IDs before lease selection.
27
+
28
+ ### Storage and reads
29
+
30
+ - Retry independent visibility delays in the header, footer, index, envelope, payload and tensor checksum chunks within one bounded budget. Every returned record remains authenticated; persistent corruption fails after the budget expires.
31
+ - Reuse the authenticated index descriptor within a read attempt and buffer catalog replay with at most 64 KiB of read-ahead. Failed read attempts reopen their files. Replace recursive dependency walks with deduplicated worklists to support deep graphs.
32
+ - Validate tensor dtype, shape and length before reading payloads. New tensors use 4 MiB checksum chunks; older tensors retain their stored chunk sizes. Checkpoint reactivation authenticates all reachable payloads outside the catalog lock with at most 1 MiB of payload scratch, then rechecks ownership and tombstones under the lock.
33
+ - Preserve exact finite JSON floating-point values through serialization and recovery. Reject native payload providers whose traversals have the wrong length or swallow callback failures.
34
+
35
+ ### Garbage collection and publication safety
36
+
37
+ - Retry directory barriers after unlink, including already absent files and missing parents. Batch shared-parent barriers and persist reclamation receipts only after deletion is durable. Preserve permanent tombstones; a cold-cache retain of a reclaimed root or dependency now returns `InvalidReference` before trying to read its missing payload.
38
+ - Protect canonical paths and aliases, peer queues, active readers, checkpoints, producer continuations and pending publications. Public owner APIs reject internal `queue:` and `publication:` names. Offline cleanup preserves control files, rejects symlink cycles on Python 3.13 as well as earlier versions, and fails closed on uncertain shared-pool discovery; dangling orphan links remain eligible for cleanup.
39
+ - Preserve dependency holds and retry identities through failed publication setup, synchronization, staging and sealing. Repair missing ancestor barriers, roll back unpublished tails before writer reuse and seal completed standalone reservations so they can be collected. A failed GC hook with partial WAL effects forces fresh recovery before further writes.
40
+
41
+ ### Writer retirement
42
+
43
+ - Add explicit `retire_writer(..., policy="recover" | "abandon")` with a durable fence, operation registry and reusable recovery receipts. Recovery stages complete results before releasing preparation ownership; abandonment preserves existing queue, reader and staging roots. A writer holding its gate reports `WriterBusy`, and a fenced writer cannot resume writing. Retirement depends on the documented lock, fence-visibility and in-flight-I/O contracts; timeouts alone do not establish death.
44
+ - Reject busy writer metrics, seal and close operations without waiting on an in-flight callback. Unknown legacy preparation owners remain protected and are reported for separate recovery.
45
+
46
+ ### Compatibility and migration
47
+
48
+ - Packed-record and WAL byte framing remain unchanged, and legacy catalog entries still replay. New queue staging-handoff events require updated coordinators: do not downgrade a queue writer after those events are stored. Upgrade all GC participants before relying on canonical-alias protection; an old collector can still delete an aliased owned file. Mixed versions do not gain a uniform cleanup/retry guarantee; historical leaks and already reclaimed legacy manifests are not automatically repaired. See [format compatibility](docs/FORMAT.md#queue-staging-handoff-receipts).
49
+ - Rust callers must use read-only coordinator accessors (`state()`, `journal()`, `store()`, `limits()`, `epoch()`), publish through a separate `Store`, and replace explicitly typed `&mut Catalog` callbacks with `&mut LockedCatalog<'_>`. `Config::gc_enabled` returns `Result<bool>`. Existing Python call signatures are retained, with the retirement APIs added.
50
+ - Previously rounded floats cannot be reconstructed. Old rounded request hashes and retries generated under a different tensor chunk policy can conflict after upgrade; preserve retry identities and review the [stored-format rules](docs/FORMAT.md). Catalog recipes and receipts currently grow without compaction.
51
+
52
+ ### Known performance regressions
53
+
54
+ - In the same JuiceFS workload with online GC, median write throughput fell 20.7% and acceptance time for 64 tasks rose 34.8% versus 0.1.3; reads and synchronous WAL appends showed no comparable decline. This short comparison used two rounds per build with warm caches. It was not profiled, so the changes cannot be attributed to a particular safety protocol or proof-related refactoring. See the [complete samples and build hashes](verification/measurements/20261026-release-comparison.json).
55
+
56
+ ### CI and verification
57
+
58
+ - Scan source distributions and wheel contents, including native libraries, for local paths and recognizable credentials. Remap Rust build paths before compilation so released binaries omit local source, home and toolchain locations; CI checks artifacts before upload and rejects findings without printing matched secrets.
59
+ - Require TLA+/Verus checks, semantic negative controls, environment-contract audits, Rust/Python tests, formatting and Clippy before release builds and publishing. TLC records its jar hash without enforcing a checksum; Verus logs distinguish successful proofs from expected semantic rejections. Verification files are organized by protocol, WAL, GC, storage and offline recovery, with independently reviewable environment assumptions.
60
+ - Freeze new formal-verification work for this release. Integrated proofs cover specific production bodies and models; complete retain/reactivation, cross-log recovery, authentication and liveness composition remain deferred and receive regression/fault-injection coverage. That scope describes the historical release. Passing tests does not complete these proofs, and prior performance measurements do not establish this build's throughput or latency.
61
+
62
+ ## 0.1.3
63
+
64
+ - Retry temporarily zero-filled bytes anywhere in a published extent's header,
65
+ including partial and noncontiguous visibility gaps. Previously, only an
66
+ entirely zero-filled header triggered this retry. The retry limit and checksum
67
+ validation remain unchanged; other incorrect header bytes fail immediately.
68
+
69
+ Existing callers and stored data remain compatible. Packed-record and WAL
70
+ formats are unchanged.
71
+
72
+ ## 0.1.2
73
+
74
+ - Stream large record payloads through bounded native write buffers. Records and
75
+ publications no longer need to fit the writer's scratch buffer; existing
76
+ packed-record framing and tensor reads are unchanged.
77
+ - Remove fixed logical quotas on record and dependency counts, result sizes,
78
+ queue work, control messages, and metadata. Legacy limit arguments remain
79
+ accepted for API and queue-identity compatibility; `max_buffer_bytes` still
80
+ bounds temporary payload copies.
81
+ - Retry transient shared-filesystem visibility gaps when a published extent's
82
+ length is visible before its header bytes. The reader reopens the file after
83
+ short delays; persistent failures, nonzero bad headers, and checksum errors
84
+ remain errors.
85
+
86
+ Existing stored data and callers remain compatible. These write and read
87
+ behaviors require 0.1.2; packed-record and WAL formats are unchanged.
88
+
89
+ ## 0.1.1
90
+
91
+ - Persistent task scheduling with `TaskSpec.priority` (higher first),
92
+ `scheduling_key` (lower first), then FIFO. Both keys default to zero and accept
93
+ signed 64-bit integers. The Rust pending index selects tasks without reading
94
+ their payloads and reconstructs scheduling order during WAL recovery.
95
+ - `Coordinator.yield_tasks()` atomically saves a batch of continuation inputs
96
+ and optional scheduling fields, ends their leases, and returns the tasks to
97
+ the pending queue without spending failure retries. Returned tasks join the
98
+ tail of their scheduling key's FIFO order. Identical requests are idempotent;
99
+ a stale lease rejects the entire batch.
100
+ - `Coordinator.pending_tasks()` exposes pending task specifications in
101
+ acquisition order, with optional task-prefix and minimum-priority filters.
102
+ Applications coordinate paused snapshots and retain the referenced inputs.
103
+ - Regression coverage for priority/FIFO recovery, stale leases, invalid
104
+ scheduling keys, and all-or-nothing batch recovery across WAL crash windows.
105
+
106
+ Existing callers may omit the new scheduling fields. Packed-record and WAL
107
+ framing are unchanged; the new APIs and scheduling behavior require 0.1.1.
108
+ Pending-task snapshots alone do not provide a joint application checkpoint or
109
+ arbitrary checkpoint rollback.
110
+
111
+ ## 0.1.0
112
+
113
+ Initial release of straw, a filesystem-based durable queue and shared tensor
114
+ store for AI applications, distributed as `straw-queue` under the MIT license.
115
+
116
+ - Rust storage, WAL, queue and ownership protocols with Python APIs. Multiple
117
+ machines can read and write through a shared filesystem; the initial shared
118
+ storage target is JuiceFS.
119
+ - Packed immutable records and embedded manifests, batched publication and
120
+ size-based file rotation, avoiding a file per sample or tensor.
121
+ - Bytes and custom codecs, NumPy/PyTorch tensors, checked lazy row reads and
122
+ native read sessions that reuse authenticated indices.
123
+ - Shared tensor references across queues, tensor-level copy-on-write, explicit
124
+ reader/checkpoint ownership and optional online GC of unreferenced sealed packs.
125
+ - Durable task leases, continuation progress, completion receipts and consumer
126
+ state, with WAL recovery and retained-checkpoint restore.
127
+ - Local and multi-host I/O benchmarks, workload profiling and replay, an
128
+ independent protocol model, and process-crash/recovery checks.
129
+ - Linux x86_64 wheels for CPython 3.10–3.13, automated artifact tests and PyPI
130
+ Trusted Publishing, standalone examples and paired English/Chinese guides.
131
+
132
+ Each queue requires one externally fenced coordinator. Automatic failover,
133
+ live-pack compaction, journal compaction and a general distributed application
134
+ checkpoint transaction are not provided. Additional network filesystems require
135
+ deployment validation. See the [filesystem requirements](docs/FILESYSTEM.md) and
136
+ [protocol guarantees](docs/DESIGN.md).
@@ -0,0 +1,97 @@
1
+ # 更新日志
2
+
3
+ [English](CHANGELOG.md)
4
+
5
+ ## 0.1.5
6
+
7
+ ### 所有权安全
8
+
9
+ - 修复 reactivation 复用既有公共 owner 名时没有确认其保护请求根的问题,包括锁外认证后 owner 被变更的竞态。在初次检查与重新加锁后核对实际 pack 闭包;内部 queue owner 绑定引用摘要。正确复用仍可成功,公共 owner 复用增加闭包/元数据检查。
10
+ - 保持公开 API、WAL 和 pack 格式及持久化顺序。新增既有 owner/认证后变更回归,以及 queue WAL 确认前 staging 不得被消费的回归。
11
+
12
+ ### 规格、验证与维护
13
+
14
+ - 完全移除 Verus 源码、内嵌规格、ghost state、库契约、运行器、负例与 CI,简化 Rust 包装层。删除六个确定性局部 TLA+ 模型,保留完整协议模型和产品故障回归。
15
+ - 补齐跨日志 attempt/epoch 与 checkpoint 回退、WAL 调用者/缓存、reactivation、认证读取、writer 退休及条件进展场景。模型检查、实际回归和源码审查分别说明,不宣称完整实现等价证明。
16
+ - 将设计、协议、环境假设及模型/实现对应合并到[设计与 spec](docs/DESIGN_zh.md)。应用集成并入使用指南,检查/构建/发布并入贡献指南;中英文同步,新增 `straw-protocol-review` skill。
17
+ - 删除逐轮证明、测量和验收过程报告,仅保留性能文档引用的三份公开基准;源码包明确列出允许包含的数据。保留结果对应原 0.1.4 候选构建,不代表本版性能。
18
+
19
+ ## 0.1.4
20
+
21
+ ### 恢复与续读
22
+
23
+ - 在线 GC 保留 producer continuation,以及独立的 reader、consumer 和 checkpoint 根。采样进程失败后可以从已持久化的 continuation 恢复。训练应用仍须选择并加载 checkpoint,恢复相匹配的模型/optimizer 状态与数据游标,并保留重放需要的数据;straw 不会自动加载模型 checkpoint,也不能恢复已回收的数据。
24
+ - 重试已接受的 consumer state、batch plan、batch ready 和 checkpoint registration 时,先查询持久回执,再决定是否读取旧引用。即使旧数据已合法回收,相同请求仍可返回原结果,不会重新建立所有权。
25
+ - 持久化 staging 清理意图、依赖关系和对应代际的完成回执。丢失回复后,恢复可以完成已接受的交接,不会释放同一引用后来重新建立的 staging。
26
+ - WAL 写入结果不确定、状态部分应用或捕获 Rust callback panic 后,保持隔离直至恢复。追加前拒绝畸形 journal/catalog 事件,重建时保护已确认前缀,并拒绝池/run/日志身份变化。补齐计数溢出检查,发放 lease 前对重复 task ID 去重。
27
+
28
+ ### 存储与读取
29
+
30
+ - header、footer、index、envelope、payload 和 tensor checksum chunk 可在同一有限预算内重试各自的可见性延迟。返回的数据始终经过认证;持续损坏会在预算耗尽后报错。
31
+ - 同次读取尝试复用认证索引的文件描述符,catalog replay 使用至多 64 KiB 预读;失败后重新打开文件。依赖遍历改用去重工作队列,支持深层依赖图。
32
+ - 读取 payload 前检查 tensor dtype、shape 和长度。新 tensor 使用 4 MiB checksum chunk,旧数据沿用存储的 chunk 大小。checkpoint 重新激活在 catalog 锁外认证全部可达 payload,payload scratch 至多 1 MiB,随后在锁内重新检查所有权和 tombstone。
33
+ - JSON 有限浮点数在序列化/恢复中精确往返。拒绝遍历长度不符或吞掉 callback 错误的原生 payload provider。
34
+
35
+ ### GC 与发布安全
36
+
37
+ - unlink 后重试目录持久化屏障,包括文件已不存在或父目录缺失的情况。共享父目录的屏障合并执行,持久删除完成后才记录回收回执。永久保留 tombstone;冷缓存 retain 遇到已回收的根或依赖时,在读取缺失 payload 前返回 `InvalidReference`。
38
+ - 保护规范路径及别名、其他队列、活跃 reader、checkpoint、producer continuation 和未完成 publication。公共 owner API 拒绝内部 `queue:`、`publication:` 名字。离线清理保留控制文件,在 Python 3.13 及更早版本中均拒绝符号链接环,共享池发现结果不确定时拒绝继续删除;无引用的悬空链接仍可清理。
39
+ - 发布准备、同步、staging、sealing 失败时保留依赖保护和重试身份。补齐缺失的祖先目录屏障,writer 复用前回滚未发布尾部,并封存已完成的 standalone reservation 以便 GC。GC hook 报错且已影响 WAL 时,后续写入必须先重新恢复。
40
+
41
+ ### Writer 退休
42
+
43
+ - 新增显式 `retire_writer(..., policy="recover" | "abandon")`,通过持久 fence、操作登记和可复用恢复回执处理旧 writer。recover 先保护完整结果再释放准备所有权;abandon 保留已有 queue、reader 和 staging 根。仍持有 gate 的 writer 返回 `WriterBusy`,已被 fence 的 writer 无法恢复写入。退休依赖已列明的锁、fence 可见性和在途 I/O 契约,不能仅凭超时判断进程死亡。
44
+ - writer 正执行 callback 时,metrics、seal、close 立即返回 busy,不再等待。无法确认来源的历史 preparation owner 继续受保护,并报告为独立恢复事项。
45
+
46
+ ### 兼容与迁移
47
+
48
+ - packed record 和 WAL 字节 framing 不变,旧 catalog 记录仍可重放。新增 queue staging handoff 事件需要新版 coordinator:一旦写入这些事件,不要降级 queue writer。依赖规范路径/别名保护前,应升级全部 GC 参与者;旧 collector 仍可能删除通过别名持有的文件。混用版本不具备统一的清理/重试保证;历史泄漏和已回收的旧 manifest 不会自动修复。见[格式兼容说明](docs/FORMAT_zh.md#队列-staging-交接凭据)。
49
+ - Rust 调用者需改用 coordinator 只读 accessor(`state()`、`journal()`、`store()`、`limits()`、`epoch()`),通过独立 `Store` 发布,并将显式 `&mut Catalog` callback 改为 `&mut LockedCatalog<'_>`。`Config::gc_enabled` 返回 `Result<bool>`。现有 Python 调用签名保留,另增加退休 API。
50
+ - 旧版本已舍入的浮点数无法还原;旧请求 hash 和使用不同 tensor chunk 策略生成的重试可能在升级后冲突。保留重试身份,并检查[存储格式规则](docs/FORMAT_zh.md)。catalog 依赖关系和回执暂未实现压缩,元数据会持续增长。
51
+
52
+ ### 已知性能回退
53
+
54
+ - 相同 JuiceFS 工作负载、启用在线 GC 时,相比 0.1.3,写吞吐中位数下降 20.7%,接受 64 个任务的耗时增加 34.8%;读取和同步 WAL 追加未见同量级下降。此次简短对照每个构建只有两轮,缓存未清空;尚未做 profile,不能归因于某项安全协议或验证相关重构。见[完整样本与构建哈希](verification/measurements/20261026-release-comparison.json)。
55
+
56
+ ### CI 与验证边界
57
+
58
+ - 扫描源码分发包与 wheel 内容(包括原生库),检查本机路径和可识别的凭据。编译时 remap Rust 路径,避免发布二进制携带本机源码、用户目录和工具链位置;CI 上传产物前检查,发现问题即拒绝,报告不输出命中的秘密内容。
59
+ - release 构建和发布以前置检查为条件,包括 TLA+/Verus、语义负例、environment contract 审计、Rust/Python 测试、格式和 Clippy。TLC 只记录 jar 哈希、不做校验;Verus 日志明确区分证明通过与预期语义拒绝。验证目录按协议、WAL、GC、存储与离线恢复组织,环境假设可独立审查。
60
+ - 本次发布冻结新增形式化验证。已集成证明覆盖具体生产函数和模型;完整 retain/reactivation、跨日志恢复、认证与活性组合延期,以回归和故障注入测试覆盖。该范围描述当时的版本。测试通过不等于这些证明已完成,历史性能测量也不能代表当前构建的吞吐或延迟。
61
+
62
+ ## 0.1.3
63
+
64
+ - 已发布 extent 的文件头在任意位置出现暂时零值时都会触发重试,支持部分字节以及不连续位置尚不可见的情况。此前只有整个文件头为零时才会触发这类重试。重试上限和 checksum 校验保持不变;其他错误的文件头字节仍会立即报错。
65
+
66
+ 已有调用方和存储数据保持兼容,packed record 和 WAL 格式不变。
67
+
68
+ ## 0.1.2
69
+
70
+ - 大记录的 payload 通过有界 native 写入缓冲区分块写入。记录和批量发布不再需要适配 writer 的临时缓冲区;原有 packed record 格式和张量读取方式不变。
71
+ - 移除记录数、依赖数、结果大小、队列任务、控制消息及元数据的固定逻辑配额。旧的限制参数继续保留,以兼容 API 和队列身份;`max_buffer_bytes` 仍约束临时 payload 复制。
72
+ - 共享文件系统上,已发布 extent 的文件长度可能先于文件头内容可见。reader 遇到这种短暂情况会延迟并重新打开文件;持续失败、非零坏文件头和 checksum 错误仍会报错。
73
+
74
+ 已有存储数据和调用方保持兼容。上述写入和读取行为需要 0.1.2;packed record 和 WAL 格式不变。
75
+
76
+ ## 0.1.1
77
+
78
+ - 持久化任务调度:按 `TaskSpec.priority` 从高到低、`scheduling_key` 从低到高、再按 FIFO 顺序领取任务。两个字段默认均为 0,接受有符号 64 位整数。Rust pending 索引无需读取载荷即可选择任务,WAL 恢复时重建调度顺序。
79
+ - 新增 `Coordinator.yield_tasks()`:原子保存一批 continuation 输入及可选调度字段,结束这些任务的 lease 并归还到 pending 队列,不消耗失败重试次数。归还的任务进入相同调度键的 FIFO 队尾;相同请求可幂等重试,任一 lease 失效则拒绝整批操作。
80
+ - 新增 `Coordinator.pending_tasks()`:按领取顺序返回 pending 任务的 spec,支持按任务 ID 前缀及最低优先级过滤。应用负责协调暂停后的快照,并持有所引用的输入。
81
+ - 补充优先级/FIFO 恢复、失效 lease、非法调度键,以及 WAL 崩溃窗口下批量操作全有或全无恢复的回归测试。
82
+
83
+ 已有调用方可以不指定新增调度字段。Packed record 与 WAL 的 framing 不变;新增 API 和调度行为需要 0.1.1。仅有 pending 任务快照尚不构成应用联合 checkpoint,也不提供任意 checkpoint 回退。
84
+
85
+ ## 0.1.0
86
+
87
+ straw 首次发布:面向 AI 应用、基于文件系统的持久化队列与共享张量存储,以 `straw-queue` 包分发,采用 MIT 许可证。
88
+
89
+ - Rust 实现存储、WAL、队列及所有权协议,提供 Python API。多台机器通过共享文件系统并行读写,首个共享存储目标为 JuiceFS。
90
+ - 不可变记录与 manifest 打包存储,支持批量发布和按大小轮换文件,避免每个 sample 或张量单独创建文件。
91
+ - 支持 bytes、自定义 codec、NumPy/PyTorch 张量、带校验的惰性按行读取,以及复用已认证索引的 native 读取会话。
92
+ - 跨队列共享张量引用、张量级写时复制、显式 reader/checkpoint 所有权,以及可选在线 GC,回收无引用的封存 pack。
93
+ - 持久化任务 lease、continuation 进度、完成 receipt 和消费者状态,支持 WAL 恢复与已保留 checkpoint 的恢复。
94
+ - 本地与多机 I/O benchmark、应用负载采集与重放、独立协议模型,以及进程崩溃与恢复检查。
95
+ - CPython 3.10–3.13 的 Linux x86_64 wheel、自动化产物测试与 PyPI Trusted Publishing、独立使用示例和配套中英文指南。
96
+
97
+ 每个队列需要一个由外部机制隔离保护的协调器。尚不提供自动故障切换、存活 pack 整理、日志压缩或通用分布式应用 checkpoint 事务。其他网络文件系统需要单独验证部署语义。详见[文件系统要求](docs/FILESYSTEM_zh.md)与[协议保证](docs/DESIGN_zh.md)。
@@ -0,0 +1,138 @@
1
+ # Contributing
2
+
3
+ [中文版](CONTRIBUTING_zh.md)
4
+
5
+ Read the [design and spec](docs/DESIGN.md) before changing durable ordering,
6
+ recovery, ownership or authentication. Use the
7
+ [straw-protocol-review skill](.agents/skills/straw-protocol-review/SKILL.md)
8
+ to compare rules to TLA+, then trace the models to actual callers.
9
+
10
+ Protocol changes should explain success, uncertain effects, crash/retry and
11
+ compatibility. Add a reproducer for a real failure boundary and preserve a valid
12
+ success path. Update the rule, model, caller and regression together. Ordinary
13
+ local functions use compiler checks, Clippy and meaningful tests; do not rebuild
14
+ per-function proof scaffolding. Unknown wire versions fail explicitly; framing
15
+ changes require a format version.
16
+
17
+ When changing an environmental premise, update its stable ID in
18
+ [environment_contracts.json](verification/environment_contracts.json), the
19
+ [spec](docs/DESIGN.md#environment), consuming models and sensitivity controls.
20
+ Do not turn straw caller obligations into assumed filesystem guarantees.
21
+ User/contributor guides have paired English `.md` and Chinese `_zh.md` versions;
22
+ keep links, APIs and commands aligned. Application codecs and scheduling belong
23
+ in the consuming application. The project uses the [MIT license](LICENSE).
24
+
25
+ <a id="checks"></a>
26
+
27
+ ## Development and checks
28
+
29
+ Use Rust 1.89+, a C linker, CPython 3.10+ and Java 17+ for TLC. Install the
30
+ appropriate CPU/CUDA PyTorch build, then the editable development package:
31
+
32
+ ```sh
33
+ python -m pip install -e '.[test,build,dev]'
34
+ python -m black --check src tests examples tools verification
35
+ python -m isort --check-only src tests examples tools verification
36
+ cargo fmt --check
37
+ cargo clippy --locked --all-targets -- -D warnings
38
+ cargo clippy --locked --all-targets --features python -- -D warnings
39
+ cargo test --locked
40
+ python -m pytest
41
+ python verification/runners/environment_manifest.py --check
42
+ python verification/runners/check_tla.py
43
+ python verification/protocol/checks/ownership_model.py --output /tmp/straw-ownership.json
44
+ python verification/wal/checks/crash_campaign.py --output /tmp/straw-crashes.json
45
+ ```
46
+
47
+ Rebuild/reinstall the native extension after Rust changes before running Python
48
+ tests. For focused model work, use `check_tla.py --area wal --area gc` or
49
+ `--case NAME`; run the full retained suite for release acceptance. Supply
50
+ `--jar /path/to/tla2tools.jar` to select TLC; otherwise the runner downloads its
51
+ configured release. It records the actual jar hash without enforcing a checksum.
52
+ Logs, configs and counterexamples default to `target/tla/`. Positives must pass;
53
+ negatives must fail the named invariant/temporal property. Parse errors, timeouts
54
+ and launch failures never count as semantic rejection.
55
+
56
+ The inventory checks declared IDs, paths and environment imports. The independent
57
+ ownership model explores a bounded abstraction; the crash campaign checks byte
58
+ prefixes/corruption and process exits. None certifies storage-service or power-loss
59
+ behavior. Multi-client qualification is in [deployment](docs/FILESYSTEM.md#qualification).
60
+
61
+ <a id="build"></a>
62
+
63
+ ## Build and check distributions
64
+
65
+ Only the build machine needs Rust. Dependencies are declared in `pyproject.toml`
66
+ and pinned by `Cargo.lock`:
67
+
68
+ ```sh
69
+ python -m pip install build maturin twine
70
+ python tools/release_build.py python -m build --wheel --sdist
71
+ python -m twine check dist/*
72
+ python tools/check_artifact_privacy.py dist/*
73
+ python tools/check_wheel.py dist/<compatible-wheel>.whl --tests --report /tmp/straw-wheel-check.json
74
+ python tools/release_build.py python -m pip wheel --no-deps dist/straw_queue-*.tar.gz --wheel-dir rebuilt
75
+ ```
76
+
77
+ Use the actual compatible wheel filename and check the rebuilt wheel too.
78
+ `check_wheel.py` creates a temporary environment, reuses installed NumPy/PyTorch,
79
+ installs only the wheel without an index, rejects source imports and removes Rust
80
+ from the test PATH. It runs examples, multiprocess recovery, benchmark/GC and
81
+ trace checks; `--tests` adds the full Python suite, ownership model and crash campaign.
82
+
83
+ The release wrapper removes local source/toolchain paths from Rust output.
84
+ Artifact scans check archive contents for recognizable paths/secrets without
85
+ printing their values. Rust SBOM generation is disabled because it embeds local
86
+ crate paths; locked dependency versions remain in `Cargo.lock`.
87
+
88
+ The release workflow targets Linux x86_64, CPython 3.10–3.13 and manylinux/glibc
89
+ 2.28+. Wheels use interpreter-specific buffer APIs, not ABI3. Local builds receive
90
+ the platform tag they actually satisfy; never rename a tag to imply compatibility.
91
+ Use the [manylinux workflow](.github/workflows/wheels.yml), or on Linux:
92
+
93
+ ```sh
94
+ python -m pip install 'maturin[zig,patchelf]>=1.12,<2'
95
+ python tools/release_build.py maturin build --release --locked --strip --zig \
96
+ --compatibility manylinux_2_28 --out dist
97
+ ```
98
+
99
+ <a id="release"></a>
100
+
101
+ ## CI and releases
102
+
103
+ [Tests](.github/workflows/tests.yml) run all TLA cases in 16 disjoint shards,
104
+ formatting, both Clippy configurations, Rust tests and installed-wheel checks on
105
+ CPython 3.10–3.13. [Wheels](.github/workflows/wheels.yml) requires that same-commit
106
+ workflow, checks each portable wheel and a wheel rebuilt from the sdist, then
107
+ uploads artifacts. Failed, cancelled, skipped or timed-out checks block release.
108
+ Hosted CI uses a local Linux filesystem and CPU PyTorch; inspect hosted results
109
+ separately from local checks and distributed deployment tests.
110
+
111
+ For a release, align the versions in `Cargo.toml`, `pyproject.toml` and the
112
+ `straw` entry in `Cargo.lock`; record compatibility/limits in the changelog.
113
+ A matching new `v*` tag triggers publication of the already tested artifacts.
114
+ PRs and manual dispatch build/test without publishing. Keep the source revision
115
+ and wheel hash with release artifacts; rebuilding changes the artifact identity.
116
+ Do not overwrite an existing published version/tag.
117
+
118
+ The publish job uses GitHub OIDC with environment `pypi`. Configure PyPI's
119
+ publisher for project `straw-queue`, repository `zhuzilin/straw`, workflow
120
+ `wheels.yml`, environment `pypi`; the workflow filename has no directory prefix.
121
+ No PyPI token is required by this workflow. See the
122
+ [PyPI publisher setup](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/)
123
+ for service setup. Both workflows also support manual dispatch from Actions.
124
+
125
+ <a id="evidence"></a>
126
+
127
+ ## Reports and public benchmarks
128
+
129
+ Keep per-run verification reports, attempted fixes, wheels, credentials, machine
130
+ addresses, payloads and raw logs in CI artifacts or ignored local directories.
131
+ Use fresh bounded test roots and clean them only after owned processes stop.
132
+
133
+ `verification/measurements/` contains only selected public benchmark data cited
134
+ by [benchmarks](docs/BENCHMARKS.md#published-results). A retained result needs
135
+ workload/method, build/probe identity, units, samples and limitations. Compare
136
+ payload sizes, publication granularity, fanout, durability and cache conditions;
137
+ do not imply an old build's numbers describe current code. Record one-off task
138
+ acceptance in the PR or CI result rather than adding another dated JSON file.