smd-engine 0.7.1__tar.gz → 0.7.2__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 (286) hide show
  1. {smd_engine-0.7.1 → smd_engine-0.7.2}/CHANGELOG.md +11 -0
  2. {smd_engine-0.7.1 → smd_engine-0.7.2}/PKG-INFO +1 -1
  3. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/deal/answers_boris.yaml +1 -1
  4. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/deal/answers_gleb.yaml +1 -1
  5. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/deal/answers_vera.yaml +1 -1
  6. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/deal/pack.yaml +1 -1
  7. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/commands.md +3 -2
  8. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/deal-mode.md +35 -12
  9. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/stages.md +1 -1
  10. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/task-packs.md +2 -2
  11. {smd_engine-0.7.1 → smd_engine-0.7.2}/pyproject.toml +1 -1
  12. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/cli.py +31 -0
  13. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/consent.py +60 -3
  14. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/signing.py +59 -7
  15. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/verdict.py +20 -4
  16. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/verdict_cmd.py +12 -6
  17. smd_engine-0.7.2/src/smd_engine/deal/verify.py +365 -0
  18. smd_engine-0.7.2/src/smd_engine/deal/verify_cmd.py +33 -0
  19. smd_engine-0.7.2/src/smd_engine/deal/verify_extra.py +221 -0
  20. smd_engine-0.7.2/src/smd_engine/deal/verify_report.py +90 -0
  21. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/task_pack.schema.json +1 -1
  22. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/task_verdicts.schema.json +3 -1
  23. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/cli.py +4 -0
  24. smd_engine-0.7.2/src/smd_engine/task/deal_labels.py +356 -0
  25. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/deal_web.py +28 -2
  26. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/diff.py +30 -1
  27. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/labels.py +4 -0
  28. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/pack_html.py +6 -4
  29. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/deal_helpers.py +18 -0
  30. smd_engine-0.7.2/tests/test_deal_added.py +163 -0
  31. smd_engine-0.7.2/tests/test_deal_bindings.py +275 -0
  32. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_positions.py +9 -8
  33. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_verdict.py +6 -2
  34. smd_engine-0.7.2/tests/test_deal_verify.py +325 -0
  35. smd_engine-0.7.2/tests/test_deal_verify_forged.py +210 -0
  36. {smd_engine-0.7.1 → smd_engine-0.7.2}/uv.lock +1 -1
  37. smd_engine-0.7.1/src/smd_engine/task/deal_labels.py +0 -198
  38. {smd_engine-0.7.1 → smd_engine-0.7.2}/.claude/agents/smd-game-technician.md +0 -0
  39. {smd_engine-0.7.1 → smd_engine-0.7.2}/.claude/agents/smd-methodologist.md +0 -0
  40. {smd_engine-0.7.1 → smd_engine-0.7.2}/.claude/agents/smd-visionary.md +0 -0
  41. {smd_engine-0.7.1 → smd_engine-0.7.2}/.claude/commands/procedure.md +0 -0
  42. {smd_engine-0.7.1 → smd_engine-0.7.2}/.flake8 +0 -0
  43. {smd_engine-0.7.1 → smd_engine-0.7.2}/.github/workflows/ci.yml +0 -0
  44. {smd_engine-0.7.1 → smd_engine-0.7.2}/.github/workflows/release.yml +0 -0
  45. {smd_engine-0.7.1 → smd_engine-0.7.2}/.gitignore +0 -0
  46. {smd_engine-0.7.1 → smd_engine-0.7.2}/.python-version +0 -0
  47. {smd_engine-0.7.1 → smd_engine-0.7.2}/CONTRIBUTING.md +0 -0
  48. {smd_engine-0.7.1 → smd_engine-0.7.2}/LICENSE +0 -0
  49. {smd_engine-0.7.1 → smd_engine-0.7.2}/README.md +0 -0
  50. {smd_engine-0.7.1 → smd_engine-0.7.2}/README_ru.md +0 -0
  51. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/bakeries-c1.board.yaml +0 -0
  52. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/bakeries-c2.board.yaml +0 -0
  53. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/golden/README.md +0 -0
  54. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/golden/bakeries-c2-expected.board.yaml +0 -0
  55. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/golden/s3_transcript.txt +0 -0
  56. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/patches/bakeries-c2-1.patch.yaml +0 -0
  57. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/sources.yaml +0 -0
  58. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/task/answers_ana.yaml +0 -0
  59. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/task/answers_ben.yaml +0 -0
  60. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/task/answers_cy.yaml +0 -0
  61. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/task/pack.yaml +0 -0
  62. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/task/replies_ana.yaml +0 -0
  63. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/task/replies_ben.yaml +0 -0
  64. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/task/transcript_ben.txt +0 -0
  65. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example/two-boards-c1.board.yaml +0 -0
  66. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example_ru/pekarni-c1.board.yaml +0 -0
  67. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example_ru/pekarni-c2.board.yaml +0 -0
  68. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example_ru/pekarni-oru-c1.board.yaml +0 -0
  69. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example_ru/pekarnya-holding-c1.board.yaml +0 -0
  70. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/example_ru/sources.yaml +0 -0
  71. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/README.md +0 -0
  72. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/bank.story.yaml +0 -0
  73. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/buyer.story.yaml +0 -0
  74. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/owner.story.yaml +0 -0
  75. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/sources.yaml +0 -0
  76. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/spectra-coffee-c1.board.yaml +0 -0
  77. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/successor-premortem.story.yaml +0 -0
  78. {smd_engine-0.7.1 → smd_engine-0.7.2}/cases/spectra_coffee/taxonomies.yaml +0 -0
  79. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/README.md +0 -0
  80. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/changelog-0.2-0.5.md +0 -0
  81. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/checks.md +0 -0
  82. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/data-model.md +0 -0
  83. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/first-board.md +0 -0
  84. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/glossary.md +0 -0
  85. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/hypotheses.md +0 -0
  86. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/README.md +0 -0
  87. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/encodable.md +0 -0
  88. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/formal-stance.md +0 -0
  89. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/odi-problematization.md +0 -0
  90. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/reconciliation.md +0 -0
  91. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/robustness-rules.md +0 -0
  92. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/roles-and-actors.md +0 -0
  93. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/smd-classic.md +0 -0
  94. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/sources.md +0 -0
  95. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/structural-moves.md +0 -0
  96. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/method/triz-systems.md +0 -0
  97. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/plan.md +0 -0
  98. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/profiles.md +0 -0
  99. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/red-lines.md +0 -0
  100. {smd_engine-0.7.1 → smd_engine-0.7.2}/docs/stories.md +0 -0
  101. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/README.md +0 -0
  102. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/beer-viable-system.md +0 -0
  103. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/design-chain.md +0 -0
  104. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/fliamer-diamond.md +0 -0
  105. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/khaprov-levels.md +0 -0
  106. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/khaprov-ontology.md +0 -0
  107. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/scamper-check.md +0 -0
  108. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/schukin-boundaries.md +0 -0
  109. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/schukin-interface-tax.md +0 -0
  110. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/three-positions.md +0 -0
  111. {smd_engine-0.7.1 → smd_engine-0.7.2}/lenses/triz-contradictions.md +0 -0
  112. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/README.md +0 -0
  113. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/field-result.md +0 -0
  114. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/functional-plan.md +0 -0
  115. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/ingest-transcript.md +0 -0
  116. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/positional-construction.md +0 -0
  117. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/problematization.md +0 -0
  118. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/qualification-pass.md +0 -0
  119. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/reflexive-protocol.md +0 -0
  120. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/small-situation.md +0 -0
  121. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/solo-session.md +0 -0
  122. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/stakeholder-ontology.md +0 -0
  123. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/story.md +0 -0
  124. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/task-diff.md +0 -0
  125. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/task-pack.md +0 -0
  126. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/theses-to-board.md +0 -0
  127. {smd_engine-0.7.1 → smd_engine-0.7.2}/procedures/visionary-tract.md +0 -0
  128. {smd_engine-0.7.1 → smd_engine-0.7.2}/profiles/classic-two-boards.yaml +0 -0
  129. {smd_engine-0.7.1 → smd_engine-0.7.2}/profiles/management-four-boards.yaml +0 -0
  130. {smd_engine-0.7.1 → smd_engine-0.7.2}/profiles/program-three-boards.yaml +0 -0
  131. {smd_engine-0.7.1 → smd_engine-0.7.2}/roles/README.md +0 -0
  132. {smd_engine-0.7.1 → smd_engine-0.7.2}/roles/actors.md +0 -0
  133. {smd_engine-0.7.1 → smd_engine-0.7.2}/roles/game-technician.md +0 -0
  134. {smd_engine-0.7.1 → smd_engine-0.7.2}/roles/methodologist.md +0 -0
  135. {smd_engine-0.7.1 → smd_engine-0.7.2}/roles/researcher.md +0 -0
  136. {smd_engine-0.7.1 → smd_engine-0.7.2}/roles/visionary.md +0 -0
  137. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/__init__.py +0 -0
  138. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/agree.py +0 -0
  139. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/apply.py +0 -0
  140. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/cli.py +0 -0
  141. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/compare.py +0 -0
  142. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/__init__.py +0 -0
  143. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/agenda_views.py +0 -0
  144. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/ledger.py +0 -0
  145. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/overlap.py +0 -0
  146. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/seal_cmd.py +0 -0
  147. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/sealed.py +0 -0
  148. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/deal/views.py +0 -0
  149. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/eval.py +0 -0
  150. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/leverage.py +0 -0
  151. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/migrate.py +0 -0
  152. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/nextstep.py +0 -0
  153. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/pack.py +0 -0
  154. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/profile.py +0 -0
  155. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/records.py +0 -0
  156. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/redline.py +0 -0
  157. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/__init__.py +0 -0
  158. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/assets/frames.css +0 -0
  159. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/assets/frames.js +0 -0
  160. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/assets/graph.css +0 -0
  161. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/assets/graph.js +0 -0
  162. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/frames.py +0 -0
  163. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/frames_page.py +0 -0
  164. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/frames_text.py +0 -0
  165. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/graph.py +0 -0
  166. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/graph_ui.py +0 -0
  167. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/html.py +0 -0
  168. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/index.py +0 -0
  169. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/layout.py +0 -0
  170. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/light.py +0 -0
  171. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/markdown.py +0 -0
  172. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/mermaid.py +0 -0
  173. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/sessionflow.py +0 -0
  174. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/svg.py +0 -0
  175. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/text.py +0 -0
  176. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/render/vault.py +0 -0
  177. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/revise.py +0 -0
  178. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/scaffold.py +0 -0
  179. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/__init__.py +0 -0
  180. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/board_patch.schema.json +0 -0
  181. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/board_set.schema.json +0 -0
  182. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/source_manifest.schema.json +0 -0
  183. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/story.schema.json +0 -0
  184. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/task_acceptance.schema.json +0 -0
  185. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/task_answers.schema.json +0 -0
  186. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/task_replies.schema.json +0 -0
  187. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/task_sealed.schema.json +0 -0
  188. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/schemas/taxonomies.schema.json +0 -0
  189. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/screen.py +0 -0
  190. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/sources.py +0 -0
  191. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/status.py +0 -0
  192. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/story/__init__.py +0 -0
  193. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/story/check.py +0 -0
  194. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/story/gaps.py +0 -0
  195. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/story/model.py +0 -0
  196. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/story/numbers.py +0 -0
  197. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/story/paths.py +0 -0
  198. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/story/render.py +0 -0
  199. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/__init__.py +0 -0
  200. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/acceptance.py +0 -0
  201. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/agenda.py +0 -0
  202. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/asking.py +0 -0
  203. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/assets/task.css +0 -0
  204. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/assets/task.js +0 -0
  205. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/bounds.py +0 -0
  206. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/check.py +0 -0
  207. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/deal_check.py +0 -0
  208. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/deal_items.py +0 -0
  209. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/deal_render.py +0 -0
  210. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/diff_html.py +0 -0
  211. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/diff_md.py +0 -0
  212. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/model.py +0 -0
  213. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/names.py +0 -0
  214. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/overwrite.py +0 -0
  215. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/pack_md.py +0 -0
  216. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/pairs.py +0 -0
  217. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/positions.py +0 -0
  218. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/ranges.py +0 -0
  219. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/refs.py +0 -0
  220. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/svg.py +0 -0
  221. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/task/web.py +0 -0
  222. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/__init__.py +0 -0
  223. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/ai.py +0 -0
  224. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/context.py +0 -0
  225. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/graph.py +0 -0
  226. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/hints.py +0 -0
  227. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/hypotheses.py +0 -0
  228. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/management.py +0 -0
  229. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/manifest.py +0 -0
  230. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/ontology.py +0 -0
  231. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/redlines.py +0 -0
  232. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/signoffs.py +0 -0
  233. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/structure.py +0 -0
  234. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/taxonomies.py +0 -0
  235. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/theses.py +0 -0
  236. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/validate/tract.py +0 -0
  237. {smd_engine-0.7.1 → smd_engine-0.7.2}/src/smd_engine/verdict.py +0 -0
  238. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/conftest.py +0 -0
  239. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/story_helpers.py +0 -0
  240. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_action_program.py +0 -0
  241. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_agree.py +0 -0
  242. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_ai_roles.py +0 -0
  243. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_apply.py +0 -0
  244. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_beer_layer.py +0 -0
  245. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_beer_render.py +0 -0
  246. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_compare.py +0 -0
  247. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_acceptance.py +0 -0
  248. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_agenda_leaks.py +0 -0
  249. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_golden.py +0 -0
  250. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_items.py +0 -0
  251. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_ranges.py +0 -0
  252. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_sealed.py +0 -0
  253. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_signed.py +0 -0
  254. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_deal_views.py +0 -0
  255. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_eval.py +0 -0
  256. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_export.py +0 -0
  257. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_frames.py +0 -0
  258. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_graph.py +0 -0
  259. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_hypothesis_standard.py +0 -0
  260. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_ingestion.py +0 -0
  261. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_lenses.py +0 -0
  262. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_management.py +0 -0
  263. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_migrate.py +0 -0
  264. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_nextstep.py +0 -0
  265. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_ontology_continuum.py +0 -0
  266. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_procedure_checks.py +0 -0
  267. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_procedures.py +0 -0
  268. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_profile.py +0 -0
  269. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_publish.py +0 -0
  270. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_record_boards.py +0 -0
  271. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_red_lines.py +0 -0
  272. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_render_and_cli.py +0 -0
  273. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_render_carries.py +0 -0
  274. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_render_fields.py +0 -0
  275. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_render_ru_pages.py +0 -0
  276. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_render_ru_values.py +0 -0
  277. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_revise.py +0 -0
  278. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_robustness.py +0 -0
  279. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_scaffold.py +0 -0
  280. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_status.py +0 -0
  281. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_story_case.py +0 -0
  282. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_story_check.py +0 -0
  283. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_story_numbers.py +0 -0
  284. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_story_paths.py +0 -0
  285. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_task.py +0 -0
  286. {smd_engine-0.7.1 → smd_engine-0.7.2}/tests/test_validate.py +0 -0
