nighthawk-python 0.14.0__tar.gz → 0.16.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 (336) hide show
  1. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.claude/rules/docs.md +5 -7
  2. nighthawk_python-0.16.0/.claude/rules/evals.md +10 -0
  3. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.claude/rules/promptfoo.md +1 -1
  4. nighthawk_python-0.16.0/.claude/rules/python.md +40 -0
  5. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.claude/rules/src.md +10 -2
  6. nighthawk_python-0.16.0/.claude/rules/tests.md +21 -0
  7. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.github/workflows/ci.yml +22 -14
  8. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.github/workflows/docs.yml +26 -8
  9. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.github/workflows/publish.yml +1 -1
  10. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.gitignore +2 -1
  11. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/AGENTS.md +9 -7
  12. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/CHANGELOG.md +103 -1
  13. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/CONTRIBUTING.md +21 -23
  14. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/PKG-INFO +26 -28
  15. nighthawk_python-0.16.0/README.md +78 -0
  16. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/api.md +108 -20
  17. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/coding-agent-backends.md +6 -12
  18. nighthawk_python-0.16.0/docs/design-drivers.md +204 -0
  19. nighthawk_python-0.16.0/docs/embedded-execution.md +261 -0
  20. nighthawk_python-0.16.0/docs/executors.md +97 -0
  21. nighthawk_python-0.16.0/docs/for-coding-agents.md +255 -0
  22. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/index.md +15 -12
  23. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/natural-blocks.md +68 -38
  24. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/patterns.md +165 -38
  25. nighthawk_python-0.16.0/docs/philosophy.md +62 -0
  26. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/pydantic-ai-providers.md +5 -0
  27. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/quickstart.md +3 -11
  28. nighthawk_python-0.16.0/docs/roadmap.md +114 -0
  29. nighthawk_python-0.16.0/docs/runtime-configuration.md +864 -0
  30. nighthawk_python-0.16.0/docs/specification.md +1372 -0
  31. nighthawk_python-0.16.0/docs/verification.md +315 -0
  32. nighthawk_python-0.16.0/evals/AGENTS.md +1 -0
  33. nighthawk_python-0.16.0/evals/coding_agents/evidence/20260914-guide-assessment.md +100 -0
  34. nighthawk_python-0.16.0/evals/model_tools/README.md +213 -0
  35. nighthawk_python-0.16.0/evals/model_tools/__init__.py +1 -0
  36. nighthawk_python-0.16.0/evals/model_tools/cases.py +314 -0
  37. nighthawk_python-0.16.0/evals/model_tools/evidence/20260908-tool-design-review.md +60 -0
  38. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-assessment.md +121 -0
  39. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-configurations.json +73 -0
  40. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-gpt56-assessment.md +143 -0
  41. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-gpt56-configurations.json +92 -0
  42. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-gpt56-guidance.md +116 -0
  43. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-gpt56-main.md +137 -0
  44. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-gpt56-selected-traces.json +1418 -0
  45. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-gpt56-trials.csv +577 -0
  46. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-guidance.md +227 -0
  47. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-main.md +339 -0
  48. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-selected-traces.json +920 -0
  49. nighthawk_python-0.16.0/evals/model_tools/evidence/20260909-trials.csv +577 -0
  50. nighthawk_python-0.16.0/evals/model_tools/evidence/20260910-natural-composition.md +69 -0
  51. nighthawk_python-0.16.0/evals/model_tools/evidence/20260910-python-boundaries.md +18 -0
  52. nighthawk_python-0.16.0/evals/model_tools/evidence/20260911-ideal-state-audit.md +167 -0
  53. nighthawk_python-0.16.0/evals/model_tools/evidence/20260911-inspection-artifact-manifest.json +107 -0
  54. nighthawk_python-0.16.0/evals/model_tools/evidence/20260911-inspection-assessment.md +149 -0
  55. nighthawk_python-0.16.0/evals/model_tools/evidence/20260911-inspection-failure-traces.jsonl +66 -0
  56. nighthawk_python-0.16.0/evals/model_tools/evidence/20260911-inspection-study-protocol.md +113 -0
  57. nighthawk_python-0.16.0/evals/model_tools/evidence/20260911-inspection-trial-metrics.csv +829 -0
  58. nighthawk_python-0.16.0/evals/model_tools/inspection_study.py +636 -0
  59. nighthawk_python-0.16.0/evals/model_tools/prototype.py +389 -0
  60. nighthawk_python-0.16.0/evals/model_tools/report.py +100 -0
  61. nighthawk_python-0.16.0/evals/model_tools/run.py +302 -0
  62. nighthawk_python-0.16.0/evals/promptfoo/AGENTS.md +1 -0
  63. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/provider.py +1 -1
  64. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/mkdocs.yml +2 -0
  65. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/pyproject.toml +3 -3
  66. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/__init__.py +15 -8
  67. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/_text_fallback.py +7 -49
  68. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/base.py +19 -14
  69. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/claude_code_cli.py +4 -1
  70. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/claude_code_sdk.py +1 -1
  71. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/codex.py +8 -1
  72. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/mcp_boundary.py +12 -41
  73. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/mcp_server.py +0 -9
  74. nighthawk_python-0.16.0/src/nighthawk/backends/process_management.py +24 -0
  75. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/text_projection.py +4 -25
  76. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/tool_bridge.py +52 -55
  77. nighthawk_python-0.16.0/src/nighthawk/backends/tool_transport.py +88 -0
  78. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/composition.py +6 -2
  79. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/configuration.py +43 -4
  80. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/errors.py +0 -8
  81. nighthawk_python-0.16.0/src/nighthawk/function_call.py +189 -0
  82. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/identifier_path.py +1 -13
  83. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/json_renderer.py +76 -19
  84. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/lifecycle.py +30 -11
  85. nighthawk_python-0.16.0/src/nighthawk/natural/_names.py +23 -0
  86. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/natural/blocks.py +5 -36
  87. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/natural/decorator.py +105 -107
  88. nighthawk_python-0.16.0/src/nighthawk/natural/definition.py +45 -0
  89. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/natural/transform.py +135 -106
  90. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/oversight.py +15 -53
  91. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/resilience/_budget.py +11 -21
  92. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/resilience/_circuit_breaker.py +4 -25
  93. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/resilience/_fallback.py +0 -7
  94. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/resilience/_retry.py +0 -22
  95. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/resilience/_timeout.py +6 -30
  96. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/resilience/_vote.py +1 -7
  97. nighthawk_python-0.16.0/src/nighthawk/runtime/__init__.py +98 -0
  98. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/_user_content.py +23 -37
  99. nighthawk_python-0.16.0/src/nighthawk/runtime/annotations.py +73 -0
  100. nighthawk_python-0.16.0/src/nighthawk/runtime/assignment.py +145 -0
  101. nighthawk_python-0.16.0/src/nighthawk/runtime/async_bridge.py +198 -0
  102. nighthawk_python-0.16.0/src/nighthawk/runtime/bindings.py +111 -0
  103. nighthawk_python-0.16.0/src/nighthawk/runtime/context.py +101 -0
  104. nighthawk_python-0.16.0/src/nighthawk/runtime/description.py +482 -0
  105. nighthawk_python-0.16.0/src/nighthawk/runtime/discovery.py +122 -0
  106. nighthawk_python-0.16.0/src/nighthawk/runtime/embedded.py +107 -0
  107. nighthawk_python-0.16.0/src/nighthawk/runtime/environment.py +295 -0
  108. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/execution_reference.py +1 -0
  109. nighthawk_python-0.16.0/src/nighthawk/runtime/expression.py +93 -0
  110. nighthawk_python-0.16.0/src/nighthawk/runtime/inspection.py +52 -0
  111. nighthawk_python-0.16.0/src/nighthawk/runtime/interruption.py +18 -0
  112. nighthawk_python-0.16.0/src/nighthawk/runtime/model_candidate.py +57 -0
  113. nighthawk_python-0.16.0/src/nighthawk/runtime/notifications.py +41 -0
  114. nighthawk_python-0.16.0/src/nighthawk/runtime/operation_contract.py +65 -0
  115. nighthawk_python-0.16.0/src/nighthawk/runtime/operations.py +142 -0
  116. nighthawk_python-0.16.0/src/nighthawk/runtime/preparation.py +230 -0
  117. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/prompt.py +115 -199
  118. nighthawk_python-0.16.0/src/nighthawk/runtime/runner.py +563 -0
  119. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/scoping.py +90 -96
  120. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/step_context.py +36 -53
  121. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/step_contract.py +0 -3
  122. nighthawk_python-0.16.0/src/nighthawk/runtime/step_definition.py +41 -0
  123. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/step_executor.py +95 -77
  124. nighthawk_python-0.16.0/src/nighthawk/runtime/step_request.py +99 -0
  125. nighthawk_python-0.16.0/src/nighthawk/runtime/step_result.py +57 -0
  126. nighthawk_python-0.16.0/src/nighthawk/testing.py +198 -0
  127. nighthawk_python-0.16.0/src/nighthawk/tools/_admission.py +85 -0
  128. nighthawk_python-0.16.0/src/nighthawk/tools/_ordering.py +88 -0
  129. nighthawk_python-0.16.0/src/nighthawk/tools/_tool_return_content.py +50 -0
  130. nighthawk_python-0.16.0/src/nighthawk/tools/assignment.py +31 -0
  131. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/tools/contracts.py +8 -28
  132. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/tools/declarations.py +0 -1
  133. nighthawk_python-0.16.0/src/nighthawk/tools/execution.py +160 -0
  134. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/tools/provided.py +4 -10
  135. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/ulid.py +0 -1
  136. nighthawk_python-0.16.0/tests/README.md +63 -0
  137. nighthawk_python-0.16.0/tests/backends/test_base.py +58 -0
  138. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/backends/test_claude_code_cli.py +0 -5
  139. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/backends/test_codex.py +7 -167
  140. nighthawk_python-0.16.0/tests/backends/test_mcp_boundary.py +753 -0
  141. nighthawk_python-0.16.0/tests/backends/test_process_management.py +27 -0
  142. nighthawk_python-0.16.0/tests/backends/test_text_fallback.py +48 -0
  143. nighthawk_python-0.16.0/tests/backends/test_text_projection.py +374 -0
  144. nighthawk_python-0.16.0/tests/backends/test_tool_bridge.py +355 -0
  145. nighthawk_python-0.16.0/tests/backends/test_tool_transport.py +318 -0
  146. nighthawk_python-0.16.0/tests/conftest.py +35 -0
  147. nighthawk_python-0.16.0/tests/docs/test_coding_agent_examples.py +46 -0
  148. nighthawk_python-0.16.0/tests/docs/test_error_examples.py +63 -0
  149. nighthawk_python-0.16.0/tests/docs/test_integrity.py +89 -0
  150. nighthawk_python-0.16.0/tests/docs/test_links.py +65 -0
  151. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/docs/test_prompt_examples.py +14 -26
  152. nighthawk_python-0.16.0/tests/docs/test_readme_example.py +63 -0
  153. nighthawk_python-0.16.0/tests/docs/test_runtime_examples.py +84 -0
  154. nighthawk_python-0.16.0/tests/evals/model_tools/test_inspection_study.py +155 -0
  155. nighthawk_python-0.16.0/tests/evals/model_tools/test_prototype.py +135 -0
  156. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/integration/skip_helpers.py +0 -2
  157. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/integration/test_carry_pattern.py +0 -7
  158. nighthawk_python-0.14.0/tests/integration/test_codex_integration.py → nighthawk_python-0.16.0/tests/integration/test_codex.py +2 -0
  159. nighthawk_python-0.16.0/tests/integration/test_natural_composition.py +252 -0
  160. nighthawk_python-0.16.0/tests/integration/test_openai.py +165 -0
  161. nighthawk_python-0.16.0/tests/integration/test_openai_multimodal.py +170 -0
  162. nighthawk_python-0.16.0/tests/lifecycle/test_embedded.py +165 -0
  163. nighthawk_python-0.16.0/tests/lifecycle/test_notifications.py +426 -0
  164. {nighthawk_python-0.14.0/tests/governance → nighthawk_python-0.16.0/tests/lifecycle}/test_step_completion.py +41 -81
  165. {nighthawk_python-0.14.0/tests/governance → nighthawk_python-0.16.0/tests/lifecycle}/test_step_ledger.py +23 -39
  166. nighthawk_python-0.14.0/tests/execution/test_natural_block_ordering.py → nighthawk_python-0.16.0/tests/natural/test_block_ordering.py +16 -22
  167. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/natural/test_blocks.py +17 -0
  168. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/natural/test_decorator_globals.py +24 -22
  169. nighthawk_python-0.16.0/tests/natural/test_deferred_annotations.py +131 -0
  170. nighthawk_python-0.16.0/tests/natural/test_function_definition.py +73 -0
  171. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/natural/test_introspection.py +5 -4
  172. nighthawk_python-0.16.0/tests/natural/test_lexical_contract.py +220 -0
  173. nighthawk_python-0.16.0/tests/natural/test_methods.py +191 -0
  174. nighthawk_python-0.16.0/tests/natural/test_runtime_name_hygiene.py +127 -0
  175. nighthawk_python-0.14.0/tests/execution/test_natural_traceback.py → nighthawk_python-0.16.0/tests/natural/test_traceback.py +7 -10
  176. nighthawk_python-0.16.0/tests/natural/test_variadic_contracts.py +118 -0
  177. nighthawk_python-0.16.0/tests/oversight/test_embedded_commit.py +61 -0
  178. nighthawk_python-0.14.0/tests/governance/test_return_expression_policy.py → nighthawk_python-0.16.0/tests/oversight/test_return_expression.py +62 -37
  179. nighthawk_python-0.14.0/tests/governance/test_governance.py → nighthawk_python-0.16.0/tests/oversight/test_step_commit.py +243 -42
  180. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/resilience/test_budget.py +2 -67
  181. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/resilience/test_circuit_breaker.py +1 -30
  182. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/resilience/test_composition.py +6 -27
  183. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/resilience/test_fallback.py +2 -12
  184. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/resilience/test_retry.py +2 -31
  185. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/resilience/test_timeout.py +1 -26
  186. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/resilience/test_vote.py +0 -18
  187. nighthawk_python-0.16.0/tests/runtime/__init__.py +0 -0
  188. nighthawk_python-0.16.0/tests/runtime/test_assignment.py +219 -0
  189. nighthawk_python-0.16.0/tests/runtime/test_async_bridge.py +373 -0
  190. nighthawk_python-0.16.0/tests/runtime/test_bindings.py +99 -0
  191. {nighthawk_python-0.14.0/tests/execution → nighthawk_python-0.16.0/tests/runtime}/test_capabilities.py +7 -3
  192. nighthawk_python-0.16.0/tests/runtime/test_context.py +181 -0
  193. nighthawk_python-0.16.0/tests/runtime/test_description.py +215 -0
  194. nighthawk_python-0.16.0/tests/runtime/test_discovery.py +162 -0
  195. nighthawk_python-0.16.0/tests/runtime/test_embedded.py +251 -0
  196. nighthawk_python-0.16.0/tests/runtime/test_environment.py +210 -0
  197. nighthawk_python-0.16.0/tests/runtime/test_executor_contract.py +282 -0
  198. nighthawk_python-0.16.0/tests/runtime/test_explicit_sharing.py +317 -0
  199. nighthawk_python-0.16.0/tests/runtime/test_expression.py +161 -0
  200. nighthawk_python-0.16.0/tests/runtime/test_input_patterns.py +151 -0
  201. {nighthawk_python-0.14.0/tests/execution → nighthawk_python-0.16.0/tests/runtime}/test_managed_model.py +6 -4
  202. nighthawk_python-0.16.0/tests/runtime/test_model_candidate.py +174 -0
  203. nighthawk_python-0.16.0/tests/runtime/test_model_operation_failures.py +121 -0
  204. nighthawk_python-0.16.0/tests/runtime/test_model_selection.py +256 -0
  205. nighthawk_python-0.16.0/tests/runtime/test_operations.py +335 -0
  206. nighthawk_python-0.16.0/tests/runtime/test_output_selection.py +135 -0
  207. nighthawk_python-0.16.0/tests/runtime/test_preparation.py +323 -0
  208. nighthawk_python-0.14.0/tests/execution/test_globals_prompt.py → nighthawk_python-0.16.0/tests/runtime/test_prompt_globals.py +4 -6
  209. nighthawk_python-0.16.0/tests/runtime/test_prompt_multimodal.py +519 -0
  210. nighthawk_python-0.16.0/tests/runtime/test_prompt_system.py +45 -0
  211. nighthawk_python-0.14.0/tests/execution/test_variables_prompt.py → nighthawk_python-0.16.0/tests/runtime/test_prompt_values.py +28 -517
  212. nighthawk_python-0.16.0/tests/runtime/test_request_observation.py +163 -0
  213. nighthawk_python-0.16.0/tests/runtime/test_runner.py +355 -0
  214. nighthawk_python-0.14.0/tests/public/test_composition.py → nighthawk_python-0.16.0/tests/runtime/test_scope_composition.py +41 -40
  215. nighthawk_python-0.16.0/tests/runtime/test_scoping.py +250 -0
  216. nighthawk_python-0.14.0/tests/execution/test_execution_outcome_prompt_fragment.py → nighthawk_python-0.16.0/tests/runtime/test_step_contract.py +0 -3
  217. nighthawk_python-0.16.0/tests/runtime/test_step_definition.py +87 -0
  218. nighthawk_python-0.16.0/tests/runtime/test_step_executor.py +269 -0
  219. nighthawk_python-0.16.0/tests/runtime/test_tracing.py +297 -0
  220. {nighthawk_python-0.14.0/tests/public → nighthawk_python-0.16.0/tests/runtime}/test_usage_meter.py +2 -23
  221. nighthawk_python-0.14.0/tests/docs/test_coding_agent_examples.py → nighthawk_python-0.16.0/tests/runtime/test_workflows.py +6 -24
  222. nighthawk_python-0.16.0/tests/support/__init__.py +0 -0
  223. nighthawk_python-0.16.0/tests/support/codex.py +109 -0
  224. nighthawk_python-0.16.0/tests/support/contexts.py +14 -0
  225. nighthawk_python-0.16.0/tests/support/executors.py +89 -0
  226. nighthawk_python-0.16.0/tests/support/host_controls.py +159 -0
  227. nighthawk_python-0.14.0/tests/execution/prompt_test_helpers.py → nighthawk_python-0.16.0/tests/support/prompts.py +4 -9
  228. nighthawk_python-0.16.0/tests/support/tools.py +47 -0
  229. nighthawk_python-0.16.0/tests/support/values.py +3 -0
  230. nighthawk_python-0.16.0/tests/test_composition.py +32 -0
  231. nighthawk_python-0.14.0/tests/public/test_model_configuration.py → nighthawk_python-0.16.0/tests/test_configuration.py +17 -5
  232. nighthawk_python-0.16.0/tests/test_function_call.py +287 -0
  233. nighthawk_python-0.16.0/tests/test_public_api.py +12 -0
  234. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/test_testing.py +104 -70
  235. nighthawk_python-0.16.0/tests/tools/__init__.py +0 -0
  236. nighthawk_python-0.16.0/tests/tools/test_admission.py +222 -0
  237. nighthawk_python-0.16.0/tests/tools/test_assignment_async.py +122 -0
  238. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/tools/test_contracts.py +28 -0
  239. nighthawk_python-0.16.0/tests/tools/test_coroutine_ownership.py +30 -0
  240. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/tools/test_declarations.py +4 -47
  241. nighthawk_python-0.16.0/tests/tools/test_discovery_content.py +166 -0
  242. nighthawk_python-0.16.0/tests/tools/test_execution.py +379 -0
  243. nighthawk_python-0.16.0/tests/tools/test_ordering.py +183 -0
  244. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/tools/test_provided_async.py +6 -12
  245. nighthawk_python-0.16.0/tests/tools/test_tool_return_content.py +67 -0
  246. nighthawk_python-0.16.0/uv.lock +1995 -0
  247. nighthawk_python-0.14.0/.claude/rules/tests.md +0 -13
  248. nighthawk_python-0.14.0/README.md +0 -80
  249. nighthawk_python-0.14.0/docs/executors.md +0 -72
  250. nighthawk_python-0.14.0/docs/for-coding-agents.md +0 -405
  251. nighthawk_python-0.14.0/docs/philosophy.md +0 -198
  252. nighthawk_python-0.14.0/docs/roadmap.md +0 -126
  253. nighthawk_python-0.14.0/docs/runtime-configuration.md +0 -390
  254. nighthawk_python-0.14.0/docs/specification.md +0 -890
  255. nighthawk_python-0.14.0/docs/verification.md +0 -273
  256. nighthawk_python-0.14.0/src/nighthawk/runtime/async_bridge.py +0 -50
  257. nighthawk_python-0.14.0/src/nighthawk/runtime/runner.py +0 -860
  258. nighthawk_python-0.14.0/src/nighthawk/runtime/step_result.py +0 -49
  259. nighthawk_python-0.14.0/src/nighthawk/testing.py +0 -218
  260. nighthawk_python-0.14.0/src/nighthawk/tools/_tool_return_content.py +0 -66
  261. nighthawk_python-0.14.0/src/nighthawk/tools/assignment.py +0 -265
  262. nighthawk_python-0.14.0/src/nighthawk/tools/execution.py +0 -234
  263. nighthawk_python-0.14.0/tests/conftest.py +0 -32
  264. nighthawk_python-0.14.0/tests/docs/test_docs_architecture.py +0 -278
  265. nighthawk_python-0.14.0/tests/execution/stub_executor.py +0 -69
  266. nighthawk_python-0.14.0/tests/execution/test_infer_binding_types.py +0 -91
  267. nighthawk_python-0.14.0/tests/execution/test_runtime.py +0 -1016
  268. nighthawk_python-0.14.0/tests/governance/test_step_results.py +0 -301
  269. nighthawk_python-0.14.0/tests/integration/test_llm_integration.py +0 -382
  270. nighthawk_python-0.14.0/tests/public/test_public_api.py +0 -721
  271. nighthawk_python-0.14.0/tests/public/test_readme_example.py +0 -18
  272. nighthawk_python-0.14.0/tests/tools/test_assignment_async.py +0 -307
  273. nighthawk_python-0.14.0/tests/tools/test_multimodal_helpers.py +0 -167
  274. nighthawk_python-0.14.0/tests/tools/test_tool_boundary.py +0 -1897
  275. nighthawk_python-0.14.0/uv.lock +0 -1726
  276. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.claude/settings.json +0 -0
  277. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.claude/unset_envs.sh +0 -0
  278. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.devcontainer/devcontainer-lock.json +0 -0
  279. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.devcontainer/devcontainer.json +0 -0
  280. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.devcontainer/postCreateCommand.sh +0 -0
  281. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.github/dependabot.yml +0 -0
  282. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/.python-version +0 -0
  283. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/CLAUDE.md +0 -0
  284. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/LICENSE +0 -0
  285. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/AGENTS.md +0 -0
  286. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/docs/assets/nighthawk_logo-128x128.png +0 -0
  287. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/assertions/__init__.py +0 -0
  288. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/assertions/binding_value.py +0 -0
  289. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/assertions/outcome_kind.py +0 -0
  290. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/assertions/raise_message.py +0 -0
  291. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/evidence/2026-03-26-baseline-prompt-ab.md +0 -0
  292. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/evidence/2026-03-26-baseline-regression.md +0 -0
  293. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/evidence/2026-03-26-baseline-suffix-ab.md +0 -0
  294. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/evidence/2026-04-27-runtime-prompt-optimization.md +0 -0
  295. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/promptfooconfig-agents.yaml +0 -0
  296. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/promptfooconfig-luna-sanity.yaml +0 -0
  297. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/promptfooconfig-prompt-ab.yaml +0 -0
  298. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/promptfooconfig-suffix-ab.yaml +0 -0
  299. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/promptfooconfig.yaml +0 -0
  300. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/prompts/eval_coding_agent.txt +0 -0
  301. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/prompts/eval_default.txt +0 -0
  302. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/prompts/eval_legacy_default.txt +0 -0
  303. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/prompts/eval_mutation_aware.txt +0 -0
  304. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/prompts/eval_sequenced.txt +0 -0
  305. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/research-result.md +0 -0
  306. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/binding_operations.yaml +0 -0
  307. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/edge_cases.yaml +0 -0
  308. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/loop_outcomes.yaml +0 -0
  309. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/loop_outcomes_ja.yaml +0 -0
  310. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/multi_step.yaml +0 -0
  311. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/null_handling.yaml +0 -0
  312. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/outcome_kinds.yaml +0 -0
  313. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/evals/promptfoo/test_cases/tool_selection.yaml +0 -0
  314. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/pyrightconfig.json +0 -0
  315. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/AGENTS.md +0 -0
  316. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/__init__.py +0 -0
  317. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/backends/claude_code_settings.py +0 -0
  318. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/natural/__init__.py +0 -0
  319. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/resilience/__init__.py +0 -0
  320. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/src/nighthawk/runtime/tool_calls.py +0 -0
  321. {nighthawk_python-0.14.0/src/nighthawk/runtime → nighthawk_python-0.16.0/src/nighthawk/tools}/__init__.py +0 -0
  322. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/AGENTS.md +0 -0
  323. {nighthawk_python-0.14.0/src/nighthawk/tools → nighthawk_python-0.16.0/tests}/__init__.py +0 -0
  324. {nighthawk_python-0.14.0/tests → nighthawk_python-0.16.0/tests/backends}/__init__.py +0 -0
  325. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/backends/test_claude_code_sdk.py +0 -0
  326. {nighthawk_python-0.14.0/tests/backends → nighthawk_python-0.16.0/tests/docs}/__init__.py +0 -0
  327. {nighthawk_python-0.14.0/tests/docs → nighthawk_python-0.16.0/tests/evals}/__init__.py +0 -0
  328. {nighthawk_python-0.14.0/tests/execution → nighthawk_python-0.16.0/tests/evals/model_tools}/__init__.py +0 -0
  329. {nighthawk_python-0.14.0 → nighthawk_python-0.16.0}/tests/integration/__init__.py +0 -0
  330. /nighthawk_python-0.14.0/tests/integration/test_claude_code_cli_integration.py → /nighthawk_python-0.16.0/tests/integration/test_claude_code_cli.py +0 -0
  331. /nighthawk_python-0.14.0/tests/integration/test_claude_code_sdk_integration.py → /nighthawk_python-0.16.0/tests/integration/test_claude_code_sdk.py +0 -0
  332. {nighthawk_python-0.14.0/tests/natural → nighthawk_python-0.16.0/tests/lifecycle}/__init__.py +0 -0
  333. {nighthawk_python-0.14.0/tests/public → nighthawk_python-0.16.0/tests/natural}/__init__.py +0 -0
  334. {nighthawk_python-0.14.0/tests/resilience → nighthawk_python-0.16.0/tests/oversight}/__init__.py +0 -0
  335. {nighthawk_python-0.14.0/tests/tools → nighthawk_python-0.16.0/tests/resilience}/__init__.py +0 -0
  336. /nighthawk_python-0.14.0/tests/test_renderer.py → /nighthawk_python-0.16.0/tests/test_json_renderer.py +0 -0
