stepfork 0.2.1__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. {stepfork-0.2.1 → stepfork-0.3.0}/CHANGELOG.md +56 -0
  2. stepfork-0.3.0/PKG-INFO +195 -0
  3. stepfork-0.3.0/README.md +164 -0
  4. {stepfork-0.2.1 → stepfork-0.3.0}/docs/architecture.md +21 -5
  5. stepfork-0.3.0/docs/assets/stepfork-workflow.png +0 -0
  6. stepfork-0.3.0/docs/baseline-example.md +101 -0
  7. stepfork-0.3.0/docs/baselines.md +105 -0
  8. {stepfork-0.2.1 → stepfork-0.3.0}/docs/cli.md +184 -1
  9. {stepfork-0.2.1 → stepfork-0.3.0}/docs/community/early-adopter-guide.md +29 -14
  10. {stepfork-0.2.1 → stepfork-0.3.0}/docs/concepts.md +13 -6
  11. {stepfork-0.2.1 → stepfork-0.3.0}/docs/development.md +3 -2
  12. stepfork-0.3.0/docs/diff.md +63 -0
  13. {stepfork-0.2.1 → stepfork-0.3.0}/docs/examples.md +16 -1
  14. {stepfork-0.2.1 → stepfork-0.3.0}/docs/fork.md +93 -23
  15. stepfork-0.3.0/docs/getting-started.md +135 -0
  16. stepfork-0.3.0/docs/index.md +94 -0
  17. {stepfork-0.2.1 → stepfork-0.3.0}/docs/integrations.md +20 -13
  18. {stepfork-0.2.1 → stepfork-0.3.0}/docs/langgraph.md +62 -3
  19. {stepfork-0.2.1 → stepfork-0.3.0}/docs/minimize.md +1 -1
  20. stepfork-0.3.0/docs/rag.md +147 -0
  21. {stepfork-0.2.1 → stepfork-0.3.0}/docs/real-llm-case-study.md +5 -0
  22. {stepfork-0.2.1 → stepfork-0.3.0}/docs/release-checklist.md +24 -16
  23. stepfork-0.3.0/docs/releases/v0.2.1.md +45 -0
  24. stepfork-0.3.0/docs/releases/v0.3.0.md +48 -0
  25. {stepfork-0.2.1 → stepfork-0.3.0}/docs/replay.md +49 -0
  26. stepfork-0.3.0/docs/trace-format.md +243 -0
  27. {stepfork-0.2.1 → stepfork-0.3.0}/docs/troubleshooting.md +5 -3
  28. stepfork-0.3.0/docs/tutorials/langgraph-triage.md +405 -0
  29. stepfork-0.3.0/examples/coverage/demo.py +84 -0
  30. stepfork-0.3.0/examples/quickstart/README.md +72 -0
  31. stepfork-0.3.0/examples/quickstart/baseline.sftrace/events.jsonl +4 -0
  32. stepfork-0.3.0/examples/quickstart/baseline.sftrace/integrity.json +9 -0
  33. stepfork-0.3.0/examples/quickstart/baseline.sftrace/manifest.json +21 -0
  34. stepfork-0.3.0/examples/quickstart/record_candidate.py +25 -0
  35. stepfork-0.3.0/mkdocs.yml +71 -0
  36. {stepfork-0.2.1 → stepfork-0.3.0}/pyproject.toml +2 -2
  37. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/__init__.py +20 -0
  38. stepfork-0.3.0/src/stepfork/baseline/__init__.py +27 -0
  39. stepfork-0.3.0/src/stepfork/baseline/manager.py +223 -0
  40. stepfork-0.3.0/src/stepfork/cli/baseline.py +206 -0
  41. stepfork-0.3.0/src/stepfork/cli/coverage.py +128 -0
  42. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/diff.py +20 -4
  43. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/fork.py +17 -0
  44. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/inspect.py +33 -0
  45. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/main.py +4 -0
  46. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/replay.py +238 -20
  47. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/validate.py +64 -1
  48. stepfork-0.3.0/src/stepfork/diff/engine.py +548 -0
  49. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/diff/models.py +6 -1
  50. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/fork/__init__.py +16 -0
  51. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/fork/engine.py +151 -2
  52. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/fork/models.py +18 -0
  53. stepfork-0.3.0/src/stepfork/fork/provenance.py +250 -0
  54. stepfork-0.3.0/src/stepfork/fork/staleness.py +75 -0
  55. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/inspect/__init__.py +2 -1
  56. stepfork-0.3.0/src/stepfork/inspect/coverage.py +132 -0
  57. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/inspect/inspector.py +88 -4
  58. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/inspect/models.py +21 -0
  59. stepfork-0.3.0/src/stepfork/integrations/langgraph.py +984 -0
  60. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/recorder/session.py +81 -2
  61. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/replay/__init__.py +2 -0
  62. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/replay/exceptions.py +4 -0
  63. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/replay/session.py +362 -13
  64. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/__init__.py +62 -0
  65. stepfork-0.3.0/src/stepfork/trace/evidence.py +887 -0
  66. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/integrity.py +73 -4
  67. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/models.py +4 -0
  68. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/storage.py +33 -1
  69. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/validation.py +25 -4
  70. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/version.py +1 -1
  71. stepfork-0.3.0/tests/golden/successful_run.sftrace/redactions.json +4 -0
  72. stepfork-0.3.0/tests/integration/test_baseline_workflow.py +61 -0
  73. stepfork-0.3.0/tests/integration/test_docs_langgraph_tutorial.py +176 -0
  74. stepfork-0.3.0/tests/integration/test_evidence_integration.py +77 -0
  75. stepfork-0.3.0/tests/unit/test_baseline.py +211 -0
  76. stepfork-0.3.0/tests/unit/test_cli_baseline.py +244 -0
  77. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_diff.py +3 -0
  78. stepfork-0.3.0/tests/unit/test_cli_error_handling.py +919 -0
  79. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_replay.py +60 -0
  80. stepfork-0.3.0/tests/unit/test_cli_replay_stale.py +90 -0
  81. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_validate.py +112 -0
  82. stepfork-0.3.0/tests/unit/test_coverage.py +153 -0
  83. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_diff.py +146 -1
  84. stepfork-0.3.0/tests/unit/test_evidence.py +278 -0
  85. stepfork-0.3.0/tests/unit/test_evidence_fork.py +119 -0
  86. stepfork-0.3.0/tests/unit/test_evidence_privacy.py +127 -0
  87. stepfork-0.3.0/tests/unit/test_evidence_reporting.py +138 -0
  88. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_export_testfile.py +4 -3
  89. stepfork-0.3.0/tests/unit/test_fork_provenance.py +189 -0
  90. stepfork-0.3.0/tests/unit/test_fork_provenance_adversarial.py +401 -0
  91. stepfork-0.3.0/tests/unit/test_fork_staleness.py +147 -0
  92. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_integrity.py +38 -0
  93. stepfork-0.3.0/tests/unit/test_langgraph_evidence.py +440 -0
  94. stepfork-0.3.0/tests/unit/test_recorder_evidence.py +95 -0
  95. stepfork-0.3.0/tests/unit/test_redaction.py +387 -0
  96. stepfork-0.3.0/tests/unit/test_replay_fork_staleness.py +96 -0
  97. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_storage.py +99 -0
  98. stepfork-0.2.1/PKG-INFO +0 -494
  99. stepfork-0.2.1/README.md +0 -463
  100. stepfork-0.2.1/docs/assets/stepfork-workflow.png +0 -0
  101. stepfork-0.2.1/docs/diff.md +0 -46
  102. stepfork-0.2.1/docs/getting-started.md +0 -142
  103. stepfork-0.2.1/docs/index.md +0 -76
  104. stepfork-0.2.1/docs/trace-format.md +0 -97
  105. stepfork-0.2.1/examples/quickstart/README.md +0 -57
  106. stepfork-0.2.1/mkdocs.yml +0 -60
  107. stepfork-0.2.1/src/stepfork/diff/engine.py +0 -279
  108. stepfork-0.2.1/src/stepfork/integrations/langgraph.py +0 -444
  109. stepfork-0.2.1/tests/unit/test_redaction.py +0 -127
  110. {stepfork-0.2.1 → stepfork-0.3.0}/.gitignore +0 -0
  111. {stepfork-0.2.1 → stepfork-0.3.0}/CODE_OF_CONDUCT.md +0 -0
  112. {stepfork-0.2.1 → stepfork-0.3.0}/CONTRIBUTING.md +0 -0
  113. {stepfork-0.2.1 → stepfork-0.3.0}/LICENSE +0 -0
  114. {stepfork-0.2.1 → stepfork-0.3.0}/SECURITY.md +0 -0
  115. {stepfork-0.2.1 → stepfork-0.3.0}/docs/.gitkeep +0 -0
  116. {stepfork-0.2.1 → stepfork-0.3.0}/docs/assets/stepfork-logo.png +0 -0
  117. {stepfork-0.2.1 → stepfork-0.3.0}/docs/hybrid.md +0 -0
  118. {stepfork-0.2.1 → stepfork-0.3.0}/docs/openai.md +0 -0
  119. {stepfork-0.2.1 → stepfork-0.3.0}/docs/pypi-publishing.md +0 -0
  120. {stepfork-0.2.1 → stepfork-0.3.0}/docs/pytest-export.md +0 -0
  121. {stepfork-0.2.1 → stepfork-0.3.0}/docs/recording.md +0 -0
  122. {stepfork-0.2.1 → stepfork-0.3.0}/docs/releases/v0.1.0a1.md +0 -0
  123. {stepfork-0.2.1 → stepfork-0.3.0}/docs/releases/v0.1.0a2.md +0 -0
  124. {stepfork-0.2.1 → stepfork-0.3.0}/docs/releases/v0.1.0a3.md +0 -0
  125. {stepfork-0.2.1 → stepfork-0.3.0}/docs/releases/v0.1.0a4.md +0 -0
  126. {stepfork-0.2.1 → stepfork-0.3.0}/docs/releases/v0.1.0a5.md +0 -0
  127. {stepfork-0.2.1 → stepfork-0.3.0}/docs/releases/v0.1.0a6.md +0 -0
  128. {stepfork-0.2.1 → stepfork-0.3.0}/docs/releases/v0.2.0.md +0 -0
  129. {stepfork-0.2.1 → stepfork-0.3.0}/docs/security.md +0 -0
  130. {stepfork-0.2.1 → stepfork-0.3.0}/examples/__init__.py +0 -0
  131. {stepfork-0.2.1 → stepfork-0.3.0}/examples/booking_agent/__init__.py +0 -0
  132. {stepfork-0.2.1 → stepfork-0.3.0}/examples/booking_agent/agent.py +0 -0
  133. {stepfork-0.2.1 → stepfork-0.3.0}/examples/booking_agent/demo.py +0 -0
  134. {stepfork-0.2.1 → stepfork-0.3.0}/examples/booking_agent/expected.json +0 -0
  135. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/README.md +0 -0
  136. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/__init__.py +0 -0
  137. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/agent.py +0 -0
  138. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/demo.py +0 -0
  139. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/expected.json +0 -0
  140. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/regression/langgraph_failure.sftrace/events.jsonl +0 -0
  141. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/regression/langgraph_failure.sftrace/integrity.json +0 -0
  142. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/regression/langgraph_failure.sftrace/manifest.json +0 -0
  143. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/regression/langgraph_failure.sftrace/redactions.json +0 -0
  144. {stepfork-0.2.1 → stepfork-0.3.0}/examples/langgraph_agent/regression/test_langgraph_regression.py +0 -0
  145. {stepfork-0.2.1 → stepfork-0.3.0}/examples/model_decision/README.md +0 -0
  146. {stepfork-0.2.1 → stepfork-0.3.0}/examples/model_decision/__init__.py +0 -0
  147. {stepfork-0.2.1 → stepfork-0.3.0}/examples/model_decision/agent.py +0 -0
  148. {stepfork-0.2.1 → stepfork-0.3.0}/examples/model_decision/demo.py +0 -0
  149. {stepfork-0.2.1 → stepfork-0.3.0}/examples/openai_chat/README.md +0 -0
  150. {stepfork-0.2.1 → stepfork-0.3.0}/examples/openai_chat/__init__.py +0 -0
  151. {stepfork-0.2.1 → stepfork-0.3.0}/examples/openai_chat/agent.py +0 -0
  152. {stepfork-0.2.1 → stepfork-0.3.0}/examples/openai_chat/demo.py +0 -0
  153. {stepfork-0.2.1 → stepfork-0.3.0}/examples/openai_chat/expected.json +0 -0
  154. {stepfork-0.2.1 → stepfork-0.3.0}/examples/quickstart/__init__.py +0 -0
  155. {stepfork-0.2.1 → stepfork-0.3.0}/examples/quickstart/agent.py +0 -0
  156. {stepfork-0.2.1/examples/real-llm-case-study/traces/incident-triage.sftrace → stepfork-0.3.0/examples/quickstart/baseline.sftrace}/redactions.json +0 -0
  157. {stepfork-0.2.1 → stepfork-0.3.0}/examples/quickstart/demo.py +0 -0
  158. {stepfork-0.2.1 → stepfork-0.3.0}/examples/quickstart/expected.json +0 -0
  159. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/.gitignore +0 -0
  160. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/.python-version +0 -0
  161. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/CASE_STUDY.md +0 -0
  162. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/README.md +0 -0
  163. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/RESULTS.md +0 -0
  164. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/agent.py +0 -0
  165. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/counters.py +0 -0
  166. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/README.md +0 -0
  167. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/clean_install_verification.txt +0 -0
  168. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/divergence.txt +0 -0
  169. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/fix.diff +0 -0
  170. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/frozen_replay.txt +0 -0
  171. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/full_suite.txt +0 -0
  172. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/green_pass.txt +0 -0
  173. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/hybrid_comparison.json +0 -0
  174. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/evidence/red_failure.txt +0 -0
  175. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/expected.json +0 -0
  176. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/fix.diff +0 -0
  177. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/fixtures/deployments.json +0 -0
  178. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/fixtures/runbooks.json +0 -0
  179. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/fixtures/services.json +0 -0
  180. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/provider.py +0 -0
  181. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/pyproject.toml +0 -0
  182. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/scenario_a.py +0 -0
  183. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/scenario_b.py +0 -0
  184. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/scripts/hybrid_prompt_comparison.py +0 -0
  185. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/scripts/record_incident.py +0 -0
  186. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/scripts/verify_frozen.py +0 -0
  187. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/snapshots/agent_buggy.py +0 -0
  188. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/snapshots/agent_fixed.py +0 -0
  189. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/tests/test_frozen_replay_guards.py +0 -0
  190. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/tests/test_incident_regression.py +0 -0
  191. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/tests/test_scenario_a_refactor.py +0 -0
  192. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/tests/test_scenario_b_divergence.py +0 -0
  193. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/traces/incident-triage.sftrace/events.jsonl +0 -0
  194. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/traces/incident-triage.sftrace/integrity.json +0 -0
  195. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/traces/incident-triage.sftrace/manifest.json +0 -0
  196. {stepfork-0.2.1/tests/golden/diff_baseline.sftrace → stepfork-0.3.0/examples/real-llm-case-study/traces/incident-triage.sftrace}/redactions.json +0 -0
  197. {stepfork-0.2.1 → stepfork-0.3.0}/examples/real-llm-case-study/uv.lock +0 -0
  198. {stepfork-0.2.1 → stepfork-0.3.0}/examples/refund_agent/__init__.py +0 -0
  199. {stepfork-0.2.1 → stepfork-0.3.0}/examples/refund_agent/agent.py +0 -0
  200. {stepfork-0.2.1 → stepfork-0.3.0}/examples/refund_agent/demo.py +0 -0
  201. {stepfork-0.2.1 → stepfork-0.3.0}/examples/refund_agent/expected.json +0 -0
  202. {stepfork-0.2.1 → stepfork-0.3.0}/scripts/terminal-demo/README.md +0 -0
  203. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/__main__.py +0 -0
  204. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/assertions.py +0 -0
  205. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/__init__.py +0 -0
  206. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/export.py +0 -0
  207. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/minimize.py +0 -0
  208. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/run.py +0 -0
  209. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/cli/score.py +0 -0
  210. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/diff/__init__.py +0 -0
  211. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/diff/compare.py +0 -0
  212. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/__init__.py +0 -0
  213. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/entrypoint.py +0 -0
  214. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/generator.py +0 -0
  215. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/mutants.py +0 -0
  216. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/receipt.py +0 -0
  217. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/runtime.py +0 -0
  218. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/scoring.py +0 -0
  219. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/export/testfile.py +0 -0
  220. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/fork/overrides.py +0 -0
  221. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/integrations/__init__.py +0 -0
  222. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/integrations/openai.py +0 -0
  223. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/minimize/__init__.py +0 -0
  224. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/minimize/delta_debug.py +0 -0
  225. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/minimize/engine.py +0 -0
  226. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/minimize/models.py +0 -0
  227. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/minimize/signature.py +0 -0
  228. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/py.typed +0 -0
  229. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/recorder/__init__.py +0 -0
  230. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/recorder/llm.py +0 -0
  231. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/recorder/tooling.py +0 -0
  232. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/replay/plan.py +0 -0
  233. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/canonical.py +0 -0
  234. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/hashing.py +0 -0
  235. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/jsonable.py +0 -0
  236. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/manifest.py +0 -0
  237. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/redaction.py +0 -0
  238. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/replay_policy.py +0 -0
  239. {stepfork-0.2.1 → stepfork-0.3.0}/src/stepfork/trace/schema.py +0 -0
  240. {stepfork-0.2.1 → stepfork-0.3.0}/tests/__init__.py +0 -0
  241. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/.gitkeep +0 -0
  242. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/README.md +0 -0
  243. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/__init__.py +0 -0
  244. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/agents/__init__.py +0 -0
  245. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/agents/crash_agent.py +0 -0
  246. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/agents/fake_llm.py +0 -0
  247. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/agents/triage_agent.py +0 -0
  248. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/build_fixtures.py +0 -0
  249. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/diff_baseline.sftrace/events.jsonl +0 -0
  250. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/diff_baseline.sftrace/integrity.json +0 -0
  251. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/diff_baseline.sftrace/manifest.json +0 -0
  252. {stepfork-0.2.1/tests/golden/diff_changed.sftrace → stepfork-0.3.0/tests/golden/diff_baseline.sftrace}/redactions.json +0 -0
  253. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/diff_changed.sftrace/events.jsonl +0 -0
  254. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/diff_changed.sftrace/integrity.json +0 -0
  255. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/diff_changed.sftrace/manifest.json +0 -0
  256. {stepfork-0.2.1/tests/golden/failed_llm_run.sftrace → stepfork-0.3.0/tests/golden/diff_changed.sftrace}/redactions.json +0 -0
  257. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/failed_llm_run.sftrace/events.jsonl +0 -0
  258. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/failed_llm_run.sftrace/integrity.json +0 -0
  259. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/failed_llm_run.sftrace/manifest.json +0 -0
  260. {stepfork-0.2.1/tests/golden/legacy_v01.sftrace → stepfork-0.3.0/tests/golden/failed_llm_run.sftrace}/redactions.json +0 -0
  261. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/failed_tool_run.sftrace/events.jsonl +0 -0
  262. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/failed_tool_run.sftrace/integrity.json +0 -0
  263. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/failed_tool_run.sftrace/manifest.json +0 -0
  264. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/failed_tool_run.sftrace/redactions.json +0 -0
  265. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/legacy_v01.sftrace/events.jsonl +0 -0
  266. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/legacy_v01.sftrace/manifest.json +0 -0
  267. {stepfork-0.2.1/tests/golden/partial_run.sftrace → stepfork-0.3.0/tests/golden/legacy_v01.sftrace}/redactions.json +0 -0
  268. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/partial_run.sftrace/events.jsonl +0 -0
  269. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/partial_run.sftrace/integrity.json +0 -0
  270. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/partial_run.sftrace/manifest.json +0 -0
  271. {stepfork-0.2.1/tests/golden/successful_run.sftrace → stepfork-0.3.0/tests/golden/partial_run.sftrace}/redactions.json +0 -0
  272. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/successful_run.sftrace/events.jsonl +0 -0
  273. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/successful_run.sftrace/integrity.json +0 -0
  274. {stepfork-0.2.1 → stepfork-0.3.0}/tests/golden/successful_run.sftrace/manifest.json +0 -0
  275. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/.gitkeep +0 -0
  276. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_docs_assets.py +0 -0
  277. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_docs_langgraph_example.py +0 -0
  278. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_export_pytest_agent_fixtures.py +0 -0
  279. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_failure_to_test.py +0 -0
  280. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_fork_integration.py +0 -0
  281. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_golden_fixtures.py +0 -0
  282. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_langgraph_agent.py +0 -0
  283. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_minimize_integration.py +0 -0
  284. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_model_decision_demo.py +0 -0
  285. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_quickstart_failure_to_test.py +0 -0
  286. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_refund_failure_to_test.py +0 -0
  287. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_secure_trace_roundtrip.py +0 -0
  288. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_trace_infrastructure_flow.py +0 -0
  289. {stepfork-0.2.1 → stepfork-0.3.0}/tests/integration/test_trace_roundtrip.py +0 -0
  290. {stepfork-0.2.1 → stepfork-0.3.0}/tests/property/.gitkeep +0 -0
  291. {stepfork-0.2.1 → stepfork-0.3.0}/tests/property/test_trace_properties.py +0 -0
  292. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_assertions.py +0 -0
  293. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_async_boundaries.py +0 -0
  294. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_canonical.py +0 -0
  295. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli.py +0 -0
  296. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_export.py +0 -0
  297. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_inspect.py +0 -0
  298. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_minimize.py +0 -0
  299. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_run.py +0 -0
  300. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_cli_score.py +0 -0
  301. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_export.py +0 -0
  302. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_export_mutants.py +0 -0
  303. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_export_scoring.py +0 -0
  304. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_fork_edge_cases.py +0 -0
  305. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_fork_engine.py +0 -0
  306. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_fork_overrides.py +0 -0
  307. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_hashing.py +0 -0
  308. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_hybrid_replay.py +0 -0
  309. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_inspector.py +0 -0
  310. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_invalid_bundles.py +0 -0
  311. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_jsonable.py +0 -0
  312. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_langgraph_integration.py +0 -0
  313. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_live_tool_authorization.py +0 -0
  314. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_llm_request.py +0 -0
  315. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_manifest.py +0 -0
  316. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_minimize_delta_debug.py +0 -0
  317. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_minimize_mode_validation.py +0 -0
  318. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_minimize_signature.py +0 -0
  319. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_minimize_unreached_call.py +0 -0
  320. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_openai_integration.py +0 -0
  321. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_recording_session.py +0 -0
  322. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_replay_contract.py +0 -0
  323. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_replay_contract_changed_args.py +0 -0
  324. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_replay_contract_extra_calls.py +0 -0
  325. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_replay_plan.py +0 -0
  326. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_replay_tool.py +0 -0
  327. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_schema.py +0 -0
  328. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_trace_models.py +0 -0
  329. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_trace_tool.py +0 -0
  330. {stepfork-0.2.1 → stepfork-0.3.0}/tests/unit/test_validation.py +0 -0