@@ -4,6 +4,17 @@ Dates are those of the tag. All tags v0.2.1 to v0.3.5 were made on 2026-10-29. T
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.7.2 - 2026-11-02
8
+
9
+ The sealed floor audited and bound to the pack text (the case owner, dz02#l=69). Schema 0.1 stays; every new field is optional, and 0.7.0 and 0.7.1 packs, answers, consent files and ledgers still load (old entries are reported `unbound`). Packs without positions give the same bytes as before.
10
+
11
+ - `smd deal verify pack.yaml --ledger verdicts.yaml [--answers ...] [--sealed dir] [--diff diff.yaml] [--json]`: an audit of the ledger any party can run (`src/smd_engine/deal/verify.py`, `verify_extra.py`, `verify_report.py`, `verify_cmd.py`). It checks the chain and head; each consent entry (signature over its stored text with the member's key, hash, bindings to the deal, topic, run, buyer, core sha256 and key list); each counted verdict (the consents it names are earlier, valid, current, for the same topic, run and buyer, with its commitments; seller, and buyer for a second run; run number and cap of two; answers sha256 against the files given, their signatures and commitments); with `--sealed` the outcome recomputed from the sealed files (signatures checked, no number printed); with `--diff` its head and verdicts. Lines are `ok`, `FAIL` or `unbound (old entry)` (labels in English and Russian, `VERIFY_LABELS` in `deal_labels.py`); exit 1 on a `FAIL` or an `unbound` entry (fail closed; `--allow-unbound` for a ledger known to be old); the last line says "all checks passed" only when nothing is `unbound` (else "no check failed, but not fully verified"), and `--json` has `complete`. A counted verdict whose `consents` list is empty is a `FAIL` (the consents it needs are not among them). A counted verdict whose `answers` lack the floor or the ceiling party, or name a non-member, is a `FAIL`. Entries from before 0.7.2 are `unbound`; after the first 0.7.2 entry a later one without the new fields is `FAIL`. `consent.binding_code` is new (the codes behind `binding_problem`). Tests: `tests/test_deal_verify.py`, `tests/test_deal_verify_forged.py` (an empty `consents` list, replaced or replayed inputs, `--allow-unbound`).
12
+ - Bindings of the sealed floor (packs with `deal.sealed_floor: true`; schema 0.1, new fields optional). The `task_consent` file names `pack.sha256` (the core sha256) and `keys` (`key_list_sha` in `signing.py`: sha256 of the sorted `<member> <key>` lines); `smd deal consent` and `smd deal verdict` refuse a consent whose values differ from the pack, and a 0.7.1 consent without them (re-sign; it stays readable in an old ledger and a verdict does not count it). The answers files of members with an `ssh_key` are signed (`answers_<member>.yaml.sig`, namespace `smd-deal`); `smd deal verdict` refuses an unsigned or badly signed one, `smd task diff` only warns. The verdict entry records `answers: {member: sha256}` and, when counted, `consents: [entry sha256, ...]` (schema `task_verdicts`; the chain covers them, older entries without them still verify). A swapped-back older answers file is caught by the signed consents (`commitment_changed`) and its sha256 is on record. Packs without positions give the same bytes as before. Tests: `tests/test_deal_bindings.py`.
13
+ - Deal packs: the diff id of an added point is `add-<member>-<8 hex of the sha256 of its text>` (`-2`, `-3` on a repeat of a shared text; an unshared point hashes its text with a prefix, so no private point is counted in a shared id), no longer `add-<member>-<n>`, whose number showed how many unshared points a member has. Group packs keep the old ids. A diff made before this change has the old ids; make it again.
14
+ - Deal pack forms (`pack.html`, `pack.<position>.html`): each added point has a box «показать всем позициям» / "share with all positions", off by default, and the hint says a point is for the author's position only unless shared; the downloaded answers file carries `share: true` when ticked. Group pages are byte for byte as before, a group pack with a range item or a fact item included (the share box is added only to a deal pack's page).
15
+ - `cases/example/deal/pack.yaml` names `task-diff 0.2.1`; the answers files are restamped.
16
+ - Docs: `deal-mode.md` (the cycle, signatures with the new bindings, "Limits of the signatures" rewritten as closed and still open, "Verifying the ledger", threat model), `commands.md`, `task-packs.md`, `stages.md`.
17
+
7
18
  ## 0.7.1 - 2026-11-02
8
19
 
9
20
  Fixes to the weak points of deal mode that 0.7.0 left open (the case owner, dz02#l=63). Schema 0.1 stays; every new field is optional, and 0.7.0 packs, answers, diffs and ledgers still load. Packs without positions give the same bytes as before (the pilot pack and the group example were compared byte for byte).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: smd-engine
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Records, checks and renderings for SMD-style thinking sessions (three boards, cycles, qualifications)
5
5
  Project-URL: Homepage, https://github.com/viberesearch/smd-engine
6
6
  Project-URL: Repository, https://github.com/viberesearch/smd-engine
@@ -3,7 +3,7 @@ schema_version: "0.1"
3
3
  pack:
4
4
  id: bakery-sale
5
5
  version: "1"
6
- sha256: "1a649e4ed499620f8eebc97f73bdb74b0b1c01b47bcc954e689ef87c850e5a4d"
6
+ sha256: "ff3f0133dbf3596c26d05a9410a0d5febfcddcedec79af7fbf48bbadc5598f5f"
7
7
  annex: {position: buyer, sha256: "35b25dc48f138d648d4c999e154411c02aae7c7a20d84cb7078d9d9f60e89375"}
8
8
  member: boris
9
9
  date: "2026-11-03"
@@ -3,7 +3,7 @@ schema_version: "0.1"
3
3
  pack:
4
4
  id: bakery-sale
5
5
  version: "1"
6
- sha256: "1a649e4ed499620f8eebc97f73bdb74b0b1c01b47bcc954e689ef87c850e5a4d"
6
+ sha256: "ff3f0133dbf3596c26d05a9410a0d5febfcddcedec79af7fbf48bbadc5598f5f"
7
7
  annex: {position: broker, sha256: "56072184ee793f34fc3a116cb86c69446860ec2fb7332776935791dc56b439e3"}
8
8
  member: gleb
9
9
  date: "2026-11-03"
@@ -3,7 +3,7 @@ schema_version: "0.1"
3
3
  pack:
4
4
  id: bakery-sale
5
5
  version: "1"
6
- sha256: "1a649e4ed499620f8eebc97f73bdb74b0b1c01b47bcc954e689ef87c850e5a4d"
6
+ sha256: "ff3f0133dbf3596c26d05a9410a0d5febfcddcedec79af7fbf48bbadc5598f5f"
7
7
  annex: {position: seller, sha256: "c73f2cf96a6ba1737aad29f20a6e2662f9dfd8c0808ad82dc711f92158693cc4"}
8
8
  member: vera
9
9
  date: "2026-11-03"
@@ -192,4 +192,4 @@ items:
192
192
  required: false
193
193
  stage: full-map
194
194
  diff:
195
- procedure: task-diff 0.2.0
195
+ procedure: task-diff 0.2.1
@@ -32,12 +32,13 @@ uv run smd story paths cases/spectra_coffee/spectra-coffee-c1.board.yaml --audie
32
32
  uv run smd story check cases/spectra_coffee/bank.story.yaml --boards cases/spectra_coffee/spectra-coffee-c1.board.yaml # a story file against rules G1-G7 and S1-S5: ids, levels, numbers, allow-list, dropped oppositions, board stamp, ids off the walk that `context` does not list; exit 1 on an error; `smd story render story.yaml --md` prints a story as Markdown; paths, check and render take --sources and --taxonomies
33
33
  uv run smd task check cases/example/task/pack.yaml cases/example/task/answers_ana.yaml --replies cases/example/task/replies_ana.yaml --diff out/diff/diff.yaml # a task pack and its files: schemas, pack sha256, member, item ids, option ids, transcript sha256; --replies and --diff check replies against the diff; --acceptance (with --board, --prior) checks map acceptances and names the elements to ask again; exit 1 on an error; docs/task-packs.md
34
34
  uv run smd task render cases/example/task/pack.yaml -o out/pack # pack.md (tables, the cycle and the ontology relations as Mermaid) and pack.html (one offline file: ontology as inline SVG, the items as a form with autosave, an export button for answers_<member>.yaml); given a diff.yaml it writes diff.md and diff.html; a deal pack (with positions) is rendered as its shared core, and `--position <id>` writes pack.<id>.md and pack.<id>.html with that position's annex, and `--stage <id>` shows the seller's asking price from the stage that opens it on (else the pages say when it opens)
35
- uv run smd task diff cases/example/task/pack.yaml cases/example/task/answers_*.yaml -o out/diff # (deal packs: --ledger verdicts.yaml adds the verdicts and the ledger head; a deal diff with annex points is the holder's file only and the command warns, send parties their views from `smd deal views`) the answers side by side: diff.yaml, diff.md, diff.html; refuses answers with another pack sha256 and a diff.yaml that differs from the new one (--force overwrites); the model's part is procedures/task-diff.md
35
+ uv run smd task diff cases/example/task/pack.yaml cases/example/task/answers_*.yaml -o out/diff # (deal packs with deal.sealed_floor: warns for each answers file of a key holder without a valid `<file>.sig`; deal packs: --ledger verdicts.yaml adds the verdicts and the ledger head; a deal diff with annex points is the holder's file only and the command warns, send parties their views from `smd deal views`) the answers side by side: diff.yaml, diff.md, diff.html; refuses answers with another pack sha256 and a diff.yaml that differs from the new one (--force overwrites); the model's part is procedures/task-diff.md
36
36
  uv run smd task agenda out/diff/diff.yaml cases/example/task/replies_ana.yaml cases/example/task/replies_ben.yaml --members ana,ben,cy -o out/agenda.md # the points for the call (a member's discuss, or no reply to an open point) and the points settled before it: agenda.md and agenda.yaml; refuses replies for another diff
37
37
  uv run smd deal views cases/example/deal/pack.yaml out/diff/diff.yaml -o out/views # deal pack: diff.<position>.yaml, .md, .html for each position (--position limits it): no point outside the position's audience, no buyer-side fact dispute for the seller's side, value points open or settled only with the other side's answers removed; a broker gets his principal's view; with `--replies r.yaml... --members a,b,c` it also writes agenda.<position>.yaml and .md cut the same way (the common `smd task agenda` shows an annex point only under its call_title); docs/task-packs.md
38
38
  uv run smd deal seal cases/example/deal/pack.yaml price-floor -o ~/sealed # deal pack: seal a number for a bound item on your own machine; asks for the number unseen (or --value), writes sealed_<member>_<item>.yaml (private, outside every repo) and prints the commitment to put in your answers file; the number and the salt are never printed; with `--key <private key>` it also signs the file with ssh-keygen (`<file>.sig`), else it prints the command to run; docs/task-packs.md
39
- uv run smd deal verdict cases/example/deal/pack.yaml price --answers answers_vera.yaml answers_boris.yaml --floor sealed_vera_price-floor.yaml --ceiling sealed_boris_price-ceiling.yaml --ledger verdicts.yaml # the holder (--new for the first entry of a ledger when no consent started it): compare a sealed floor and ceiling (holder.method, local-v1) and append met, not_met or not_tested to the hash-chained ledger; prints the verdict in the pack language and never a number; every run needs the seller's consent naming the buyer, a second also the buyer's, two runs at most; with deal.sealed_floor it verifies the signatures of the counted consents and of the files (`--floor-sig`, `--ceiling-sig`) and refuses the run if one is missing or bad; docs/task-packs.md
39
+ uv run smd deal verdict cases/example/deal/pack.yaml price --answers answers_vera.yaml answers_boris.yaml --floor sealed_vera_price-floor.yaml --ceiling sealed_boris_price-ceiling.yaml --ledger verdicts.yaml # the holder (--new for the first entry of a ledger when no consent started it): compare a sealed floor and ceiling (holder.method, local-v1) and append met, not_met or not_tested to the hash-chained ledger; prints the verdict in the pack language and never a number; every run needs the seller's consent naming the buyer, a second also the buyer's, two runs at most; with deal.sealed_floor it verifies the signatures of the counted consents (bound to the pack's core sha256 and key list), of the answers files of key holders (`<file>.sig`) and of the sealed files (`--floor-sig`, `--ceiling-sig`) and refuses the run if one is missing or bad, and the entry records `answers` and `consents`; docs/task-packs.md
40
40
  uv run smd deal consent cases/example/deal/pack.yaml price --member vera --evidence consent_vera.yaml --ledger verdicts.yaml --new # log one party consent to the next run: his task_consent file (this deal, topic, run, member, buyer and the two commitments); the seller's for every run (the first consent of a deal takes --new), the buyer's too for a second run; with deal.sealed_floor the file needs his SSH signature (`--signature`, default `<evidence>.sig`), kept in the entry
41
+ uv run smd deal verify cases/example/deal/pack.yaml --ledger verdicts.yaml --answers answers_vera.yaml answers_boris.yaml answers_gleb.yaml --sealed safe/ --diff out/diff.yaml # audit a ledger (any party; exit 1 on a FAIL, else 0): chain and head; each consent's signature, hash, bindings (this deal, topic, run, buyer, core sha256, key list); each counted verdict's consents (earlier, valid, current, seller and for a second run buyer), run number and cap, recorded answers sha256 against the files given; with --sealed (the holder's folder of sealed files and .sig) the outcome is recomputed, no number printed; with --diff its head and verdicts; entries from before 0.7.2 read unbound (the last line then says not fully verified, and the exit is 1 unless --allow-unbound); a counted verdict that names no consents (consents: []) is a FAIL; --json for a report; docs/deal-mode.md
41
42
  uv run smd sources cases/example/sources.yaml --clean-room --deny-lineage earlier-concept
42
43
  uv run smd sources path/to/sources.yaml --folder /local/folder
43
44
  uv run smd sources path/to/sources.yaml --folder /local/folder --refresh [ids] # recompute sha256 of the named sources (default: every decision_log); a source that already carries `lines` gets its count rewritten, one that does not is not given one; edit only those lines of the manifest
@@ -1,6 +1,6 @@
1
1
  # Deal mode: task packs for a sale or transfer
2
2
 
3
- A task pack (see `task-packs.md`) serves a group that answers apart. Deal mode adds optional fields so that the same cycle serves counterparties: a seller, a buyer, brokers, and a neutral holder of one sealed number. Nothing here changes a group pack: a pack with none of the new fields validates, renders and diffs byte for byte as before (`tests/test_deal_golden.py`). Schema stays `0.1`; deal mode came with 0.7.0 and 0.7.1 added signatures and per-position agendas. The invented example is `cases/example/deal/`. The decisions behind it are the case owner's, 2 November 2026 (dz02#l=43, dz02#l=47, and dz02#l=55 on the price: asking price first).
3
+ A task pack (see `task-packs.md`) serves a group that answers apart. Deal mode adds optional fields so that the same cycle serves counterparties: a seller, a buyer, brokers, and a neutral holder of one sealed number. Nothing here changes a group pack: a pack with none of the new fields validates, renders and diffs byte for byte as before (`tests/test_deal_golden.py`). Schema stays `0.1`; deal mode came with 0.7.0, 0.7.1 added signatures and per-position agendas, and 0.7.2 bound consents and answers to the pack and added `smd deal verify`. The invented example is `cases/example/deal/`. The decisions behind it are the case owner's, 2 November 2026 (dz02#l=43, dz02#l=47, and dz02#l=55 on the price: asking price first).
4
4
 
5
5
  What deal mode is for: the parties read the same description of the business, find where they read it differently, and arrive at the table with one picture. They may then agree on everything except the price. That is a normal, successful result, so the price is never a stop. The seller states an asking price in the pack, and the price is bargained at an in-person meeting. Only if the seller switches it on does the engine also report a flag on whether his sealed floor and the buyer's sealed ceiling met.
6
6
 
@@ -99,7 +99,7 @@ The route is `price_meeting`: the parties meet in person and bargain, holding a
99
99
 
100
100
  **Ledger.** `verdicts.yaml` (record `task_verdicts`) is append-only and hash-chained: each entry has `prev_sha256` and its own `sha256`, so an edited entry breaks the chain. It contains verdicts, consents and the public commitments, and no number. `smd task diff --ledger verdicts.yaml` verifies the chain and writes each bound point's `verdict` and the `ledger_head` into `diff.yaml`; a ledger cut short later no longer matches an earlier diff, and `task diff` refuses to overwrite that file. If a party's commitment in the answers is not the one the latest counted run used, the point reads `not_tested` and carries `changed_since_run` (the members), so a verdict is never shown for a number nobody has compared. The first entry of a deal's ledger, the seller's consent to run 1 or a verdict, takes `--new` to start it; without it the file must exist, so a mistyped path cannot start a new ledger with a run count of zero.
101
101
 
102
- **Run cap and the seller's consent.** One run per seller-buyer pair, topic and deal, and every run, the first included, needs the seller's consent entry naming the buyer. A second run needs a consent entry from each of the two parties. `smd deal consent pack.yaml <topic> --member <id> --evidence <file> --ledger verdicts.yaml` logs one; the first consent of a deal takes `--new`, which starts the ledger. The evidence is the party's `task_consent` file: `record`, `deal`, `pack: {id}`, `topic`, `run`, `member`, `buyer` (the member who commits the ceiling) and `commitments: {floor, ceiling}`, the two commitments now in the answers files. The command refuses a file for another member, run, topic, deal or buyer, and a buyer's consent to the first run; the entry keeps the buyer, the file's sha256 and the commitments, and with the sealed floor the file's text (`signed`) and the signature. With a number missing the result is `no_floor` or `no_ceiling`, not `consent_missing`. A run whose commitments differ from those in both consents is `commitment_changed`; after a party changes his number both consent again, and see the new commitment. A file cannot be reused for another party or run. With the sealed floor the file is also signed (see "Signatures"), so the engine can tell who wrote it. A broker cannot consent. Two runs at most; a third is `cap_reached`. A run that returns `not_tested` gives nothing away and does not count. Each counted run gives each side at most one bit.
102
+ **Run cap and the seller's consent.** One run per seller-buyer pair, topic and deal, and every run, the first included, needs the seller's consent entry naming the buyer. A second run needs a consent entry from each of the two parties. `smd deal consent pack.yaml <topic> --member <id> --evidence <file> --ledger verdicts.yaml` logs one; the first consent of a deal takes `--new`, which starts the ledger. The evidence is the party's `task_consent` file: `record`, `deal`, `pack: {id, sha256}`, `keys`, `topic`, `run`, `member`, `buyer` (the member who commits the ceiling) and `commitments: {floor, ceiling}`, the two commitments now in the answers files. The command refuses a file for another member, run, topic, deal or buyer, and a buyer's consent to the first run; the entry keeps the buyer, the file's sha256 and the commitments, and with the sealed floor the file's text (`signed`) and the signature. With a number missing the result is `no_floor` or `no_ceiling`, not `consent_missing`. A run whose commitments differ from those in both consents is `commitment_changed`; after a party changes his number both consent again, and see the new commitment. A file cannot be reused for another party or run. With the sealed floor the file is also signed (see "Signatures"), so the engine can tell who wrote it. A broker cannot consent. Two runs at most; a third is `cap_reached`. A run that returns `not_tested` gives nothing away and does not count. Each counted run gives each side at most one bit.
103
103
 
104
104
  ## Signatures
105
105
 
@@ -108,16 +108,39 @@ Without signatures the holder's operator could write both parties' consent files
108
108
  - **Keys.** `members[].ssh_key` is one OpenSSH public key line (`ssh-ed25519 AAAA... name`). `smd task check` requires it for every member in a seller or buyer position (a broker needs none), refuses a malformed line and a key shared by two members. A member's key is in the core, so changing it voids the answers. Without `sealed_floor` the field is not asked for.
109
109
  - **Namespace and signer.** Namespace `smd-deal`; the signer principal is the member id.
110
110
  - **Sealed file.** `smd deal seal pack.yaml <item> -o dir --key <private key>` signs the sealed file after writing it (`ssh-keygen -Y sign`, signature `<file>.sig`). Without `--key`, or when signing fails (a wrong key path or passphrase), it prints the commitment and the command for the party to run; the file stays, since a second seal of the item is refused. The party sends the signature with the sealed file.
111
- - **Consent.** The party signs his `task_consent` file; `smd deal consent` takes `--signature` (default `<evidence>.sig`), verifies the file against his key in the pack and refuses a missing or bad signature. The ledger entry also stores the exact text (`signed`, with `evidence` its sha256) and the armored `signature`, so anyone with the ledger can verify the consent again. A ledger from before signatures stays readable; its unsigned consent is replaced by a signed consent naming the same commitments (`smd deal consent` takes it once), since a sealed-floor verdict refuses the unsigned one. A consent whose text the YAML ledger cannot keep exactly (a control character such as U+0085 in a one-line flow-style file) is refused, so that the entry hash stays valid.
112
- - **Verdict.** In a sealed-floor pack `smd deal verdict` first re-verifies every consent entry it counts for the run (signature, `evidence` against `signed`, and the entry's commitments and buyer against the signed text), then the floor file against the seller's key and the ceiling file, if given, against the buyer's (`--floor-sig`, `--ceiling-sig`, default `<file>.sig`). It refuses the run, and logs nothing, if one is unsigned or bad. A run past the cap counts and opens nothing, so nothing is checked.
111
+ - **Consent.** The party signs his `task_consent` file, which names `pack.sha256` (the core sha256 of the pack he was sent) and `keys` (the sha256 of the pack's key list: the lines `<member> <type> <base64>` of every member with a key, comment dropped, sorted, joined by newlines; `key_list_sha` in `signing.py`). `smd deal consent` refuses a consent whose `pack.sha256` or `keys` differs from the pack it is given, and one that names neither (a 0.7.1 consent: the message says to write it again and sign it again); `smd deal consent` takes `--signature` (default `<evidence>.sig`), verifies the file against his key in the pack and refuses a missing or bad signature. The ledger entry also stores the exact text (`signed`, with `evidence` its sha256) and the armored `signature`, so anyone with the ledger can verify the consent again. A ledger from before signatures or before the bindings stays readable; its unsigned (0.7.0) or unbound (0.7.1) consent is replaced by a signed, bound consent naming the same commitments (`smd deal consent` takes it once), since a sealed-floor verdict refuses the old one. A consent whose text the YAML ledger cannot keep exactly (a control character such as U+0085 in a one-line flow-style file) is refused, so that the entry hash stays valid.
112
+ - **Answers files.** A member with an `ssh_key` signs his `answers_<member>.yaml` as it is (`ssh-keygen -Y sign -f <private key> -n smd-deal answers_<member>.yaml`, signature `answers_<member>.yaml.sig` beside it); a broker without a key signs nothing. The signature covers the whole file, so he signs again after every change, such as a new commitment. `smd task diff` on a sealed-floor pack only warns for each answers file of a key-holding member that has no valid signature (stderr; the diff is written as usual), since the group may diff before it signs; `smd deal verdict` refuses (see below).
113
+ - **Verdict.** In a sealed-floor pack `smd deal verdict` first re-verifies every consent entry it counts for the run (signature, `evidence` against `signed`, the entry's commitments and buyer against the signed text, and `pack.sha256` and `keys` against the pack; a consent that names neither is refused), then the answers file of every member with a key given with `--answers` (`<file>.sig`, signer the member id), then the floor file against the seller's key and the ceiling file, if given, against the buyer's (`--floor-sig`, `--ceiling-sig`, default `<file>.sig`). It refuses the run, and logs nothing, if one is unsigned or bad. A run past the cap counts and opens nothing, so nothing is checked. The verdict entry then records `answers: {member: sha256}`, the sha256 of each answers file it read, and, when the run is counted (`met` or `not_met`), `consents: [entry sha256, ...]`, the consent entries it counted (seller first, by entry number); the hash chain covers both, so a later audit can tie a verdict to its signed inputs. Entries of older ledgers have neither and still verify. A consent names the commitments, so an older answers file swapped back by the operator (its signature still valid) shows as `commitment_changed` and is not counted, and the entry records its sha256 for the party to compare with his own copy; no separate sha rule was added, since a second run already needs both parties' signed consents to the commitments now in the answers.
113
114
 
114
115
  The operator can still read both numbers (see the threat model); what he can no longer do is consent or commit for a party, within the pack the party holds.
115
116
 
116
- **Limits of the signatures.** They cover each consent and sealed file as written, and the run `smd deal verdict` is making, not the ledger as a whole:
117
+ **Limits of the signatures.** In 0.7.1 three things were open; 0.7.2 closes the first two in part and narrows the third.
117
118
 
118
- - A verdict entry written by hand into the ledger and rechained is accepted by `smd task diff --ledger`; no command re-verifies a counted verdict against signed consents and sealed files (there is no `smd deal verify` yet), and a verdict entry does not name the consents it used. A party who kept the earlier diff sees the changed head; one who did not has nothing to compare.
119
- - A consent names the pack id, not the core sha256 or the key list. An operator who forks the pack with keys of his own (or with `sealed_floor` off) gets a ledger whose signatures verify under the fork. A party compares the core sha256 of the pack he was sent with the one the holder used, and the commitments in the ledger with those in his own answers file.
120
- - The answers files are not signed. The operator can put back an older answers file of a party whose earlier signed sealed file still verifies, and a run is logged on the superseded commitment. The signature proves who wrote the sealed file, not that it is his current one; the party sees the commitment in the diff.
119
+ Closed in 0.7.2:
120
+
121
+ - A consent is bound to the pack: it names the core sha256 and the key list, so it cannot be carried to a fork of the pack with other text or other keys. An older signed answers file put back by the operator shows as `commitment_changed`, and the answers sha256 is on record in the verdict entry.
122
+ - A verdict entry names the consents it counted and the answers files it read, and `smd deal verify` (below) re-checks them against the signed consents, the answers files and, for the holder, the sealed files. A hand-written or replayed entry is a `FAIL`.
123
+ - Answers files of key holders are signed; `smd deal verdict` refuses an unsigned one.
124
+
125
+ Still open:
126
+
127
+ - A ledger of the old kind from its first entry (no signed, bound consent) passes `smd deal verify` with every line `unbound`, and so does a ledger whose first entries are old and whose later ones are signed: the old entries before the first 0.7.2 entry cannot be told from forged ones, since a 0.7.0 or 0.7.1 ledger is legitimately like that. The summary says "no check failed, but not fully verified" and counts them, and the exit code is 1: an `unbound` line is not proven. `--allow-unbound` gives exit 0 for a ledger known to come from 0.7.0 or 0.7.1. Entries from before 0.7.2 cannot be checked in full, and a consent made before 0.7.2 is refused by a new run.
128
+ - The comparison of the two numbers is re-run only by someone who has the sealed files, so the holder or a party who is shown them.
129
+ - A consistent forgery from the first entry is caught only by a party who kept an earlier diff or the ledger head. An operator who forks the pack with keys of his own gets a ledger whose consents the fork's parties would have to sign; a party compares the core sha256 of the pack he was sent with the one the holder used.
130
+ - A signature proves who wrote a file, not that it is the current one; it is the signed commitments in the consents that catch a replaced answers file, and only for runs that have a consent.
131
+
132
+ ## Verifying the ledger
133
+
134
+ `smd deal verify pack.yaml --ledger verdicts.yaml [--answers answers_*.yaml] [--sealed <folder>] [--diff diff.yaml] [--json] [--allow-unbound]` is an audit any party or a third party can run. It reads only what it is given, changes nothing, and prints one line per check: `ok`, `FAIL`, `unbound (old entry)` or `skipped` (Russian packs: `ок`, `СБОЙ`, `не привязано (старая запись)`, `пропущено`). The exit code is 1 if any line is `FAIL` or `unbound`, else 0; with `--allow-unbound` an `unbound` line does not make it 1. The last line says `all checks passed` only when nothing failed and nothing is `unbound`; with `unbound` lines and no `FAIL` it says `no check failed, but not fully verified (old entries)`. `--json` prints the same as a machine-readable report: `ok`, `complete` (`ok` and no `unbound`), `counts`, `ledger_head` and the checks, each with `check` (code), `status`, `entry`, `detail` and `text`. A sealed-floor pack needs `ssh-keygen`.
135
+
136
+ - **Chain.** The entries are numbered in order, each follows the one before it and has the sha256 of its text; the head is printed.
137
+ - **Each consent entry.** The signed text hashes to `evidence`; its signature is the member's, made with the key the pack lists, namespace `smd-deal`; the text names this deal, pack id, topic, run, member and buyer, and the commitments of the entry; its `pack.sha256` and `keys` are the pack's. The member is a party to the topic, the buyer is the one who commits the ceiling, and the seller alone consents to the first run.
138
+ - **Each counted verdict entry.** The run is the next counted run of the topic and at most two (a `not_tested` entry is not counted). The consents it names (`consents`) are consent entries earlier in the chain, valid by the rule above, for the same topic, run and buyer, with the commitments the verdict recorded, each the latest of its member before the verdict; the seller consented, and for a second run the buyer too (a verdict that names no consents, `consents: []`, is `FAIL` for the same reason: the consents it needs are not among them). The answers sha256 it recorded (`answers`) is matched to the files given with `--answers`: each file is for this text of the pack and signed by its member, and the commitment in it is the one the run used. A recorded file that is not among those given is `FAIL` only for the latest run that read that member's answers, since an earlier run may have read a version nobody passed; for the rest it is `skipped`.
139
+ - **`--sealed`, the holder's check.** The folder holds the sealed files and their `.sig`. Each is found by its commitment, checked against the pack (deal, pack core sha256, member, item, side, unit) and its signature, and the comparison of the method the entry names is run again in memory; a result other than the logged one is `FAIL`. A run whose sealed file is not in the folder is `skipped`. No number, salt or gap is ever printed; the report says only `met` or `not_met`. Without `--sealed` the step is skipped and the report says so.
140
+ - **`--diff`.** The diff is for this text of the pack; its `ledger_head` is an entry of the ledger, and each sealed point's `verdict` is the one the ledger had at that entry (`not_tested` is also right when the point carries `changed_since_run`). A diff made earlier, before more entries were added, still passes.
141
+ - **Entries from before 0.7.2** (an unsigned or unbound consent, a verdict that names no consents or answers) cannot be checked in full and are `unbound`; for a verdict the engine still looks for the earlier consent entries it needed. Once any entry has the 0.7.2 fields, a later entry without them is `FAIL`: the engine always writes them, so such an entry was written by hand. (A 0.7.1 holder program that keeps adding to a ledger a 0.7.2 program has begun is therefore also `FAIL`.)
142
+
143
+ What it cannot show: an operator who writes a whole ledger of the old kind, with no signed bound consent in it, or who rewrites the entries before the first 0.7.2 entry into the old kind, gets those lines `unbound`, the summary "not fully verified" and exit 1; only `--allow-unbound`, which a party gives for a ledger he knows to be old, turns that into exit 0. The comparison of two numbers is verified only by someone with the sealed files. A ledger that is a consistent forgery from its first entry is caught only by a party who kept a diff or the head. Code: `src/smd_engine/deal/verify.py`, `verify_extra.py`, `verify_report.py`, `verify_cmd.py`; tests: `tests/test_deal_verify.py`.
121
144
 
122
145
  ## Holder and model consent
123
146
 
@@ -156,13 +179,13 @@ On Linux use a tmpfs such as `/dev/shm`. The hdiutil sector count is in 512-byte
156
179
 
157
180
  | Who | What they are trusted with | What goes wrong if they fail |
158
181
  |---|---|---|
159
- | the holder's operator | to read both numbers once, in memory, and to log the verdict honestly | it learns both numbers; a dishonest ledger is caught only by a party that kept a diff. With `sealed_floor` it cannot consent or commit for a party in the pack he holds: that needs the party's signature (limits: "Signatures") |
182
+ | the holder's operator | to read both numbers once, in memory, and to log the verdict honestly | it learns both numbers; a dishonest ledger is caught by `smd deal verify` (hand-written or replayed entries, not the numbers) or by a party that kept a diff. With `sealed_floor` it cannot consent or commit for a party in the pack he holds: that needs the party's signature (limits: "Signatures") |
160
183
  | the party's SSH key | to be kept by the party | whoever holds it can consent and seal in his name; the pack lists the public key, so a changed key voids the answers |
161
184
  | the party's own machine | to keep his sealed file private | a copy of the file is the number |
162
185
  | the other party | nothing | learns only what the flag and the shared files show |
163
186
  | a broker | the shared core and his principal's view | no sealed file, no consent right, never the operator |
164
187
 
165
- What the design guarantees: a party cannot change his number after he commits it without the change showing (the commitment is in the answers and the verdict recomputes it; each counted run records the commitments it used, the diff flags a later change, and a further run needs both parties to consent to the new commitments); the commitment does not reveal a round price (salt); the other party never receives the number or the gap; a cut or edited ledger is detectable against any earlier diff; with `sealed_floor` every counted consent and sealed file carries the party's signature, which the verdict checks before it opens anything.
188
+ What the design guarantees: a party cannot change his number after he commits it without the change showing (the commitment is in the answers and the verdict recomputes it; each counted run records the commitments it used, the diff flags a later change, and a further run needs both parties to consent to the new commitments); the commitment does not reveal a round price (salt); the other party never receives the number or the gap; a cut or edited ledger is detectable against any earlier diff; with `sealed_floor` every counted consent, answers file of a key holder and sealed file carries the party's signature, which the verdict checks before it opens anything, and the consent is tied to the pack text and keys it was written for.
166
189
 
167
190
  What it does not guarantee. Misstatement before the commitment is unavoidable, since no mechanism makes a party name his true limit (the Myerson-Satterthwaite result); the commitment only fixes it afterwards.
168
191
 
@@ -175,13 +198,13 @@ What it does not guarantee. Misstatement before the commitment is unavoidable, s
175
198
  - **The signature files and the ledger.** A signed consent entry stores its exact text and signature, so anyone with the ledger can read the buyer named, the commitments and the date. The signatures carry the member id as signer and nothing about a number.
176
199
  - **The ledger** shows the dates of runs and consents and the commitments, which are in the answers anyway.
177
200
  - **The cap-reached and consent-missing reasons** show that a further run was asked for.
178
- - **Views** keep the other side's value answers out, but a viewer still sees every shared-core point. The common agenda shows a value point as `open` or `settled` only, and who discussed or did not reply, but not their answers, and nothing of an annex point but a neutral title (see "Agendas"). The id of a shared added point is `add-<member>-<n>`, where `n` counts all that member's added points, so a gap in the numbers shows that he has an unshared one (a count, never its text).
201
+ - **Views** keep the other side's value answers out, but a viewer still sees every shared-core point. The common agenda shows a value point as `open` or `settled` only, and who discussed or did not reply, but not their answers, and nothing of an annex point but a neutral title (see "Agendas"). The id of an added point in a deal pack is `add-<member>-<8 hex of the sha256 of its text>` (with `-2`, `-3` on a repeated shared text; a point the author kept to his position hashes its text with a prefix, so its id differs and no private copy is counted in the suffix of a shared one), so the id of a shared point does not tell how many unshared points its author has; it is the same for the same answers file. A group pack keeps `add-<member>-<n>`. A 0.7.1 diff has the old ids; make the diff again, and the replies that name them with it.
179
202
 
180
203
  Sealed values and salts do not appear in `diff.yaml`, `diff.md`, `diff.html`, an agenda, a view, the ledger or an error message; tests grep those outputs for the test numbers and salts (`tests/test_deal_sealed.py`, `tests/test_deal_verdict.py`).
181
204
 
182
205
  ## Commands
183
206
 
184
- `smd task check | render | diff | agenda` take the new fields (`render --stage`); the deal commands are `smd deal views | seal | verdict | consent`. Examples: `commands.md`.
207
+ `smd task check | render | diff | agenda` take the new fields (`render --stage`); the deal commands are `smd deal views | seal | verdict | consent | verify`. Examples: `commands.md`.
185
208
 
186
209
  ## Not yet built
187
210
 
@@ -54,7 +54,7 @@ Plan approved 2026-10-25 (`docs/plan.md`). Each step is a branch and a PR. The s
54
54
  | Патчи | `set` on a relation by `from`, `to`, `kind`; `carries` shown in the renders | done in v0.6.3 |
55
55
  | Путь назад | Way back on adjoin moves: `move.return`, hint `move-return`; computability check in the qualification pass (dz02#l=11) | done in v0.6.4 |
56
56
  | АС2 | Task packs for async group work: `smd task check`, `render`, `diff`, `agenda`; schemas task_pack, task_answers, task_replies 0.1; procedures task-pack, task-diff (dz02#l=11, #l=15, #l=31) | done in v0.6.5 |
57
- | ДМ | Deal mode for a sale or transfer: positions and views, fact, line, range and bound items, map acceptance, the sealed price flag with a holder, ledger and run cap; `docs/deal-mode.md` (dz02#l=43, #l=47) | done in 0.7.0; signatures, per-position agendas and call titles in 0.7.1 |
57
+ | ДМ | Deal mode for a sale or transfer: positions and views, fact, line, range and bound items, map acceptance, the sealed price flag with a holder, ledger and run cap; `docs/deal-mode.md` (dz02#l=43, #l=47) | done in 0.7.0; signatures, per-position agendas and call titles in 0.7.1; consent and answers bindings and `smd deal verify` in 0.7.2 |
58
58
 
59
59
  ## Structural moves (Invention as a Structural Operation)
60
60
 
@@ -129,10 +129,10 @@ For a sale or transfer, whose members are counterparties, a pack adds optional f
129
129
  - **Model consent.** `deal.model_consent` (default false). A pack with a `deal` block gives its diff `model_pass_allowed`, and the pages say so; when it is false the model pass of `procedures/task-diff.md` stops there and no transcript is read. A diff never takes a `task_sealed` file as input.
130
130
 
131
131
  - **Verdict and ledger.** `smd deal verdict pack.yaml <topic> --answers a.yaml b.yaml --floor sealed_<seller>_<item>.yaml [--ceiling sealed_<buyer>_<item>.yaml] --ledger verdicts.yaml` is the holder's command. It checks the cap first, then opens each sealed file, accepts it only when its deal, pack core sha, member, item, side and unit are the pack's and its recomputed commitment equals the one in the member's answers, and compares the two numbers with the comparator named by `holder.method` (`local-v1`: floor at most ceiling; `src/smd_engine/deal/overlap.py` defines the `Comparator` protocol, so a two-party protocol can replace it without changing the files, the commitments, the ledger or the verdict). The result is one entry in the ledger (`task_verdicts`; entries are hash-chained by `prev_sha256` and each has its own `sha256`): `met`, `not_met`, or `not_tested` with a `reason` (`no_floor`, `no_ceiling`, `bad_commitment`, `unit_mismatch`, `consent_missing`, `commitment_changed`, `cap_reached`). The ledger and everything printed hold no number, no salt and no gap. A buyer who gives no ceiling gets `not_tested` (`no_ceiling`) and the price goes to the meeting. `smd task diff ... --ledger verdicts.yaml` verifies the chain and writes each bound point's `verdict` (the latest run made, else `not_tested`) and `ledger_head`; a ledger cut short later no longer matches the head of an earlier diff, and `task diff` refuses to overwrite that diff.yaml. A commitment in the answers that differs from the one the latest counted run used makes the points `not_tested` with `changed_since_run`. The first run of a ledger takes `--new`; without it the file must exist. A diff made before the verdict is replaced by the one with `--ledger` (they differ in the sealed points' verdict fields only); other differences still need `--force`.
132
- - **Run cap.** One run per seller-buyer pair, topic and deal. Every run needs a `consent` entry by the seller naming the buyer (the consent file has `buyer`; the first consent of a deal takes `--new`); a second run needs one from each of the two parties too (`smd deal consent pack.yaml <topic> --member <id> --evidence <file> --ledger verdicts.yaml`; the file is the party's `task_consent` record for this deal, topic, run and member naming the floor and ceiling commitments now in the answers; the entry keeps its sha256 and the commitments, and a run with other commitments is `commitment_changed`; the holder's own word is not enough, the engine checks the file but has no signature, and a broker cannot consent); two runs at most, and a third is `cap_reached`. A run that returns `not_tested` gives nothing away and does not use a run. Pilots: the parties send their sealed files to the organisation age-encrypted, outside the engine; it decrypts them only for the run, on a RAM disk. This is a trust step in the holder and its machine, which `local-v1` does not remove.
132
+ - **Run cap.** One run per seller-buyer pair, topic and deal. Every run needs a `consent` entry by the seller naming the buyer (the consent file has `buyer`; the first consent of a deal takes `--new`); a second run needs one from each of the two parties too (`smd deal consent pack.yaml <topic> --member <id> --evidence <file> --ledger verdicts.yaml`; the file is the party's `task_consent` record for this deal, topic, run and member naming the floor and ceiling commitments now in the answers; the entry keeps its sha256 and the commitments, and a run with other commitments is `commitment_changed`; the holder's own word is not enough, in a sealed-floor pack the file also names the pack's core sha256 and key list, is signed, and a verdict entry records the answers files it read and the consents it counted: docs/deal-mode.md; a broker cannot consent); two runs at most, and a third is `cap_reached`. A run that returns `not_tested` gives nothing away and does not use a run. Pilots: the parties send their sealed files to the organisation age-encrypted, outside the engine; it decrypts them only for the run, on a RAM disk. This is a trust step in the holder and its machine, which `local-v1` does not remove.
133
133
 
134
134
  - **Pairs.** `pairs: [{id, members: [a, b], label?}]` names the member pairs compared on their own (a seller and a buyer, a broker and a buyer); each member is one of the pack's, the two differ, and a pair appears once. The diff then has `by_pair`: for each pair, the class and route of each point both members were asked (an item with an `audience` only if both are in it; added points are left out), worked out from their two answers only, with a summary. The classes of the whole diff are unchanged. The agenda has `call_by_pair`: for each pair, the ids of the points on the call that a pair member put there (discuss, no reply, or a rejected red line). A point on the call that no pair put there stays in `call` only. `agenda.md` lists them in the section "Call points by pair" ("Точки для созвона по парам"): per pair its two members and the call points by number and question.
135
- - **Added points.** In a deal pack a point a member adds gets `audience` = the member's position, so only that position and the holder (who has the whole diff) see it, and only that position owes a reply. `share: true` on the added entry lifts the restriction. In a group pack `share` is ignored and `smd task check` warns.
135
+ - **Added points.** In a deal pack a point a member adds gets `audience` = the member's position, so only that position and the holder (who has the whole diff) see it, and only that position owes a reply. `share: true` on the added entry lifts the restriction; the form of a deal pack (`pack.html`, `pack.<position>.html`) has an unchecked box «показать всем позициям» / "share with all positions" on each added row and writes `share: true` when it is ticked. The diff id of an added point in a deal pack is `add-<member>-<8 hex of the sha256 of its text>` (`-2`, `-3` count only repeats of a shared point; an unshared point hashes its text with a prefix; a group pack keeps `add-<member>-<n>`), so it does not show how many unshared points the author has. In a group pack `share` is ignored and `smd task check` warns.
136
136
  - **Views.** `smd deal views pack.yaml diff.yaml -o out/views [--position id]` writes `diff.<position>.yaml`, `.md` and `.html` for each position: a `task_diff` with a `view` block (`position`, `diff`: the sha256 of the whole diff.yaml). The whole diff is for whoever runs it; a view is what a position is sent. It leaves out the points not for the position (`audience`); a fact dispute (class `conflict`) over a claim of the buyer's side, unless the viewer is on that side; and, on a value point (`nature: value`, a `value` conflict, or a range with no nature), the class, route, `sets`, `silent` and the answers of the other side, which shows only the class `open` or `settled`. A side is "sell" (seller, sell-side broker), "buy" (buyer, buy-side broker) or the position alone; a broker is on the side of the position his principal holds, so he gets his principal's view of the other side's answers, within his own audience. The summary, `by_pair`, labels and transcripts are cut the same way. A view is rendered and replied to like a diff (`smd task render`); an agenda is built from the whole diff only; `smd deal views` takes `--replies` and `--members` and then also writes `agenda.<position>.yaml` and `.md`, cut like the view; the common agenda (`smd task agenda`) shows an annex point only under its `call_title` and leaves a settled one out (`deal-mode.md`, "Agendas"). Item field `call_title` (optional string): the neutral title of an item with an `audience` on the common agenda. `smd task check --replies r.yaml --diff diff.<position>.yaml` checks `diff` in the reply against the view's `view.diff`; a reply may carry `view`, the sha256 of the view file, which the view's page writes into the reply it exports, and the check refuses another view's sha256.
137
137
 
138
138
  Procedures `task-pack` and `task-diff` are at 0.2.0 for these fields.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "smd-engine"
3
- version = "0.7.1"
3
+ version = "0.7.2"
4
4
  description = "Records, checks and renderings for SMD-style thinking sessions (three boards, cycles, qualifications)"
5
5
  readme = "README.md"
6
6
  license = "MIT AND CC-BY-4.0"
@@ -10,6 +10,7 @@ from typing import Any
10
10
  from smd_engine.deal.agenda_views import position_agenda
11
11
  from smd_engine.deal.seal_cmd import cmd_seal
12
12
  from smd_engine.deal.verdict_cmd import cmd_consent, cmd_verdict
13
+ from smd_engine.deal.verify_cmd import cmd_verify
13
14
  from smd_engine.deal.views import view_of
14
15
  from smd_engine.records import RecordError, dump_record
15
16
  from smd_engine.task.agenda import build_agenda
@@ -161,3 +162,33 @@ def add_deal_parser(sub: Any) -> None:
161
162
  )
162
163
  co.add_argument("--date", help="date of the entry (today by default)")
163
164
  co.set_defaults(func=cmd_consent)
165
+ vf = dsub.add_parser(
166
+ "verify",
167
+ help="audit a verdict ledger: chain, signed consents, run cap, answers, "
168
+ "and with the sealed files the outcomes",
169
+ )
170
+ vf.add_argument("pack", help="the deal pack")
171
+ vf.add_argument("--ledger", required=True, help="verdicts.yaml")
172
+ vf.add_argument(
173
+ "--answers",
174
+ nargs="+",
175
+ default=[],
176
+ help="answers files (with <file>.sig): the shas the verdicts recorded are "
177
+ "matched to them",
178
+ )
179
+ vf.add_argument(
180
+ "--sealed",
181
+ help="folder with the holder's sealed files and their .sig: the outcome of "
182
+ "each verdict is recomputed (the holder's check; no number is printed)",
183
+ )
184
+ vf.add_argument(
185
+ "--diff", help="diff.yaml: its ledger head and verdicts are checked"
186
+ )
187
+ vf.add_argument("--json", action="store_true", help="a machine-readable report")
188
+ vf.add_argument(
189
+ "--allow-unbound",
190
+ action="store_true",
191
+ help="exit 0 although entries are `unbound` (from before 0.7.2: not "
192
+ "checked in full); by default they make the exit 1",
193
+ )
194
+ vf.set_defaults(func=cmd_verify)
@@ -5,7 +5,8 @@ run the buyer consents too.
5
5
 
6
6
  record: task_consent
7
7
  deal: <deal id>
8
- pack: {id: <pack id>}
8
+ pack: {id: <pack id>, sha256: <core sha256 of the pack>} # sha256: sealed floor
9
+ keys: <sha256 of the pack's key list> # sealed floor
9
10
  topic: <topic>
10
11
  run: 1
11
12
  member: <the party>
@@ -26,7 +27,15 @@ the file (`signed`, whose sha256 is `evidence`) and the armored signature
26
27
  party's file, and `smd deal verdict` does so before it counts one. The holder's
27
28
  operator cannot write a consent for a party: he has no key. In a pack without a
28
29
  sealed floor nothing is signed; the entry keeps only the sha256, which the party
29
- checks against his own copy."""
30
+ checks against his own copy.
31
+
32
+ Binding (0.7.2, sealed floor only): the signed file also names `pack.sha256`, the
33
+ core sha256 of the pack the party was sent, and `keys`, the sha256 of that pack's
34
+ key list (`signing.key_list_sha`). `smd deal consent` and `smd deal verdict` refuse a
35
+ consent whose two values differ from the pack they hold, so a consent cannot be
36
+ carried over to a fork of the pack with other text or other keys. A 0.7.1 consent,
37
+ which names neither, is refused as a new consent and by a verdict; it stays in an
38
+ old ledger, readable, and the party writes it again with both values."""
30
39
 
31
40
  from __future__ import annotations
32
41
 
@@ -35,10 +44,11 @@ from typing import Any
35
44
 
36
45
  import yaml
37
46
 
38
- from smd_engine.deal.signing import verify_signature
47
+ from smd_engine.deal.signing import key_list_sha, signatures_on, verify_signature
39
48
  from smd_engine.records import RecordError, parse_text
40
49
  from smd_engine.task.bounds import SHA
41
50
  from smd_engine.task.model import load_task, sha256_bytes
51
+ from smd_engine.task.positions import core_sha
42
52
 
43
53
 
44
54
  def parse_consent(text: str, where: str) -> dict[str, Any]:
@@ -61,6 +71,51 @@ def read_consent(
61
71
  return consent_commitments(data, str(path), pack, topic, run, member, buyer)
62
72
 
63
73
 
74
+ def binding_code(data: dict[str, Any], pack: dict[str, Any]) -> str:
75
+ """How a consent file is bound to this pack text and key list: `""` when it is,
76
+ `missing` when it names `pack.sha256` or `keys` no (a 0.7.1 consent), `pack` or
77
+ `keys` when that value differs from the pack's. Only a pack with a sealed floor
78
+ binds; others are not asked."""
79
+ if not signatures_on(pack):
80
+ return ""
81
+ ref = data.get("pack")
82
+ sha = ref.get("sha256") if isinstance(ref, dict) else None
83
+ keys = data.get("keys")
84
+ if sha is None or keys is None:
85
+ return "missing"
86
+ if sha != core_sha(pack):
87
+ return "pack"
88
+ return "keys" if keys != key_list_sha(pack) else ""
89
+
90
+
91
+ BINDING_MESSAGES = {
92
+ "missing": (
93
+ "does not name pack.sha256 and keys (a consent from before 0.7.2); "
94
+ "the party writes it again with both and signs it again"
95
+ ),
96
+ "pack": (
97
+ "pack.sha256 is not the core sha256 of this pack (a consent for "
98
+ "another text of the pack)"
99
+ ),
100
+ "keys": "keys is not the sha256 of this pack's key list (another set of keys)",
101
+ }
102
+
103
+
104
+ def binding_problem(data: dict[str, Any], pack: dict[str, Any]) -> str:
105
+ """Why a consent file is not bound to this pack text and key list, or an empty
106
+ string."""
107
+ return BINDING_MESSAGES.get(binding_code(data, pack), "")
108
+
109
+
110
+ def is_bound(pack: dict[str, Any], entry: dict[str, Any]) -> bool:
111
+ """Whether a consent entry keeps a signed text bound to this pack."""
112
+ try:
113
+ data = parse_consent(str(entry.get("signed", "")), "entry")
114
+ except RecordError:
115
+ return False
116
+ return not binding_problem(data, pack)
117
+
118
+
64
119
  def consent_commitments(
65
120
  data: dict[str, Any],
66
121
  path: str,
@@ -94,6 +149,8 @@ def consent_commitments(
94
149
  f"{path}: not a consent of {member} to run {run} of topic {topic} "
95
150
  f"against buyer {buyer} in this deal ({', '.join(wrong)})"
96
151
  )
152
+ if problem := binding_problem(data, pack):
153
+ raise RecordError(f"{path}: {problem}")
97
154
  return {side: str(commits[side]) for side in ("floor", "ceiling")}
98
155
 
99
156
 
@@ -1,17 +1,18 @@
1
1
  """OpenSSH signatures for the sealed floor of a deal pack. A party signs his consent
2
- files and his sealed file with his own SSH key; the pack lists the public key of
3
- each party (`members[].ssh_key`). The engine calls `ssh-keygen -Y` and adds no
4
- Python dependency; the private key is never read here.
2
+ files, his sealed file and his answers file with his own SSH key; the pack lists
3
+ the public key of each party (`members[].ssh_key`). The engine calls
4
+ `ssh-keygen -Y` and adds no Python dependency; the private key is never read here.
5
5
 
6
6
  Namespace `smd-deal`; the signer principal is the member id. A signature proves
7
7
  that the holder of the key wrote the file, so the holder's operator cannot forge a
8
- party's consent or sealed file. Everything below applies only when the pack has
9
- `deal.sealed_floor: true`; without it nothing changes."""
8
+ party's consent, sealed file or answers file. Everything below applies only when
9
+ the pack has `deal.sealed_floor: true`; without it nothing changes."""
10
10
 
11
11
  from __future__ import annotations
12
12
 
13
13
  import base64
14
14
  import binascii
15
+ import hashlib
15
16
  import shlex
16
17
  import shutil
17
18
  import struct
@@ -69,6 +70,19 @@ def public_key(line: str) -> str:
69
70
  return " ".join(line.split()[:2])
70
71
 
71
72
 
73
+ def key_list_sha(pack: dict[str, Any]) -> str:
74
+ """The sha256 of the pack's list of signing keys: the lines `<member> <type>
75
+ <base64>` of every member with a usable `ssh_key` (comment dropped), sorted and
76
+ joined by newlines. A consent names it, so it is tied to the keys of the pack
77
+ it was written for."""
78
+ lines = sorted(
79
+ f"{m['id']} {public_key(m['ssh_key'])}"
80
+ for m in pack["members"]
81
+ if m.get("ssh_key") is not None and not key_problem(m["ssh_key"])
82
+ )
83
+ return hashlib.sha256("\n".join(lines).encode("utf-8")).hexdigest()
84
+
85
+
72
86
  def key_findings(pack: dict[str, Any]) -> Found:
73
87
  """Errors of the keys of a pack with a sealed floor: every seller and buyer
74
88
  needs one, each must be well formed, and no two members share one."""
@@ -172,9 +186,9 @@ def verify_signature(
172
186
 
173
187
  def verify_file(
174
188
  pack: dict[str, Any], member: str, path: Path, signature: Path | None
175
- ) -> None:
189
+ ) -> str:
176
190
  """Refuse a file that has no valid signature of `member` at `signature`
177
- (`<path>.sig` by default)."""
191
+ (`<path>.sig` by default). Returns the sha256 of the bytes verified."""
178
192
  sig = signature or path.with_name(path.name + ".sig")
179
193
  try:
180
194
  data, text = path.read_bytes(), sig.read_text(encoding="utf-8")
@@ -184,3 +198,41 @@ def verify_file(
184
198
  f"the party signs it with: {sign_command('<private key>', path)}"
185
199
  ) from exc
186
200
  verify_signature(pack, member, data, text, str(path))
201
+ return hashlib.sha256(data).hexdigest()
202
+
203
+
204
+ def key_holders(pack: dict[str, Any]) -> set[str]:
205
+ """The members whose answers files are signed: those with a usable ssh_key."""
206
+ return {
207
+ m["id"]
208
+ for m in pack["members"]
209
+ if m.get("ssh_key") is not None and not key_problem(m["ssh_key"])
210
+ }
211
+
212
+
213
+ def verify_answers(
214
+ pack: dict[str, Any], loaded: list[tuple[Path, str, dict[str, Any]]]
215
+ ) -> None:
216
+ """Refuse (RecordError) unless the answers file of every member with a key is
217
+ signed by him (`<file>.sig`) and is the file `loaded` read (its sha256)."""
218
+ holders = key_holders(pack)
219
+ for path, sha, ans in loaded:
220
+ member = str(ans["member"])
221
+ if member in holders and verify_file(pack, member, path, None) != sha:
222
+ raise RecordError(f"{path}: the file changed while it was read")
223
+
224
+
225
+ def unsigned_answers(
226
+ pack: dict[str, Any], loaded: list[tuple[Path, str, dict[str, Any]]]
227
+ ) -> list[str]:
228
+ """One message per answers file of a member with a key that has no valid
229
+ signature of his; for the warnings of `smd task diff`, which does not refuse."""
230
+ holders = key_holders(pack)
231
+ out: list[str] = []
232
+ for path, _, ans in loaded:
233
+ if ans["member"] in holders:
234
+ try:
235
+ verify_file(pack, str(ans["member"]), path, None)
236
+ except RecordError as exc:
237
+ out.append(str(exc))
238
+ return out
@@ -16,6 +16,7 @@ from typing import Any, Callable, Mapping
16
16
 
17
17
  from smd_engine.deal.consent import (
18
18
  consent_commitments,
19
+ is_bound,
19
20
  consented_commitments,
20
21
  latest_consents,
21
22
  parse_consent,
@@ -139,12 +140,16 @@ def run_verdict(
139
140
  ledger: dict[str, Any],
140
141
  date: str,
141
142
  comparator: Comparator | None = None,
143
+ answers_sha: dict[str, str] | None = None,
142
144
  ) -> dict[str, Any]:
143
145
  """Run the comparison of a topic and append its entry to the ledger.
144
146
  `answers` are the answers records by member; `openers` read the sealed file
145
147
  of a side ("floor", "ceiling") when called, and only after the cap and the
146
148
  consents are checked. A side with no opener was not given; one whose opener
147
- returns None is not a valid sealed file."""
149
+ returns None is not a valid sealed file. In a pack with a sealed floor
150
+ `answers_sha` (member -> sha256 of the answers file read, already verified)
151
+ is kept in the entry, and so are the hashes of the consent entries a counted
152
+ run used, so a later audit can tie the verdict to its signed inputs."""
148
153
  items = topic_items(pack, topic)
149
154
  members = {s: committer(pack, items[s]) for s in SIDES}
150
155
  comparator = comparator or comparator_for(pack["holder"]["method"])
@@ -169,6 +174,8 @@ def run_verdict(
169
174
  ): # a missing number is `no_floor` or `no_ceiling`
170
175
  reason = _consent_problem(ledger, topic, run, members, commits)
171
176
  reason = reason or _first_problem(pack, pack_sha, items, members, commits, read)
177
+ if answers_sha is not None and signatures_on(pack) and reason != "cap_reached":
178
+ entry["answers"] = dict(answers_sha)
172
179
  if reason is not None:
173
180
  entry.update({"verdict": "not_tested", "reason": reason})
174
181
  else:
@@ -182,6 +189,11 @@ def run_verdict(
182
189
  "commitments": {s: commits[s] for s in SIDES},
183
190
  }
184
191
  )
192
+ if signatures_on(pack):
193
+ counted = latest_consents(ledger, topic, run).values()
194
+ entry["consents"] = [
195
+ e["sha256"] for e in sorted(counted, key=lambda e: e["seq"])
196
+ ]
185
197
  return append_entry(ledger, entry)
186
198
 
187
199
 
@@ -232,10 +244,14 @@ def add_consent(
232
244
  raw = read_bytes(evidence)
233
245
  commitments = read_consent(evidence, pack, topic, run, member, str(buyer))
234
246
  # a new consent, naming other commitments, replaces the earlier one; so does a
235
- # signed one that names the same, when the earlier is a consent of a ledger
236
- # from before signatures (0.7.0), which a sealed-floor verdict refuses
247
+ # signed, bound one that names the same, when the earlier is unsigned (0.7.0) or
248
+ # not bound to the pack text and keys (0.7.1), which a sealed-floor verdict refuses
237
249
  last = latest_consents(ledger, topic, run).get(member)
238
- if last and last["commitments"] == commitments and (not signed or "signed" in last):
250
+ if (
251
+ last
252
+ and last["commitments"] == commitments
253
+ and (not signed or is_bound(pack, last))
254
+ ):
239
255
  raise RecordError(f"{member} has consented to run {run} already")
240
256
  entry = {
241
257
  "type": "consent",