@@ -77,7 +77,7 @@ List only topics that commonly drift across multiple files or are easy to mispla
77
77
  - Terminology: "task" = structural unit (contract), "judgment" = cognitive act. Use "one task per block".
78
78
  - Code examples: self-contained and understandable without surrounding prose.
79
79
  - Built-in tools (`nh_eval`, `nh_assign`): implementation details. Only `specification.md` may expose them.
80
- - Native tools (`nh.scope(tools=...)`): `specification.md` documents as spec, `runtime-configuration.md` documents usage and the role split with `implicit_references`, `natural-blocks.md` may mention it with a "prefer binding functions" note, all others must not reference it.
80
+ - Native tools (`nh.scope(tools=...)`): `specification.md` documents as spec, `runtime-configuration.md` documents usage and the role split with `task_references`, `natural-blocks.md` may mention it with a "prefer binding functions" note, all others must not reference it.
81
81
  - Package name: always `nighthawk-python` in `pip install` commands.
82
82
  - When renaming a document or changing its role, update all inbound references, routing rules here, relevant `tests/docs`, and navigation metadata if applicable.
83
83
  - When a governance file under `docs/` is not meant for publication, its MkDocs handling must be explicit.
@@ -222,11 +222,9 @@ Pages in the Getting started, Patterns & verification, and Configuration nav gro
222
222
  - `prompt-example` anchors live in `natural-blocks.md` by default (`basic-binding`, `fstring-injection`, `local-function-signature`, `global-function-reference`). Exception: `carry-pattern` lives in `patterns.md` (cross-block composition). Test file: `tests/docs/test_prompt_examples.py`.