@@ -4,6 +4,62 @@ All notable changes to Stepfork are recorded here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/), and this project adheres to
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.3.0] - 2026-11-29
8
+
9
+ First published release with the LangGraph retrieval and node-context evidence
10
+ APIs from issue #31. The `.sftrace` v0.1 format is unchanged.
11
+
12
+ ### Added
13
+
14
+ - LangGraph `traced_node` records per-node digest, access, and status evidence
15
+ for instrumented nodes, including context digests and optional captured
16
+ values.
17
+ - LangGraph `capture_retrieval` records query, item, and results evidence with
18
+ configurable capture modes and best-effort redaction.
19
+ - LangGraph `record_assembled_context` associates context evidence with the
20
+ active node and can reference a recorded LLM request.
21
+ - Optional `evidence.json` sidecar persists retrieval and node-context records.
22
+ When read, evidence references and digests are validated against the trace.
23
+ Integrity-manifest verification is separate and runs only when
24
+ `verify_integrity` is enabled.
25
+
26
+ ### Fixed
27
+
28
+ - `record_assembled_context(event_id=...)` now checks the referenced event in
29
+ the active recording. It no longer mislabels tool calls or other event types
30
+ as `llm_request` evidence; unsupported event references and explicitly
31
+ supplied invalid IDs are rejected clearly. Omitting `event_id` is allowed and
32
+ produces `kind="unavailable"`.
33
+ - Documentation now describes the actual fork-provenance classification:
34
+ `unavailable` is reserved for unreadable provenance and parent-bundle digest
35
+ mismatches, not merely missing or legacy provenance.
36
+
37
+ ### Changed
38
+
39
+ - Package `Development Status` classifier moves from `2 - Pre-Alpha` to
40
+ `3 - Alpha`. The API and trace format remain experimental, but the recorder,
41
+ replay engine, CLI, and test export are now bounded enough for alpha use.
42
+ - Release-facing docs describe v0.3.0 as the current release instead of
43
+ separating published and current-`main` features.
44
+
45
+ ### Documentation
46
+
47
+ - Add a v0.3.0 release page and update the landing pages, quickstart,
48
+ early-adopter guide, trace-format bundle layout, and developer counts.
49
+ - Update the release checklist to use the committed trusted-publishing workflow
50
+ rather than recommending manual `uv publish`.
51
+ - Clarify that evidence and integrity metadata are historical observations and
52
+ not current-source or cryptographic authenticity claims.
53
+
54
+ ### Limitations
55
+
56
+ - LLM request attribution for assembled context remains limited to recorded
57
+ `llm_request` events; tool-call references remain in
58
+ `source_event_ids` rather than `assembled_context_source`.
59
+ - Streaming model calls are not supported by the adapters.
60
+ - Redaction is best-effort, integrity hashes are not signatures, and replay is
61
+ not a sandbox.
62
+
7
63
  ## [0.2.1] - 2026-10-20