223
223
  - `for-coding-agents.md` operational examples and core doctrine are guarded by `tests/docs/test_coding_agent_examples.py`. Update the tests when changing executable guidance or non-negotiable rules.
224
224
  - When a docs change invalidates an existing test, first decide whether the docs or the test is the canonical truth for that claim, then update both sides to match.
225
- - Docs architecture regression tests (`tests/docs/test_docs_architecture.py`):
226
- - Fail on stale references to deleted/renamed docs (`guide.md`, `design.md`, `providers.md`).
227
- - Guard the canonical example relationship between `index.md` and `README.md` via fenced-code-block extraction + normalized exact match.
228
- - Guard selected canonical-owner expectations where drift is likely.
229
- - Automate `mkdocs.yml` nav entries vs `docs/` file existence as a pytest case.
230
- - Guard that obsolete canonical pages do not remain published accidentally alongside their replacements.
225
+ - `tests/docs/test_integrity.py` checks the shared README/index example, navigation targets, and explicit API member inventories.
226
+ - `tests/docs/test_links.py` builds the published site and checks internal links and anchors against rendered HTML, including absolute links to this documentation site.
227
+ - `tests/docs/test_runtime_examples.py` executes marked examples from runtime configuration, embedded execution, and verification, including against the installed wheel.
228
+ - Test current links and executable claims; do not maintain lists of obsolete API names, document paths, or exact governance prose.
231
229
  - `mkdocs build` must succeed without `--strict`. Warnings are acceptable.