8
64
 
9
65
  Minimization correctness fixes, tri-state regression verdicts, and expectation
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.5
2
+ Name: stepfork
3
+ Version: 0.3.0
4
+ Summary: Open-source behavioral regression testing for AI agents.
5
+ Project-URL: Homepage, https://github.com/utsab345/stepfork
6
+ Project-URL: Repository, https://github.com/utsab345/stepfork
7
+ Project-URL: Issues, https://github.com/utsab345/stepfork/issues
8
+ Project-URL: PyPI, https://pypi.org/project/stepfork/
9
+ Author: Utsab Dahal
10
+ License: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: agents,ai,debugging,llm,pytest,regression-testing,replay,testing
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Requires-Python: <3.14,>=3.11
22
+ Requires-Dist: pydantic>=2.0
23
+ Requires-Dist: rich>=13.0
24
+ Requires-Dist: typer>=0.12
25
+ Provides-Extra: langgraph
26
+ Requires-Dist: langchain-core>=1.0; extra == 'langgraph'
27
+ Requires-Dist: langgraph>=1.0; extra == 'langgraph'
28
+ Provides-Extra: openai
29
+ Requires-Dist: openai>=1.0; extra == 'openai'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Stepfork
33
+
34
+ **Open-source behavioral regression testing for AI agents.**
35
+
36
+ Record failed AI agent executions locally, replay instrumented dependencies, compare behavior, and export reproducible pytest regression tests.
37
+
38
+ [PyPI](https://pypi.org/project/stepfork/) ·
39
+ [Documentation](https://utsab345.github.io/stepfork/) ·
40
+ [CI](https://github.com/utsab345/stepfork/actions/workflows/ci.yml) ·
41
+ [Issues](https://github.com/utsab345/stepfork/issues)
42
+
43
+ ## The problem
44
+
45
+ Unit tests often miss regressions in multi-step agent behavior. A recorded run
46
+ can show what the agent called and returned, but replaying against live tools or
47
+ models makes a regression test slow, costly, and nondeterministic.
48
+
49
+ Stepfork captures instrumented dependency calls in a local trace and replays
50
+ their recorded responses. You can compare runs and export a pytest test with an
51
+ explicit expectation for the corrected behavior.
52
+
53
+ ## How it works
54
+
55
+ Wrap the tool and LLM boundaries you want captured. Frozen replay strictly
56
+ matches those boundaries and substitutes recorded responses, so the wrapped
57
+ bodies are not run again. Calls outside instrumented boundaries are not
58
+ intercepted.
59
+
60
+ 1. **Record** a failed or completed run into a local `.sftrace` bundle.
61
+ 2. **Inspect** the events, integrity metadata, and failure details.
62
+ 3. **Replay** the entrypoint with instrumented dependencies frozen.
63
+ 4. **Diff** the recorded behavior against a corrected run.
64
+ 5. **Export** a pytest regression test with an explicit expectation.
65
+ 6. **Test** the buggy entrypoint and the fixed entrypoint with pytest.
66
+
67
+ ![Stepfork workflow](assets/stepfork-workflow.png)
68
+
69
+ ## Features
70
+
71
+ ### In v0.3.0
72
+
73
+ - Record completed and failed runs as local `.sftrace` bundles.
74
+ - Inspect and validate traces; check bundle integrity.
75
+ - Replay instrumented tool and LLM calls with recorded responses.
76
+ - Compare traces and inspect behavior-level differences.
77
+ - Report coverage of observed instrumented calls. Calls outside instrumented
78
+ boundaries are not measured.
79
+ - Save named local baselines and gate trace changes in CI
80
+ ([guide](docs/baselines.md), [runnable example](docs/baseline-example.md)).
81
+ - Export pytest regression tests with output and trajectory expectations.
82
+ - Minimize failing traces and fork traces at a selected step.
83
+ - Use optional OpenAI Python SDK and LangGraph adapters for supported
84
+ non-streaming boundaries.
85
+ - Capture optional retrieval evidence and per-node context through LangGraph
86
+ `traced_node`, `capture_retrieval`, and `record_assembled_context`; see
87
+ [RAG evidence](docs/rag.md).
88
+ - Best-effort redaction of common credential patterns when recording.
89
+
90
+ Streaming model calls are not supported by the adapters.
91
+
92
+ Stepfork is experimental. Redaction is not a guarantee against sensitive-data
93
+ leaks, integrity hashes are not signatures, and replay is not a sandbox. See
94
+ [security notes](docs/security.md).
95
+
96
+ ## Installation
97
+
98
+ Requires Python 3.11, 3.12, or 3.13.
99
+
100
+ Install the v0.3.0 release from PyPI:
101
+
102
+ ```bash
103
+ pip install "stepfork==0.3.0"
104
+ ```
105
+
106
+ For a contributor checkout or the latest development changes, install from
107
+ source:
108
+
109
+ ```bash
110
+ pip install "git+https://github.com/utsab345/stepfork.git@main"
111
+ ```
112
+
113
+ See the [development instructions](docs/development.md) for contributor setup.
114
+
115
+ Install an adapter only if needed:
116
+
117
+ ```bash
118
+ pip install "stepfork[openai]"
119
+ pip install "stepfork[langgraph]"
120
+ ```
121
+
122
+ ## Quick start
123
+
124
+ Save this as `quickstart.py`. The example records a shipped order that the
125
+ buggy agent fails to notify about.
126
+
127
+ ```python
128
+ from stepfork import record, trace_tool
129
+
130
+
131
+ @trace_tool
132
+ def order_status(order_id: str) -> dict[str, str]:
133
+ return {"order_id": order_id, "status": "shipped"}
134
+
135
+
136
+ def run_agent() -> dict[str, bool]:
137
+ order = order_status("ORD-1001")
138
+ return {"notify": order["status"] == "delivered"} # Bug: should notify on shipment
139
+
140
+
141
+ if __name__ == "__main__":
142
+ with record("order-agent", output="failure.sftrace") as session:
143
+ result = run_agent()
144
+ session.set_output(result)
145
+ print(result)
146
+ ```
147
+
148
+ Run the CLI commands from the directory containing `quickstart.py`. The CLI
149
+ resolves `--entrypoint` from the current working directory; use `PYTHONPATH` if
150
+ the module lives elsewhere.
151
+
152
+ ```bash
153
+ python -m pip install pytest
154
+ python quickstart.py
155
+ stepfork inspect failure.sftrace
156
+ stepfork replay failure.sftrace --entrypoint quickstart:run_agent --mode frozen
157
+ printf '{"notify": true}\n' > expected.json
158
+ stepfork export failure.sftrace \
159
+ --entrypoint quickstart:run_agent \
160
+ --expect-output expected.json \
161
+ --output test_order_regression.py
162
+ ```
163
+
164
+ Change the condition in `run_agent` to check for `"shipped"`, then run
165
+ `python -m pytest -q test_order_regression.py`. See the
166
+ [five-minute quickstart](docs/getting-started.md) for inspect, validate, diff,
167
+ and red-green pytest commands.
168
+
169
+ See the [terminal demo](scripts/terminal-demo/stepfork-demo.gif).
170
+
171
+ ## Integrations
172
+
173
+ The core API is framework-independent. Optional adapters currently support:
174
+
175
+ - **OpenAI Python SDK:** sync and async, non-streaming
176
+ `chat.completions.create`.
177
+ - **LangGraph / LangChain:** sync and async non-streaming chat-model generation
178
+ and wrapped function tools. v0.3.0 also adds optional node and retrieval
179
+ evidence. Streaming is not supported.
180
+
181
+ Offline GitHub Actions examples cover frozen replay and named baseline
182
+ comparisons without provider credentials. Stepfork does not currently provide
183
+ a reusable GitHub Action or an MCP adapter. See the
184
+ [integration details](docs/integrations.md).
185
+
186
+ ## Contributing
187
+
188
+ Contributions are welcome. Read the [contribution guide](CONTRIBUTING.md) and
189
+ [development instructions](docs/development.md), then open an issue or pull
190
+ request. Please do not include credentials or unreviewed trace data in issues,
191
+ tests, or commits.
192
+
193
+ ## License
194
+
195
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,164 @@
1
+ # Stepfork
2
+
3
+ **Open-source behavioral regression testing for AI agents.**
4
+
5
+ Record failed AI agent executions locally, replay instrumented dependencies, compare behavior, and export reproducible pytest regression tests.
6
+
7
+ [PyPI](https://pypi.org/project/stepfork/) ·
8
+ [Documentation](https://utsab345.github.io/stepfork/) ·
9
+ [CI](https://github.com/utsab345/stepfork/actions/workflows/ci.yml) ·
10
+ [Issues](https://github.com/utsab345/stepfork/issues)
11
+
12
+ ## The problem
13
+
14
+ Unit tests often miss regressions in multi-step agent behavior. A recorded run
15
+ can show what the agent called and returned, but replaying against live tools or
16
+ models makes a regression test slow, costly, and nondeterministic.
17
+
18
+ Stepfork captures instrumented dependency calls in a local trace and replays
19
+ their recorded responses. You can compare runs and export a pytest test with an
20
+ explicit expectation for the corrected behavior.
21
+
22
+ ## How it works
23
+
24
+ Wrap the tool and LLM boundaries you want captured. Frozen replay strictly
25
+ matches those boundaries and substitutes recorded responses, so the wrapped
26
+ bodies are not run again. Calls outside instrumented boundaries are not
27
+ intercepted.
28
+
29
+ 1. **Record** a failed or completed run into a local `.sftrace` bundle.
30
+ 2. **Inspect** the events, integrity metadata, and failure details.
31
+ 3. **Replay** the entrypoint with instrumented dependencies frozen.
32
+ 4. **Diff** the recorded behavior against a corrected run.
33
+ 5. **Export** a pytest regression test with an explicit expectation.
34
+ 6. **Test** the buggy entrypoint and the fixed entrypoint with pytest.
35
+
36
+ ![Stepfork workflow](assets/stepfork-workflow.png)
37
+
38
+ ## Features
39
+
40
+ ### In v0.3.0
41
+
42
+ - Record completed and failed runs as local `.sftrace` bundles.
43
+ - Inspect and validate traces; check bundle integrity.
44
+ - Replay instrumented tool and LLM calls with recorded responses.
45
+ - Compare traces and inspect behavior-level differences.
46
+ - Report coverage of observed instrumented calls. Calls outside instrumented
47
+ boundaries are not measured.
48
+ - Save named local baselines and gate trace changes in CI
49
+ ([guide](docs/baselines.md), [runnable example](docs/baseline-example.md)).
50
+ - Export pytest regression tests with output and trajectory expectations.
51
+ - Minimize failing traces and fork traces at a selected step.
52
+ - Use optional OpenAI Python SDK and LangGraph adapters for supported
53
+ non-streaming boundaries.
54
+ - Capture optional retrieval evidence and per-node context through LangGraph
55
+ `traced_node`, `capture_retrieval`, and `record_assembled_context`; see
56
+ [RAG evidence](docs/rag.md).
57
+ - Best-effort redaction of common credential patterns when recording.
58
+
59
+ Streaming model calls are not supported by the adapters.
60
+
61
+ Stepfork is experimental. Redaction is not a guarantee against sensitive-data
62
+ leaks, integrity hashes are not signatures, and replay is not a sandbox. See
63
+ [security notes](docs/security.md).
64
+
65
+ ## Installation
66
+
67
+ Requires Python 3.11, 3.12, or 3.13.
68
+
69
+ Install the v0.3.0 release from PyPI:
70
+
71
+ ```bash
72
+ pip install "stepfork==0.3.0"
73
+ ```
74
+
75
+ For a contributor checkout or the latest development changes, install from
76
+ source:
77
+
78
+ ```bash
79
+ pip install "git+https://github.com/utsab345/stepfork.git@main"
80
+ ```
81
+
82
+ See the [development instructions](docs/development.md) for contributor setup.
83
+
84
+ Install an adapter only if needed:
85
+
86
+ ```bash
87
+ pip install "stepfork[openai]"
88
+ pip install "stepfork[langgraph]"
89
+ ```
90
+
91
+ ## Quick start
92
+
93
+ Save this as `quickstart.py`. The example records a shipped order that the
94
+ buggy agent fails to notify about.
95
+
96
+ ```python
97
+ from stepfork import record, trace_tool
98
+
99
+
100
+ @trace_tool
101
+ def order_status(order_id: str) -> dict[str, str]:
102
+ return {"order_id": order_id, "status": "shipped"}
103
+
104
+
105
+ def run_agent() -> dict[str, bool]:
106
+ order = order_status("ORD-1001")
107
+ return {"notify": order["status"] == "delivered"} # Bug: should notify on shipment
108
+
109
+
110
+ if __name__ == "__main__":
111
+ with record("order-agent", output="failure.sftrace") as session:
112
+ result = run_agent()
113
+ session.set_output(result)
114
+ print(result)
115
+ ```
116
+
117
+ Run the CLI commands from the directory containing `quickstart.py`. The CLI
118
+ resolves `--entrypoint` from the current working directory; use `PYTHONPATH` if
119
+ the module lives elsewhere.
120
+
121
+ ```bash
122
+ python -m pip install pytest
123
+ python quickstart.py
124
+ stepfork inspect failure.sftrace
125
+ stepfork replay failure.sftrace --entrypoint quickstart:run_agent --mode frozen
126
+ printf '{"notify": true}\n' > expected.json
127
+ stepfork export failure.sftrace \
128
+ --entrypoint quickstart:run_agent \
129
+ --expect-output expected.json \
130
+ --output test_order_regression.py
131
+ ```
132
+
133
+ Change the condition in `run_agent` to check for `"shipped"`, then run
134
+ `python -m pytest -q test_order_regression.py`. See the
135
+ [five-minute quickstart](docs/getting-started.md) for inspect, validate, diff,
136
+ and red-green pytest commands.
137
+
138
+ See the [terminal demo](scripts/terminal-demo/stepfork-demo.gif).
139
+
140
+ ## Integrations
141
+
142
+ The core API is framework-independent. Optional adapters currently support:
143
+
144
+ - **OpenAI Python SDK:** sync and async, non-streaming
145
+ `chat.completions.create`.
146
+ - **LangGraph / LangChain:** sync and async non-streaming chat-model generation
147
+ and wrapped function tools. v0.3.0 also adds optional node and retrieval
148
+ evidence. Streaming is not supported.
149
+
150
+ Offline GitHub Actions examples cover frozen replay and named baseline
151
+ comparisons without provider credentials. Stepfork does not currently provide
152
+ a reusable GitHub Action or an MCP adapter. See the
153
+ [integration details](docs/integrations.md).
154
+
155
+ ## Contributing
156
+
157
+ Contributions are welcome. Read the [contribution guide](CONTRIBUTING.md) and
158
+ [development instructions](docs/development.md), then open an issue or pull
159
+ request. Please do not include credentials or unreviewed trace data in issues,
160
+ tests, or commits.
161
+
162
+ ## License
163
+
164
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -14,9 +14,14 @@ failed agent run
14
14
  |
15
15
  behavioral diff src/stepfork/diff/
16
16
  |
17
+ minimize failure src/stepfork/minimize/
18
+ |
17
19
  pytest export src/stepfork/export/
18
20
  ```
19
21
 
22
+ `fork/` creates a trace from a selected step. `score/` assesses expectations
23
+ in exported tests; neither is required for the record-to-regression workflow.
24
+
20
25
  The `.sftrace` format and its storage, validation, redaction, and integrity
21
26
  logic all live under `src/stepfork/trace/` and are documented in
22
27
  [trace-format.md](trace-format.md).
@@ -60,6 +65,12 @@ Compares two traces as behavior. `engine.py` extracts ordered `BehaviorStep`
60
65
  entries and aligns them; `compare.py` computes structural field differences;
61
66
  `models.py` defines the machine-readable `DiffResult`.
62
67
 
68
+ ### `baseline/`
69
+
70
+ Stores named, integrity-verified `.sftrace` bundles under a local directory.
71
+ It validates trace compatibility and delegates behavioral comparisons to
72
+ `diff_traces`; it does not introduce another trace format.
73
+
63
74
  ### `export/`
64
75
 
65
76
  Generates the regression test.
@@ -78,8 +89,9 @@ Read-only summaries of a bundle for the `stepfork inspect` command.
78
89
 
79
90
  ### `cli/`
80
91
 
81
- Typer commands: `validate`, `inspect`, `replay`, `diff`, `export`, wired in
82
- `cli/main.py`. `src/stepfork/__main__.py` provides `python -m stepfork`.
92
+ Typer commands: `validate`, `inspect`, `replay`, `diff`, `export`, `minimize`,
93
+ `fork`, `score`, `run`, and `baseline`, wired in `cli/main.py`.
94
+ `src/stepfork/__main__.py` provides `python -m stepfork`.
83
95
 
84
96
  ## Security boundaries
85
97
 
@@ -90,7 +102,11 @@ Typer commands: `validate`, `inspect`, `replay`, `diff`, `export`, wired in
90
102
  - Integrity metadata is a checksum, not a signature; see
91
103
  [security.md](security.md).
92
104
 
93
- ## Reserved packages
105
+ ## Trace operations
94
106
 
95
- `fork/` and `minimize/` are placeholders for v0.2 (fork-at-step and failure
96
- minimization) and contain no v0.1 behavior.
107
+ - `fork/` builds a new trace from a selected step and supports event-output
108
+ overrides through the Python API.
109
+ - `minimize/` reduces a trace while checking whether the selected failure
110
+ continues to reproduce.
111
+ - `score/` is part of `export/`; it evaluates exported expectations without
112
+ executing the entrypoint.
@@ -0,0 +1,101 @@
1
+ # Baseline comparison example
2
+
3
+ This standalone example saves a reviewed trace as a baseline, compares a matching
4
+ candidate, then records a buggy candidate and detects the regression. It uses
5
+ the offline `examples/quickstart` agent and adds no dependencies.
6
+
7
+ Run it from a checkout of this repository. The shell commands use a
8
+ POSIX-compatible shell. On Windows, use WSL, Git Bash, or PowerShell equivalents
9
+ for `rm -rf` and heredoc redirection:
10
+
11
+ ```bash
12
+ git clone https://github.com/utsab345/stepfork.git
13
+ cd stepfork
14
+ uv sync
15
+ ```
16
+
17
+ ## 1. Save a reviewed baseline
18
+
19
+ `stepfork baseline save` never replaces an existing name. Remove the example
20
+ store first so this walkthrough is repeatable:
21
+
22
+ ```bash
23
+ rm -rf .stepfork/example-baselines
24
+
25
+ uv run stepfork baseline save quickstart-order \
26
+ examples/quickstart/baseline.sftrace \
27
+ --directory .stepfork/example-baselines
28
+
29
+ uv run stepfork baseline list --directory .stepfork/example-baselines
30
+ ```
31
+
32
+ The reviewed trace is copied under `.stepfork/example-baselines/`. It stays a
33
+ normal `.sftrace` bundle.
34
+
35
+ ## 2. Compare a matching candidate
36
+
37
+ `record_candidate.py` records the corrected deterministic agent:
38
+
39
+ ```bash
40
+ uv run python -m examples.quickstart.record_candidate --output baseline-candidate.sftrace
41
+
42
+ uv run stepfork baseline compare quickstart-order baseline-candidate.sftrace \
43
+ --directory .stepfork/example-baselines
44
+
45
+ echo "match exit code: $?"
46
+ ```
47
+
48
+ Expected result: `Result: BASELINE MATCH` and exit code `0`.
49
+
50
+ ## 3. Compare a regressed candidate
51
+
52
+ Create a small recording script for the buggy entrypoint. This is a local file
53
+ created by the example; it is not a new project dependency:
54
+
55
+ ```bash
56
+ cat > record_regression_candidate.py <<'PY'
57
+ from examples.quickstart import run_agent
58
+ from stepfork import record
59
+
60
+ with record("order-agent", output="regression-candidate.sftrace") as session:
61
+ result = run_agent()
62
+ session.set_output(result)
63
+
64
+ print(result)
65
+ PY
66
+
67
+ uv run python record_regression_candidate.py
68
+
69
+ uv run stepfork baseline compare quickstart-order regression-candidate.sftrace \
70
+ --directory .stepfork/example-baselines
71
+
72
+ echo "regression exit code: $?"
73
+ ```
74
+
75
+ Expected result: `Result: REGRESSION`, `Behavior steps changed: 1 (allowed: 0)`,
76
+ and exit code `1`.
77
+
78
+ ## Exit status
79
+
80
+ `stepfork baseline compare` uses these exit codes:
81
+
82
+ - `0`: changes are within `--max-changes` (default `0`).
83
+ - `1`: the behavioral threshold was exceeded.
84
+ - `2`: a baseline or candidate is missing, corrupt, incompatible, or unreadable.
85
+
86
+ Use the default threshold for a CI gate. `--max-changes N` allows up to N
87
+ changed, added, removed, or reordered behavior steps; it is a step count, not a
88
+ quality score. Comparison reads traces only and does not execute agent or tool
89
+ code. Recording a candidate does execute your agent.
90
+
91
+ ## CI
92
+
93
+ The repository includes two offline workflow examples:
94
+
95
+ - [Baseline regression workflow](https://github.com/utsab345/stepfork/blob/main/.github/workflows/baseline-regression.yml)
96
+ saves a reviewed baseline and gates a recorded candidate.
97
+ - [Agent regression workflow](https://github.com/utsab345/stepfork/blob/main/.github/workflows/agent-regression.yml)
98
+ runs exported frozen pytest replay tests.
99
+
100
+ See [Behavioral baselines](baselines.md) for naming rules, compatibility, and
101
+ security limits.
@@ -0,0 +1,105 @@
1
+ # Behavioral baselines
2
+
3
+ Named baselines keep reviewed `.sftrace` bundles in a local directory so
4
+ subsequent runs can be compared in tests or CI. Stepfork stores the original
5
+ trace format under `.stepfork/baselines/`; it does not introduce a database or
6
+ rewrite trace data.
7
+
8
+ ## Save and inspect a baseline
9
+
10
+ Save a known-good, completed trace:
11
+
12
+ ```bash
13
+ stepfork baseline save orders-v1 known-good.sftrace
14
+ stepfork baseline list
15
+ stepfork baseline show orders-v1
16
+ ```
17
+
18
+ By default, baselines live under `.stepfork/baselines/`. Pass
19
+ `--directory PATH` to use another local store. Names must be lowercase and
20
+ contain only letters, digits, dots, underscores, or hyphens; names start with
21
+ a letter or digit, are limited to 64 characters, and cannot be reserved
22
+ Windows device names.
23
+
24
+ Saving never replaces an existing name. To approve a behavior change, save it
25
+ under a new reviewed name and update the baseline selected by CI. Do not copy
26
+ a candidate over a baseline without reviewing its behavior.
27
+
28
+ ## Compare a candidate
29
+
30
+ Record a candidate run with the same deterministic inputs and compare it:
31
+
32
+ ```bash
33
+ python record_agent.py --output candidate.sftrace
34
+ stepfork baseline compare orders-v1 candidate.sftrace
35
+ ```
36
+
37
+ Comparison uses Stepfork's ordered behavioral diff: instrumented tool and LLM
38
+ calls, their inputs and outputs, errors, state changes, and final run output.
39
+ Timestamps, event IDs, run IDs, and durations do not affect equivalence.
40
+
41
+ The default `--max-changes 0` fails on any changed, added, removed, or reordered behavior
42
+ step. A non-negative `--max-changes N` allows up to N such steps; it is a
43
+ step-count threshold, not a percentage or a measure of output quality. Prefer
44
+ the default for a regression gate. `--json` emits a sanitized report.
45
+
46
+ `stepfork baseline compare` treats reordered steps as regressions by default because
47
+ movement can change agent behavior; the aligned diff report shows the move explicitly.
48
+
49
+ Exit codes for `baseline compare`:
50
+
51
+ - `0`: changes are within the configured threshold.
52
+ - `1`: the threshold was exceeded.
53
+ - `2`: missing, corrupt, incompatible, or unreadable baseline/candidate.
54
+
55
+ No model or tool code is executed by `baseline compare`; it only reads and
56
+ compares traces. Recording a candidate can call external services, so use
57
+ deterministic fakes or frozen replay where possible. Exact comparison of live,
58
+ nondeterministic model output is not a reliable quality evaluation.
59
+
60
+ ## GitHub Actions
61
+
62
+ The repository includes a complete offline example at
63
+ `.github/workflows/baseline-regression.yml`. It loads a reviewed baseline,
64
+ runs an integration test, records the deterministic quickstart agent, and
65
+ fails the job if the candidate differs. The fake tool needs no provider
66
+ credentials and makes no network request.
67
+
68
+ For a copy-paste walkthrough that saves a baseline, compares a matching
69
+ candidate, and detects a regression, see the
70
+ [standalone baseline example](baseline-example.md).
71
+
72
+ To adapt the workflow, commit a reviewed known-good trace, replace the
73
+ quickstart recording command with your deterministic candidate recording
74
+ command, and keep `baseline compare` as the CI gate. The candidate must be a
75
+ complete, integrity-verified `.sftrace` bundle.
76
+
77
+ ## Compatibility, security, and limitations
78
+
79
+ - Baseline operations accept strict, complete traces using schema `0.1` with
80
+ verified integrity metadata. Unsupported schema versions, legacy bundles
81
+ without integrity metadata, symlinks, and corrupted bundles are rejected.
82
+ - The recorded Stepfork version is shown for diagnosis; compatibility is
83
+ determined by the trace schema, not by requiring an identical package
84
+ version.
85
+ - Integrity hashes detect changes to payloads when the integrity record is
86
+ trusted; they are not signatures. A party able to edit both can recompute
87
+ them.
88
+ - Redaction is best-effort. Review traces before committing or sharing them;
89
+ they can contain prompts, tool inputs, outputs, and other sensitive data.
90
+ - Baselines are data, not a sandbox. Comparison does not execute trace or
91
+ entrypoint code, but candidate recording runs your application with its
92
+ configured privileges.
93
+ - Step alignment is deterministic and order-aware. Insertions/removals are
94
+ aligned to avoid shifting identical steps, but reordered identical steps and
95
+ ambiguous repeated calls are reported conservatively. A threshold does not
96
+ make nondeterministic behavior deterministic.
97
+
98
+ ## CLI reference
99
+
100
+ ```text
101
+ stepfork baseline save NAME TRACE [--directory PATH]
102
+ stepfork baseline list [--json] [--directory PATH]
103
+ stepfork baseline show NAME [--json] [--directory PATH]
104
+ stepfork baseline compare NAME CANDIDATE [--max-changes N] [--json] [--directory PATH]
105
+ ```