232
230
  - All internal relative links must resolve.
@@ -0,0 +1,10 @@
1
+ ---
2
+ paths:
3
+ - "evals/**"
4
+ ---
5
+
6
+ # Evaluations
7
+
8
+ - Comments and docstrings: follow `.claude/rules/python.md`.
9
+ - Under `evals/promptfoo/`, follow `.claude/rules/promptfoo.md`.
10
+ - Files under `evals/*/evidence/` are dated records. Exclude them from comment cleanups and do not rewrite them.
@@ -58,7 +58,7 @@ Eval prompts are experimental copies of production code. Keep them in sync; dive
58
58
  | `evals/promptfoo/prompts/eval_default.txt` | `configuration.py:DEFAULT_STEP_SYSTEM_PROMPT_TEMPLATE` |
59
59
  | `evals/promptfoo/prompts/eval_coding_agent.txt` | No single counterpart; coding agent backends receive this prompt via `system_prompt_file` config. |
60
60
  | Suffix variants in `evals/promptfoo/provider.py` (`_build_suffix_*`) | `step_contract.py:build_step_system_prompt_suffix_fragment` |
61
- | Tool presets in `evals/promptfoo/provider.py` (`_build_tool_preset`) | `tools/registry.py` + `tools/assignment.py` |
61
+ | Tool presets in `evals/promptfoo/provider.py` (`_build_tool_preset`) | `tools/provided.py` (names and descriptions) + `tools/declarations.py` (registration) |
62
62
 
63
63
  ## Eval evidence
64
64
 
@@ -0,0 +1,40 @@
1
+ ---
2
+ paths:
3
+ - "**/*.py"
4
+ ---
5
+
6
+ # Comments and docstrings
7
+
8
+ Write a comment or docstring only for a fact that the code, names, signatures, types, specification, and tests do not convey.
9
+
10
+ ## Write
11
+
12
+ - Why a choice was made, especially an intentionally non-obvious one.
13
+ - Upstream library behavior that the code depends on or works around.
14
+ - Platform, process, or environment constraints.
15
+ - Concurrency, cancellation, ordering, and lifetime invariants.
16
+
17
+ ## Do not write
18
+
19
+ - Restatements of what the code does, including step-by-step narration.
20
+ - Section dividers or heading comments; group code with classes, modules, or name prefixes instead.
21
+ - Planning Ids, phases, or history ("used to", "now").
22
+ - Citations of specification section numbers or test file paths; tests pin specified behavior.
23
+ - Type information already present in annotations.
24
+
25
+ ## Form
26
+
27
+ - Keep each comment and docstring compact; prefer one line.
28
+ - Use semantic line breaks.
29
+
30
+ ## Text that is not a comment
31
+
32
+ The following text is consumed at runtime or serves as test data.
33
+ Change it only as a deliberate behavior change:
34
+
35
+ - Natural docstrings (`"""natural ...`).
36
+ - Docstrings of binding functions and tools, which LLMs may read.
37
+ - Docstrings of Pydantic models that enter LLM-facing JSON schemas, such as `StepFinalResult`.
38
+ - Fixture docstrings that tests assert on or expose to Natural blocks.
39
+
40
+ Tool directives (`noqa`, `type: ignore`, `pyright: ignore`) are outside these rules.
@@ -7,11 +7,19 @@ paths:
7
7
 
8
8
  - Prefer concrete code. Add a new abstraction only when the same change uses it from non-test code.
9
9
  - Default to module-private names. Export via `__all__` only for stable non-test consumers.
10
- - If a change expands or changes public API, update or confirm `tests/public/`.
10
+ - If a change expands or changes public API, update the behavior owner tests and confirm export resolution in `tests/test_public_api.py`.
11
11
  - Prefer async implementations in `runtime/` and `backends/`; keep sync bridges only at compatibility boundaries.
12
12
  - Reuse the existing `NighthawkError` hierarchy before adding a new exception class.
13
13
  - Prefer Pydantic (`BaseModel`, `TypeAdapter`) and Pydantic AI primitives over custom validation, parsing, schema, or agent/tool plumbing.
14
14
  - Use `opentelemetry.trace` spans at run/scope/step/tool boundaries and `logging.getLogger("nighthawk")` for diagnostics. Do not import `logfire` in `src/`.
15
15
  - Use PEP 695 `type` statements for new type aliases.
16
16
  - Ask before adding a new `src/` subpackage for a single module.
17
- - Follow `CONTRIBUTING.md` § Docstring Guide for docstring scope and format.
17
+
18
+ ## Comments and docstrings
19
+
20
+ Follow `.claude/rules/python.md`. Additionally:
21
+
22
+ - Public API means the objects rendered by `docs/api.md`. Follow `CONTRIBUTING.md` "Docstring Guide" for their format.
23
+ - Keep examples in `docs/`, not in docstrings.
24
+ - Write an internal docstring only for a fact the code does not convey; otherwise omit it.
25
+ - Write a module docstring only when it states a responsibility boundary that the module name does not convey.
@@ -0,0 +1,21 @@
1
+ ---
2
+ paths:
3
+ - "tests/**"
4
+ ---
5
+
6
+ # Testing (pytest)
7
+
8
+ - Prefer deterministic pytest coverage by default. Use helpers from `nighthawk.testing` before reaching for live LLM calls.
9
+ - Use `StubExecutor` from `tests/support/executors.py` only for envelope and runtime parser checks; prefer `nighthawk.testing` for normal Natural-function tests.
10
+ - Keep live-LLM tests in `tests/integration/` and behind the documented environment gates.
11
+ - For Python behavior changes, add or update pytest coverage in the same change and run `uv run pytest -q`.
12
+ - If a change affects public API or README examples, update the behavior owner tests and confirm `tests/test_public_api.py`. If it affects docs examples or anchors, confirm `tests/docs/`.
13
+ - If a change affects prompt rendering, system prompt text, suffix generation, or tool exposure behavior, follow `.claude/rules/promptfoo.md`.
14
+
15
+ ## Comments and docstrings
16
+
17
+ Follow `.claude/rules/python.md`. Additionally:
18
+
19
+ - Group tests with test classes or test name prefixes, not divider comments.
20
+ - Write a test docstring only for a non-obvious reason, such as pinned upstream behavior.
21
+ - Write a module docstring only for an operational fact that `tests/README.md` does not document.
@@ -24,7 +24,7 @@ jobs:
24
24
  persist-credentials: false
25
25
 
26
26
  # setup-uv publishes no floating major tag since v8, so pin an exact release.
27
- - uses: astral-sh/setup-uv@v10.0.1
27
+ - uses: astral-sh/setup-uv@v10.3.0
28
28
  with:
29
29
  python-version: "3.13"
30
30
  # Same dependency set and cache key as "test (3.13)". Only that job
@@ -32,16 +32,16 @@ jobs:
32
32
  save-cache: false
33
33
 
34
34
  - name: Install dependencies
35
- run: uv sync --all-extras --all-groups
35
+ run: uv sync --locked --all-extras --all-groups
36
36
 
37
37
  - name: Format check
38
- run: uv run ruff format --check .
38
+ run: uv run --no-sync ruff format --check .
39
39
 
40
40
  - name: Lint
41
- run: uv run ruff check .
41
+ run: uv run --no-sync ruff check .
42
42
 
43
43
  - name: Type check
44
- run: uv run pyright
44
+ run: uv run --no-sync pyright
45
45
 
46
46
  test:
47
47
  name: Test (Python ${{ matrix.python-version }})
@@ -49,23 +49,22 @@ jobs:
49
49
  strategy:
50
50
  fail-fast: false
51
51
  matrix:
52
- python-version: ["3.13", "3.14"]
53
- continue-on-error: ${{ matrix.python-version != '3.13' }}
52
+ python-version: ["3.13", "3.14", "3.15"]
54
53
  steps:
55
54
  - uses: actions/checkout@v7
56
55
  with:
57
56
  persist-credentials: false
58
57
 
59
58
  # Sole writer of the per-Python-version dependency cache.
60
- - uses: astral-sh/setup-uv@v10.0.1
59
+ - uses: astral-sh/setup-uv@v10.3.0
61
60
  with:
62
61
  python-version: ${{ matrix.python-version }}
63
62
 
64
63
  - name: Install dependencies
65
- run: uv sync --all-extras --all-groups
64
+ run: uv sync --locked --all-extras --all-groups
66
65
 
67
66
  - name: Run tests
68
- run: uv run pytest -q
67
+ run: uv run --no-sync pytest -q
69
68
 
70
69
  build:
71
70
  name: Build distribution
@@ -76,17 +75,26 @@ jobs:
76
75
  with:
77
76
  persist-credentials: false
78
77
 
79
- # "uv build" only resolves the build backend, so a cache entry would add
80
- # no measurable benefit while colliding with the docs workflow key.
81
- - uses: astral-sh/setup-uv@v10.0.1
78
+ # Keep packaging and its fresh installation check independent of the
79
+ # source test job's dependency cache.
80
+ - uses: astral-sh/setup-uv@v10.3.0
82
81
  with:
83
82
  enable-cache: false
84
83
 
85
84
  - name: Build sdist and wheel
86
85
  run: uv build
87
86
 
87
+ - name: Verify documented examples against the installed wheel
88
+ run: |
89
+ uv sync --locked --all-groups
90
+ uv venv "$RUNNER_TEMP/nighthawk-distribution"
91
+ uv pip install --python "$RUNNER_TEMP/nighthawk-distribution/bin/python" dist/*.whl
92
+ NIGHTHAWK_DISTRIBUTION_PYTHON="$RUNNER_TEMP/nighthawk-distribution/bin/python" \
93
+ uv run --no-sync pytest -q tests/docs/test_runtime_examples.py
94
+
88
95
  - name: Upload distribution artifacts
89
- uses: actions/upload-artifact@v6
96
+ uses: actions/upload-artifact@v7
90
97
  with:
91
98
  name: python-package-distributions
92
99
  path: dist/
100
+ if-no-files-found: error
@@ -1,4 +1,4 @@
1
- name: Deploy docs to GitHub Pages
1
+ name: Build and deploy docs to GitHub Pages
2
2
 
3
3
  on:
4
4
  push:
@@ -8,26 +8,38 @@ on:
8
8
  - "src/nighthawk/**"
9
9
  - "mkdocs.yml"
10
10
  - "pyproject.toml"
11
+ - "uv.lock"
12
+ - ".python-version"
13
+ - ".github/workflows/docs.yml"
14
+ pull_request:
15
+ branches: [main]
16
+ paths:
17
+ - "docs/**"
18
+ - "src/nighthawk/**"
19
+ - "mkdocs.yml"
20
+ - "pyproject.toml"
21
+ - "uv.lock"
22
+ - ".python-version"
11
23
  - ".github/workflows/docs.yml"
12
24
  workflow_dispatch:
13
25
 
14
26
  permissions:
15
27
  contents: read
16
- pages: write
17
- id-token: write
18
28
 
19
29
  concurrency:
20
- group: pages
21
- cancel-in-progress: false
30
+ group: pages-${{ github.event_name == 'pull_request' && github.ref || 'deployment' }}
31
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
22
32
 
23
33
  jobs:
24
34
  build:
25
35
  runs-on: ubuntu-latest
26
36
  steps:
27
37
  - uses: actions/checkout@v7
38
+ with:
39
+ persist-credentials: false
28
40
 
29
41
  # setup-uv publishes no floating major tag since v8, so pin an exact release.
30
- - uses: astral-sh/setup-uv@v10.0.1
42
+ - uses: astral-sh/setup-uv@v10.3.0
31
43
  with:
32
44
  python-version: "3.13"
33
45
  # The docs group is a subset of the cache "test (3.13)" saves under
@@ -35,18 +47,24 @@ jobs:
35
47
  save-cache: false
36
48
 
37
49
  - name: Install dependencies
38
- run: uv sync --group docs
50
+ # The default dev group supplies Ruff for API signature formatting.
51
+ run: uv sync --locked --group docs
39
52
 
40
53
  - name: Build docs
41
- run: uv run mkdocs build
54
+ run: uv run --no-sync mkdocs build
42
55
 
43
56
  - uses: actions/upload-pages-artifact@v5
57
+ if: github.event_name != 'pull_request'
44
58
  with:
45
59
  path: site
46
60
 
47
61
  deploy:
62
+ if: github.event_name != 'pull_request'
48
63
  needs: build
49
64
  runs-on: ubuntu-latest
65
+ permissions:
66
+ pages: write
67
+ id-token: write
50
68
  environment:
51
69
  name: github-pages
52
70
  url: ${{ steps.deployment.outputs.page_url }}
@@ -24,7 +24,7 @@ jobs:
24
24
  id-token: write
25
25
  steps:
26
26
  - name: Download distribution artifacts
27
- uses: actions/download-artifact@v7
27
+ uses: actions/download-artifact@v8
28
28
  with:
29
29
  name: python-package-distributions
30
30
  path: dist/
@@ -8,6 +8,7 @@ evals/promptfoo/outputs/
8
8
  evals/promptfoo/*.json
9
9
  evals/promptfoo/*.html
10
10
  evals/promptfoo/*.csv
11
+ evals/model_tools/outputs/
11
12
 
12
13
  # Byte-compiled / optimized / DLL files
13
14
  __pycache__/
@@ -224,4 +225,4 @@ marimo/_lsp/
224
225
  __marimo__/
225
226
 
226
227
  # Streamlit
227
- .streamlit/secrets.toml
228
+ .streamlit/secrets.toml
@@ -17,6 +17,8 @@
17
17
 
18
18
  ### Rules
19
19
 
20
+ - 改行 (line wrapping) は fixed column で hard-wrap しない.
21
+ - User が column 上限を明示しない限り, 文末 / clause 区切り / list item など意味の区切りでのみ改行する (semantic line break).
20
22
  - Use full words in all identifiers unless listed above.
21
23
  - Disallowed abbreviations: `ctx` -> `context`, `cfg` -> `configuration`, `repo` -> `repository`, `opts` -> `options`, `ref` -> `reference`.
22
24
  - Map/Dict: `(adjective + "_")* + key + "_to_" + value`.
@@ -33,14 +35,14 @@ A Python 3.13+ library embedding a "Natural" DSL inside Python functions, execut
33
35
 
34
36
  Natural DSL sources and included markdown are trusted, repository-managed assets. Do not wire untrusted user input into Natural blocks or template preprocessing.
35
37
 
36
- ### Repository layout
38
+ ExecPlans: write under `.agents/execplans/` only on request; follow `.agents/PLANS.md`.
37
39
 
38
- - `src/nighthawk/`: Library package.
39
- - `tests/`: Pytest suite.
40
- - `docs/`: User-facing documentation (MkDocs).
41
- - `.agents/`: `execplans/` (on request only), `PLANS.md` (format spec).
42
- - `.devcontainer/`: Devcontainer definition.
43
- - `pyproject.toml`, `uv.lock`: Metadata and locked dependencies.
40
+ ### Design references
41
+
42
+ - Read [Philosophy](docs/philosophy.md) when making architectural decisions about function composition, Python integration, agent authorship, accumulated capability, or Core responsibility.
43
+ - Read [Design drivers](docs/design-drivers.md) when using application requirements to justify Core changes or deciding which information belongs in this workspace.
44
+ - Use [Specification](docs/specification.md) for supported behavior and [Roadmap](docs/roadmap.md) for exploratory directions; application scenarios do not establish runtime guarantees.
45
+ - Treat Nighthawk-based development tooling as an application; its presence here does not make it a public library feature.
44
46
 
45
47
  ## Development workflow
46
48
 
@@ -7,6 +7,106 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.16.0]
11
+
12
+ ### Changed
13
+
14
+ - Breaking: `StepCandidate` and testing responses distinguish omitted output selection (`UNSET`, select initialized declared outputs) from an explicit complete mapping (`{}`, no writes). Added `StepRequest.snapshot_output_bindings()` for explicit Python composition. `StepResponse` and response factories use `binding_name_to_value`; keyword-expanded output arguments are removed.
15
+ - Breaking: `Raise` rejects explicit nonempty output mappings in candidates and rewrites. Standard agent executors retain automatic output selection and final validation.
16
+ - Breaking: optional executor configuration and run identifiers use `UNSET`; invalid `None`, raw configuration dictionaries, and empty run identifiers fail at entry. Environment mappings reject `None`, and `StepExecutorConfiguration.model_settings` defaults to an empty dictionary.
17
+ - `function_call_scope` now supports omission or `UNSET` for inheritance, `None` for clearing, and validated handler replacement.
18
+ - Breaking: Natural functions no longer copy parent working values into their environment. Share values through Python arguments, globals, closures, or explicit `scope(task_references=...)`; ordinary Python helpers can select references from the active environment. Removed the `parent` name source and `parent_name_to_value` from `StepEnvironment` and test-call records.
19
+ - Documented explicit working-state snapshots, scoped reference replacement and clearing, and synchronous/asynchronous host sharing examples. Updated composition examples to declare their dependencies.
20
+
21
+ ### Fixed
22
+
23
+ - Falsey nonempty mappings and configuration objects retain their explicit values; invalid scope arguments fail before model resolution.
24
+ - Nested configuration and sharing scopes preserve the active step identity so child executions retain their parent-step correlation.
25
+
26
+ ## [0.15.0]
27
+
28
+ ### Added
29
+
30
+ - Immutable `StepDefinition` declarations and synchronous/asynchronous embedded step execution use explicit host namespaces and keep validated writeback inside the ordinary lifecycle boundary.
31
+ - Shared binding inference and ordered validation expose `MISSING_ANNOTATION` and structured binding errors through `nighthawk.runtime`.
32
+
33
+ - Exact Natural definition lookup, optional whole-function call handlers, inert function model declarations, and preserving executor model resolution.
34
+
35
+ - `StepEnvironment` separates Python lexical bindings, inherited working state, scoped task references, and tracked step assignments, with source-qualified lookup and progressing discovery.
36
+ - Replaceable `ContextBuilder` presentation and shared static value inspection preserve application helper-name collisions and complete discovery continuations, including pages nested in ordinary containers.
37
+ - Common operation admission, awaited inspection, serialized execution, and completion records cover evaluation, assignment, return-expression resolution, and native tools. Failed tool argument admission retains its identity and original exception.
38
+ - Lifecycle start and operation notifications support asynchronous handlers alongside terminal delivery.
39
+ - `ExecutionReference.parent_step_execution_id` correlates joined child steps with their active parent.
40
+
41
+ ### Changed
42
+
43
+ - Breaking: `ScriptedExecutor` records and rejects unexpected invocations after its response sequence is exhausted. Supply an explicit `default_response=pass_response()` or another response when repetition is intended.
44
+
45
+ - Breaking: deterministic test responses use resolved `StepResult` values. Replace `return_response("'bug'")` with `return_response("bug")`, `return_response("result", result=42)` with `return_response(42, result=42)`, and `raise_response("failed", error_type="ValueError")` with `raise_response("failed", error_type=ValueError)`. Direct `StepResponse` construction uses `Return(value)`, `Raise(message, error_type)`, `Pass()`, `Break()`, or `Continue()` from `nighthawk.runtime`; strings are never evaluated as expressions.
46
+
47
+ - Refreshed locked dependencies, including Pydantic 2.14.1, OpenAI 3.31.0, MCP 2.3.0, and Logfire 5.2.0.
48
+ - `task_references` replaces `implicit_references`. Injection remains separate from Python module globals.
49
+ - Executors accept one `StepRequest` and return a resolved `StepCandidate`. Finalization validates all initialized declared outputs, rejects undeclared proposals, and independently validates return values. An initial `Raise` discards pending writes.
50
+ - Commit rewrites validate supplied replacements once without repeating inspection or expression effects; supplied output mappings replace the full selected mapping.
51
+ - Dotted assignment requires an ordinary Pydantic field with `validate_assignment=True`. Right-hand-side evaluation precedes live attribute traversal, and earlier effects are not rolled back on failure.
52
+ - Ordinary application and propagated validator exceptions cross model and backend boundaries unchanged. Runtime input errors and explicit Pydantic AI control signals retain their recovery paths.
53
+ - `Oversight.inspect_operation` replaces both tool-call and return-expression inspection hooks with one `OperationRequest` boundary.
54
+ - Output contracts use supported explicit annotations before initial-value inference; unresolved required annotations fail preparation rather than weakening validation.
55
+ - Lexical support is bounded to source-available functions, live defining-module globals, and existing closure cells, including declared global/nonlocal output writeback. Natural text alone does not capture an otherwise inaccessible outer variable. Parent-state inheritance covers joined child calls; deferred generated expressions and children that outlive their parent have no lifetime guarantee.
56
+ - Integrated Natural execution contracts into the specification and usage guides, with practical parent/child examples and explicit validation, inheritance, and host-delivery boundaries. The README and landing-page example now demonstrate typed output validation.
57
+ - Reframed the philosophy around AI agents building, composing, evaluating, and improving reusable capabilities through Python and Natural, with a compact statement of purpose and Core inclusion criteria.
58
+ - Expanded design drivers with capability construction and reuse scenarios, success conditions, comparisons against ordinary Python and model libraries, and evidence-based decisions about guidance, reusable libraries, simplification, or Core changes.
59
+
60
+ ### Fixed
61
+
62
+ - Embedded step type annotations resolve explicit and scoped names on Python 3.14, including nested forward references and names that shadow builtins.
63
+ - Dynamic annotation validation uses explicit `TypeForm[object]` casts at Pydantic `TypeAdapter` boundaries, restoring type-checking compatibility with Pydantic 2.14 without changing runtime validation. Declared `typing-extensions` as a direct dependency.
64
+ - Error-handling guides distinguish Natural-selected exceptions, recoverable tool errors, and finalization failures. Published handlers are executed against deterministic runtime responses.
65
+ - Tests follow environment, prompt, executor, and model-selection ownership; scope tests use current composition terminology and avoid duplicate replacement checks or fixed instrumentation names.
66
+
67
+ - `run()` and `scope()` reject invalid executor objects before changing the active execution context.
68
+ - Tool-return content projection receives an explicit rendering policy; MCP discovery content respects the caller's selected policy.
69
+ - Verification guidance captures actual model request messages instead of claiming full-prompt DEBUG logging. Published internal links and anchors are checked against the rendered MkDocs site.
70
+
71
+ - Source instrumentation retains defaults, live closure cells and globals, Python unbound-name behavior, and application names that resemble generated helpers.
72
+ - Variadic output bindings validate their tuple or dictionary elements, preserving `Annotated` constraints and unpacked collection contracts.
73
+ - Python 3.14 callable descriptions recover source annotation spelling without invoking deferred evaluators. Natural decoration preserves deferred annotations, and global-output preparation obtains deferred module contracts.
74
+ - Ordered model tool batches and coding-agent callbacks preserve per-step operation order and stop after terminal operation failure.
75
+ - Native model batches also order argument validation before each corresponding body, preventing later validators from running ahead of an earlier rejection. A scoped Pydantic AI 2.37 compatibility adapter preserves its completion strategies; the dependency range is bounded to that minor series.
76
+ - Coding-agent callbacks use the request's event loop and captured scope; process and transport failures preserve their originating exceptions.
77
+ - Interrupted asynchronous notifications and synchronous bridge shutdown wait for actual owned cleanup completion. `interruption_delivery_timeout` requests notification cancellation but no longer bounds total cleanup time, including handlers that suppress cancellation.
78
+ - Bridge startup interruption joins already launched workers, and asynchronous generator shutdown failures remain inspectable in the propagated exception chain.
79
+ - Caller interruption and notification timeouts preserve cleanup that a notification has already entered through its own cancellation.
80
+ - Synchronous bridge interruption also preserves a root task's existing cancellation cleanup, including its final effects and exception chain.
81
+ - Rejected synchronous DSL returns preserve borrowed application coroutines; only Core-created unstarted await wrappers are disposed.
82
+
83
+ ### Removed
84
+
85
+ - Unused public `ToolEvaluationError` and `ToolValidationError` classes. Handle finalization failures through `ExecutionError`, independent binding validation through `BindingValidationError`, and application exceptions by their original types; recoverable model tool failures remain structured observations.
86
+ - `scope(implicit_references=...)` and `get_implicit_references()`; use scoped task references and the active step environment.
87
+ - `Oversight.inspect_tool_call`, `Oversight.inspect_return_expression`, and the associated `ToolCall`, `ToolCallDecision`, and `ReturnExpression` types.
88
+ - `Rewrite.return_value`; replace a return through `Rewrite.outcome`.
89
+ - The executor protocol's separate program, context, binding, and control arguments and outcome/bindings tuple result; use `StepRequest` and `StepCandidate`.
90
+
91
+ ### Migration notes for hosts
92
+
93
+ These changes apply after 0.14.0; earlier release sections describe their own APIs.
94
+ The removed entry points have no compatibility aliases.
95
+
96
+ | Before | After |
97
+ | --- | --- |
98
+ | `nh.scope(implicit_references=task_name_to_value)` | `nh.scope(task_references=task_name_to_value)`; task injection no longer overrides Python globals. Omission, `UNSET`, replacement, and `Merge` keep their composition roles. |
99
+ | `nh.get_implicit_references()` | During a step, use `nh.get_step_context().environment.task_name_to_value`. Outside a step, retain the task mapping supplied by the host; there is no run-only replacement getter. |
100
+ | `inspect_tool_call(ToolCall)` / `inspect_return_expression(ReturnExpression)` | Install `inspect_operation(operation: OperationRequest)`, returning `Accept` or `Reject`, directly or asynchronously. Inspect `operation.kind` and the applicable expression/tool fields; ordinary helper calls through evaluation have kind `"evaluation"`. |
101
+ | `ToolCallDecision` | Use `Accept` or `Reject` for operation decisions; `StepCommitDecision` additionally permits `Rewrite`. |
102
+ | `Rewrite(return_value=value)` | `Rewrite(outcome=Return(value))`, importing `Return` from `nighthawk.runtime`. Use `Return(None)` for an explicit `None`, subject to the return contract. |
103
+ | `run_step(...)` / `run_step_async(...)` with separate boundary arguments and a tuple result | Accept keyword-only `request: StepRequest` and return `StepCandidate(outcome=..., binding_name_to_value=...)`. Import both types and resolved outcomes from `nighthawk.runtime`; read live values through `request.step_context.environment`. |
104
+ | An outer value mentioned only in Natural text | Pass it explicitly, establish an existing cell with a valid `nonlocal` declaration, or inject a task reference. |
105
+
106
+ Custom executors still pass through mandatory finalization.
107
+ Ordinary helper exceptions now propagate to Python; return a domain observation when an expected failure should be handled by the model.
108
+ See the [executor contract](docs/specification.md#14-step-executor), [environment boundaries](docs/specification.md#81-state-layers-python-locals-and-step-locals), and [host configuration guide](docs/runtime-configuration.md#oversight-in-scopes) for complete semantics.
109
+
10
110
  ## [0.14.0]
11
111
 
12
112
  ### Added
@@ -264,7 +364,9 @@ Invalid initial results fail before oversight; use resilience retries to recover
264
364
  - Step executor abstraction and provider integration foundation.
265
365
  - Core documentation and project scaffolding.
266
366
 
267
- [Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.14.0...HEAD
367
+ [Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.16.0...HEAD
368
+ [0.16.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.15.0...v0.16.0
369
+ [0.15.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.14.0...v0.15.0
268
370
  [0.14.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.13.0...v0.14.0
269
371
  [0.13.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.12.0...v0.13.0
270
372
  [0.12.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.11.0...v0.12.0
@@ -45,15 +45,29 @@ uv run pyright
45
45
  uv run pytest -q # quiet output
46
46
  ```
47
47
 
48
+ Test ownership and helper conventions are documented in [tests/README.md](tests/README.md).
49
+
50
+ ### Design and application evidence
51
+
52
+ Use [Philosophy](docs/philosophy.md) for design principles and [Specification](docs/specification.md) for supported runtime contracts.
53
+ [Design drivers](docs/design-drivers.md) defines which application information belongs in this workspace and how to distinguish conceptual scenarios from verified behavior.
54
+ When proposing Core changes, show the application composition that exposes the general execution need.
55
+ Nighthawk-based development checks are an application of the library; adopting a local check does not make it a public feature or a requirement for library users.
56
+
48
57
  ### Integration tests
49
58
 
50
59
  The full setup command installs the OpenAI provider development dependency.
51
- Run integration tests with your `.env` loaded:
60
+ Integration tests are opt-in; loading credentials alone does not enable them.
61
+ Run OpenAI integration tests with your `.env` loaded:
52
62
 
53
63
  ```bash
54
- set -a; source .env; set +a; uv run pytest -q
64
+ NIGHTHAWK_OPENAI_INTEGRATION_TESTS=1 uv run --env-file .env pytest -q tests/integration/
55
65
  ```
56
66
 
67
+ Add `NIGHTHAWK_OPENAI_MULTIMODAL_INTEGRATION_TESTS=1` to include the image cases.
68
+ Coding agent tests use their respective flags: `NIGHTHAWK_CODEX_INTEGRATION_TESTS=1`, `NIGHTHAWK_CLAUDE_SDK_INTEGRATION_TESTS=1`, or `NIGHTHAWK_CLAUDE_CLI_INTEGRATION_TESTS=1`.
69
+ Their executables and authentication must be available in the test environment.
70
+
57
71
  ### Trace inspection with otel-tui
58
72
 
59
73
  Nighthawk emits OpenTelemetry traces for step execution. You can inspect them
@@ -130,15 +144,10 @@ Use [Google style](https://google.github.io/styleguide/pyguide.html#38-comments-
130
144
 
131
145
  ### Scope
132
146
 
133
- Write docstrings only for public API members exported via `__all__` in `src/nighthawk/__init__.py`, plus public classes and functions in these modules:
147
+ This guide covers the public API: the objects rendered by `docs/api.md`.
134
148
 
135
- - `nighthawk.errors`
136
- - `nighthawk.configuration`
137
- - `nighthawk.backends.claude_code_sdk`
138
- - `nighthawk.backends.claude_code_cli`
139
- - `nighthawk.backends.codex`
140
-
141
- Do not write docstrings for names prefixed with `_` (module-private).
149
+ Other docstrings, including those for names prefixed with `_`, are written only for facts the code does not convey and stay compact.
150
+ See `.claude/rules/python.md` for the rules that apply to all comments and docstrings.
142
151
 
143
152
  ### Structure
144
153
 
@@ -153,7 +162,8 @@ Required. Use imperative mood ("Return ...", "Start ...", "Register ..."). Keep
153
162
  | `Args` | One or more parameters exist. Do not repeat type information already present in annotations. |
154
163
  | `Returns` / `Yields` | Return value is not `None`, or carries meaning that is not obvious from the type alone. |
155
164
  | `Raises` | The function raises exceptions that callers are expected to catch. |
156
- | `Example` | Required for decorators (`natural_function`, `tool`) and context managers (`run`, `scope`). Optional for everything else. |
165
+
166
+ Do not add an `Example` section; examples live in `docs/`.
157
167
 
158
168
  #### Classes
159
169
 
@@ -196,19 +206,7 @@ def run(
196
206
  run_id: Optional identifier for the run. If not provided, a ULID is
197
207
  generated automatically.
198
208
 
199
- Yields:
200
- None
201
-
202
209
  Raises:
203
210
  RuntimeError: If called while another run is already active.
204
-
205
- Example:
206
- ```python
207
- executor = AgentStepExecutor.from_configuration(
208
- configuration=StepExecutorConfiguration(model="openai-responses:gpt-5.6-luna"),
209
- )
210
- with nighthawk.run(executor):
211
- result = my_natural_function()
212
- ```
213
211
  """
214
212
  ```