nighthawk-python 0.13.0__tar.gz → 0.15.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.
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.claude/rules/docs.md +5 -7
- nighthawk_python-0.15.0/.claude/rules/evals.md +10 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.claude/rules/promptfoo.md +1 -1
- nighthawk_python-0.15.0/.claude/rules/python.md +40 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.claude/rules/src.md +10 -2
- nighthawk_python-0.15.0/.claude/rules/tests.md +21 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.github/workflows/ci.yml +23 -6
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.github/workflows/docs.yml +8 -2
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.github/workflows/publish.yml +1 -1
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.gitignore +2 -1
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/AGENTS.md +9 -7
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/CHANGELOG.md +110 -1
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/CONTRIBUTING.md +21 -23
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/PKG-INFO +26 -28
- nighthawk_python-0.15.0/README.md +78 -0
- nighthawk_python-0.15.0/docs/api.md +289 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/coding-agent-backends.md +6 -12
- nighthawk_python-0.15.0/docs/design-drivers.md +185 -0
- nighthawk_python-0.15.0/docs/embedded-execution.md +208 -0
- nighthawk_python-0.15.0/docs/executors.md +58 -0
- nighthawk_python-0.15.0/docs/for-coding-agents.md +255 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/index.md +15 -12
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/natural-blocks.md +67 -38
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/patterns.md +168 -42
- nighthawk_python-0.15.0/docs/philosophy.md +62 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/pydantic-ai-providers.md +5 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/quickstart.md +3 -11
- nighthawk_python-0.15.0/docs/roadmap.md +114 -0
- nighthawk_python-0.15.0/docs/runtime-configuration.md +705 -0
- nighthawk_python-0.15.0/docs/specification.md +1330 -0
- nighthawk_python-0.15.0/docs/verification.md +310 -0
- nighthawk_python-0.15.0/evals/AGENTS.md +1 -0
- nighthawk_python-0.15.0/evals/coding_agents/evidence/20260914-guide-assessment.md +100 -0
- nighthawk_python-0.15.0/evals/model_tools/README.md +215 -0
- nighthawk_python-0.15.0/evals/model_tools/__init__.py +1 -0
- nighthawk_python-0.15.0/evals/model_tools/cases.py +314 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260908-tool-design-review.md +60 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-assessment.md +121 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-configurations.json +73 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-gpt56-assessment.md +143 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-gpt56-configurations.json +92 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-gpt56-guidance.md +116 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-gpt56-main.md +137 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-gpt56-selected-traces.json +1418 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-gpt56-trials.csv +577 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-guidance.md +227 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-main.md +339 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-selected-traces.json +920 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260909-trials.csv +577 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260910-natural-composition.md +69 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260910-python-boundaries.md +18 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260911-ideal-state-audit.md +167 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260911-inspection-artifact-manifest.json +107 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260911-inspection-assessment.md +149 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260911-inspection-failure-traces.jsonl +66 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260911-inspection-study-protocol.md +113 -0
- nighthawk_python-0.15.0/evals/model_tools/evidence/20260911-inspection-trial-metrics.csv +829 -0
- nighthawk_python-0.15.0/evals/model_tools/inspection_study.py +637 -0
- nighthawk_python-0.15.0/evals/model_tools/prototype.py +389 -0
- nighthawk_python-0.15.0/evals/model_tools/report.py +100 -0
- nighthawk_python-0.15.0/evals/model_tools/run.py +302 -0
- nighthawk_python-0.15.0/evals/promptfoo/AGENTS.md +1 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/provider.py +1 -1
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/mkdocs.yml +2 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/pyproject.toml +3 -3
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/__init__.py +22 -12
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/_text_fallback.py +7 -49
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/base.py +19 -14
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/claude_code_cli.py +4 -1
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/claude_code_sdk.py +1 -1
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/codex.py +8 -1
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/mcp_boundary.py +12 -41
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/mcp_server.py +0 -9
- nighthawk_python-0.15.0/src/nighthawk/backends/process_management.py +24 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/text_projection.py +4 -25
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/tool_bridge.py +52 -55
- nighthawk_python-0.15.0/src/nighthawk/backends/tool_transport.py +88 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/configuration.py +38 -0
- nighthawk_python-0.15.0/src/nighthawk/errors.py +39 -0
- nighthawk_python-0.15.0/src/nighthawk/function_call.py +177 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/identifier_path.py +1 -13
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/json_renderer.py +76 -19
- nighthawk_python-0.15.0/src/nighthawk/lifecycle.py +148 -0
- nighthawk_python-0.15.0/src/nighthawk/natural/_names.py +23 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/natural/blocks.py +5 -36
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/natural/decorator.py +130 -141
- nighthawk_python-0.15.0/src/nighthawk/natural/definition.py +45 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/natural/transform.py +151 -107
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/oversight.py +23 -37
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/resilience/_budget.py +11 -21
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/resilience/_circuit_breaker.py +4 -25
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/resilience/_fallback.py +0 -7
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/resilience/_retry.py +0 -22
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/resilience/_timeout.py +6 -30
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/resilience/_vote.py +1 -7
- nighthawk_python-0.15.0/src/nighthawk/runtime/__init__.py +98 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/runtime/_user_content.py +23 -37
- nighthawk_python-0.15.0/src/nighthawk/runtime/annotations.py +73 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/assignment.py +145 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/async_bridge.py +198 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/bindings.py +111 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/context.py +101 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/description.py +482 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/discovery.py +122 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/embedded.py +107 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/environment.py +274 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/execution_reference.py +14 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/expression.py +93 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/inspection.py +52 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/interruption.py +18 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/model_candidate.py +49 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/notifications.py +41 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/operation_contract.py +65 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/operations.py +142 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/preparation.py +233 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/runtime/prompt.py +135 -205
- nighthawk_python-0.15.0/src/nighthawk/runtime/runner.py +568 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/runtime/scoping.py +126 -124
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/runtime/step_context.py +37 -50
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/runtime/step_contract.py +0 -3
- nighthawk_python-0.15.0/src/nighthawk/runtime/step_definition.py +41 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/runtime/step_executor.py +79 -67
- nighthawk_python-0.15.0/src/nighthawk/runtime/step_request.py +61 -0
- nighthawk_python-0.15.0/src/nighthawk/runtime/step_result.py +57 -0
- nighthawk_python-0.15.0/src/nighthawk/testing.py +196 -0
- nighthawk_python-0.15.0/src/nighthawk/tools/_admission.py +85 -0
- nighthawk_python-0.15.0/src/nighthawk/tools/_ordering.py +88 -0
- nighthawk_python-0.15.0/src/nighthawk/tools/_tool_return_content.py +50 -0
- nighthawk_python-0.15.0/src/nighthawk/tools/assignment.py +31 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/tools/contracts.py +8 -28
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/tools/declarations.py +0 -1
- nighthawk_python-0.15.0/src/nighthawk/tools/execution.py +160 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/tools/provided.py +4 -10
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/ulid.py +0 -1
- nighthawk_python-0.15.0/tests/README.md +63 -0
- nighthawk_python-0.15.0/tests/backends/test_base.py +58 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/backends/test_claude_code_cli.py +0 -5
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/backends/test_codex.py +22 -170
- nighthawk_python-0.15.0/tests/backends/test_mcp_boundary.py +753 -0
- nighthawk_python-0.15.0/tests/backends/test_process_management.py +27 -0
- nighthawk_python-0.15.0/tests/backends/test_text_fallback.py +48 -0
- nighthawk_python-0.15.0/tests/backends/test_text_projection.py +374 -0
- nighthawk_python-0.15.0/tests/backends/test_tool_bridge.py +355 -0
- nighthawk_python-0.15.0/tests/backends/test_tool_transport.py +318 -0
- nighthawk_python-0.15.0/tests/conftest.py +35 -0
- nighthawk_python-0.15.0/tests/docs/test_coding_agent_examples.py +46 -0
- nighthawk_python-0.15.0/tests/docs/test_error_examples.py +63 -0
- nighthawk_python-0.15.0/tests/docs/test_integrity.py +89 -0
- nighthawk_python-0.15.0/tests/docs/test_links.py +65 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/docs/test_prompt_examples.py +16 -27
- nighthawk_python-0.15.0/tests/docs/test_readme_example.py +63 -0
- nighthawk_python-0.15.0/tests/docs/test_runtime_examples.py +81 -0
- nighthawk_python-0.15.0/tests/evals/model_tools/test_inspection_study.py +155 -0
- nighthawk_python-0.15.0/tests/evals/model_tools/test_prototype.py +135 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/integration/skip_helpers.py +0 -2
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/integration/test_carry_pattern.py +0 -7
- nighthawk_python-0.13.0/tests/integration/test_codex_integration.py → nighthawk_python-0.15.0/tests/integration/test_codex.py +2 -0
- nighthawk_python-0.15.0/tests/integration/test_natural_composition.py +250 -0
- nighthawk_python-0.15.0/tests/integration/test_openai.py +165 -0
- nighthawk_python-0.15.0/tests/integration/test_openai_multimodal.py +170 -0
- nighthawk_python-0.15.0/tests/lifecycle/test_embedded.py +161 -0
- nighthawk_python-0.15.0/tests/lifecycle/test_notifications.py +426 -0
- nighthawk_python-0.15.0/tests/lifecycle/test_step_completion.py +590 -0
- nighthawk_python-0.15.0/tests/lifecycle/test_step_ledger.py +446 -0
- nighthawk_python-0.13.0/tests/execution/test_natural_block_ordering.py → nighthawk_python-0.15.0/tests/natural/test_block_ordering.py +28 -33
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/natural/test_blocks.py +17 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/natural/test_decorator_globals.py +24 -22
- nighthawk_python-0.15.0/tests/natural/test_deferred_annotations.py +131 -0
- nighthawk_python-0.15.0/tests/natural/test_function_definition.py +73 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/natural/test_introspection.py +5 -4
- nighthawk_python-0.15.0/tests/natural/test_lexical_contract.py +220 -0
- nighthawk_python-0.15.0/tests/natural/test_methods.py +191 -0
- nighthawk_python-0.15.0/tests/natural/test_runtime_name_hygiene.py +126 -0
- nighthawk_python-0.13.0/tests/execution/test_natural_traceback.py → nighthawk_python-0.15.0/tests/natural/test_traceback.py +10 -13
- nighthawk_python-0.15.0/tests/natural/test_variadic_contracts.py +118 -0
- nighthawk_python-0.15.0/tests/oversight/test_embedded_commit.py +61 -0
- nighthawk_python-0.15.0/tests/oversight/test_return_expression.py +197 -0
- nighthawk_python-0.13.0/tests/governance/test_governance.py → nighthawk_python-0.15.0/tests/oversight/test_step_commit.py +250 -46
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/resilience/test_budget.py +2 -67
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/resilience/test_circuit_breaker.py +1 -30
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/resilience/test_composition.py +4 -25
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/resilience/test_fallback.py +2 -12
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/resilience/test_retry.py +1 -30
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/resilience/test_timeout.py +1 -26
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/resilience/test_vote.py +0 -18
- nighthawk_python-0.15.0/tests/runtime/__init__.py +0 -0
- nighthawk_python-0.15.0/tests/runtime/test_assignment.py +219 -0
- nighthawk_python-0.15.0/tests/runtime/test_async_bridge.py +373 -0
- nighthawk_python-0.15.0/tests/runtime/test_bindings.py +99 -0
- {nighthawk_python-0.13.0/tests/execution → nighthawk_python-0.15.0/tests/runtime}/test_capabilities.py +7 -3
- nighthawk_python-0.15.0/tests/runtime/test_context.py +181 -0
- nighthawk_python-0.15.0/tests/runtime/test_description.py +215 -0
- nighthawk_python-0.15.0/tests/runtime/test_discovery.py +162 -0
- nighthawk_python-0.15.0/tests/runtime/test_embedded.py +218 -0
- nighthawk_python-0.15.0/tests/runtime/test_environment.py +192 -0
- nighthawk_python-0.15.0/tests/runtime/test_executor_contract.py +277 -0
- nighthawk_python-0.15.0/tests/runtime/test_expression.py +161 -0
- {nighthawk_python-0.13.0/tests/execution → nighthawk_python-0.15.0/tests/runtime}/test_managed_model.py +12 -5
- nighthawk_python-0.15.0/tests/runtime/test_model_candidate.py +174 -0
- nighthawk_python-0.15.0/tests/runtime/test_model_operation_failures.py +121 -0
- nighthawk_python-0.15.0/tests/runtime/test_model_selection.py +256 -0
- nighthawk_python-0.15.0/tests/runtime/test_operations.py +335 -0
- nighthawk_python-0.15.0/tests/runtime/test_preparation.py +323 -0
- nighthawk_python-0.13.0/tests/execution/test_globals_prompt.py → nighthawk_python-0.15.0/tests/runtime/test_prompt_globals.py +5 -7
- nighthawk_python-0.15.0/tests/runtime/test_prompt_multimodal.py +519 -0
- nighthawk_python-0.15.0/tests/runtime/test_prompt_system.py +45 -0
- nighthawk_python-0.13.0/tests/execution/test_variables_prompt.py → nighthawk_python-0.15.0/tests/runtime/test_prompt_values.py +28 -517
- nighthawk_python-0.15.0/tests/runtime/test_request_observation.py +163 -0
- nighthawk_python-0.15.0/tests/runtime/test_runner.py +350 -0
- nighthawk_python-0.13.0/tests/public/test_composition.py → nighthawk_python-0.15.0/tests/runtime/test_scope_composition.py +43 -42
- nighthawk_python-0.15.0/tests/runtime/test_scoping.py +250 -0
- nighthawk_python-0.13.0/tests/execution/test_execution_outcome_prompt_fragment.py → nighthawk_python-0.15.0/tests/runtime/test_step_contract.py +0 -3
- nighthawk_python-0.15.0/tests/runtime/test_step_definition.py +87 -0
- nighthawk_python-0.15.0/tests/runtime/test_step_executor.py +265 -0
- nighthawk_python-0.15.0/tests/runtime/test_tracing.py +297 -0
- {nighthawk_python-0.13.0/tests/public → nighthawk_python-0.15.0/tests/runtime}/test_usage_meter.py +2 -23
- nighthawk_python-0.13.0/tests/docs/test_coding_agent_examples.py → nighthawk_python-0.15.0/tests/runtime/test_workflows.py +1 -19
- nighthawk_python-0.15.0/tests/support/__init__.py +0 -0
- nighthawk_python-0.15.0/tests/support/codex.py +109 -0
- nighthawk_python-0.15.0/tests/support/contexts.py +14 -0
- nighthawk_python-0.15.0/tests/support/executors.py +88 -0
- nighthawk_python-0.15.0/tests/support/host_controls.py +159 -0
- nighthawk_python-0.13.0/tests/execution/prompt_test_helpers.py → nighthawk_python-0.15.0/tests/support/prompts.py +5 -10
- nighthawk_python-0.15.0/tests/support/tools.py +47 -0
- nighthawk_python-0.15.0/tests/support/values.py +3 -0
- nighthawk_python-0.15.0/tests/test_composition.py +32 -0
- nighthawk_python-0.13.0/tests/public/test_model_configuration.py → nighthawk_python-0.15.0/tests/test_configuration.py +17 -5
- nighthawk_python-0.15.0/tests/test_function_call.py +287 -0
- nighthawk_python-0.15.0/tests/test_public_api.py +12 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/test_testing.py +82 -50
- nighthawk_python-0.15.0/tests/tools/__init__.py +0 -0
- nighthawk_python-0.15.0/tests/tools/test_admission.py +222 -0
- nighthawk_python-0.15.0/tests/tools/test_assignment_async.py +122 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/tools/test_contracts.py +28 -0
- nighthawk_python-0.15.0/tests/tools/test_coroutine_ownership.py +30 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/tools/test_declarations.py +14 -57
- nighthawk_python-0.15.0/tests/tools/test_discovery_content.py +166 -0
- nighthawk_python-0.15.0/tests/tools/test_execution.py +379 -0
- nighthawk_python-0.15.0/tests/tools/test_ordering.py +183 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/tools/test_provided_async.py +8 -13
- nighthawk_python-0.15.0/tests/tools/test_tool_return_content.py +67 -0
- nighthawk_python-0.15.0/uv.lock +1995 -0
- nighthawk_python-0.13.0/.claude/rules/tests.md +0 -13
- nighthawk_python-0.13.0/README.md +0 -80
- nighthawk_python-0.13.0/docs/api.md +0 -157
- nighthawk_python-0.13.0/docs/executors.md +0 -72
- nighthawk_python-0.13.0/docs/for-coding-agents.md +0 -405
- nighthawk_python-0.13.0/docs/philosophy.md +0 -198
- nighthawk_python-0.13.0/docs/roadmap.md +0 -126
- nighthawk_python-0.13.0/docs/runtime-configuration.md +0 -355
- nighthawk_python-0.13.0/docs/specification.md +0 -850
- nighthawk_python-0.13.0/docs/verification.md +0 -272
- nighthawk_python-0.13.0/src/nighthawk/errors.py +0 -33
- nighthawk_python-0.13.0/src/nighthawk/runtime/async_bridge.py +0 -50
- nighthawk_python-0.13.0/src/nighthawk/runtime/runner.py +0 -762
- nighthawk_python-0.13.0/src/nighthawk/runtime/step_result.py +0 -49
- nighthawk_python-0.13.0/src/nighthawk/testing.py +0 -214
- nighthawk_python-0.13.0/src/nighthawk/tools/_tool_return_content.py +0 -66
- nighthawk_python-0.13.0/src/nighthawk/tools/assignment.py +0 -265
- nighthawk_python-0.13.0/src/nighthawk/tools/execution.py +0 -239
- nighthawk_python-0.13.0/tests/conftest.py +0 -32
- nighthawk_python-0.13.0/tests/docs/test_docs_architecture.py +0 -246
- nighthawk_python-0.13.0/tests/execution/stub_executor.py +0 -69
- nighthawk_python-0.13.0/tests/execution/test_infer_binding_types.py +0 -91
- nighthawk_python-0.13.0/tests/execution/test_runtime.py +0 -1016
- nighthawk_python-0.13.0/tests/governance/test_step_results.py +0 -301
- nighthawk_python-0.13.0/tests/integration/test_llm_integration.py +0 -382
- nighthawk_python-0.13.0/tests/public/test_public_api.py +0 -720
- nighthawk_python-0.13.0/tests/public/test_readme_example.py +0 -18
- nighthawk_python-0.13.0/tests/tools/test_assignment_async.py +0 -306
- nighthawk_python-0.13.0/tests/tools/test_multimodal_helpers.py +0 -167
- nighthawk_python-0.13.0/tests/tools/test_tool_boundary.py +0 -1897
- nighthawk_python-0.13.0/uv.lock +0 -1726
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.claude/settings.json +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.claude/unset_envs.sh +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.devcontainer/devcontainer-lock.json +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.devcontainer/devcontainer.json +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.devcontainer/postCreateCommand.sh +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.github/dependabot.yml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/.python-version +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/CLAUDE.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/LICENSE +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/AGENTS.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/docs/assets/nighthawk_logo-128x128.png +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/assertions/__init__.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/assertions/binding_value.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/assertions/outcome_kind.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/assertions/raise_message.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/evidence/2026-03-26-baseline-prompt-ab.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/evidence/2026-03-26-baseline-regression.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/evidence/2026-03-26-baseline-suffix-ab.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/evidence/2026-04-27-runtime-prompt-optimization.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/promptfooconfig-agents.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/promptfooconfig-luna-sanity.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/promptfooconfig-prompt-ab.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/promptfooconfig-suffix-ab.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/promptfooconfig.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/prompts/eval_coding_agent.txt +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/prompts/eval_default.txt +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/prompts/eval_legacy_default.txt +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/prompts/eval_mutation_aware.txt +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/prompts/eval_sequenced.txt +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/research-result.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/binding_operations.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/edge_cases.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/loop_outcomes.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/loop_outcomes_ja.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/multi_step.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/null_handling.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/outcome_kinds.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/evals/promptfoo/test_cases/tool_selection.yaml +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/pyrightconfig.json +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/AGENTS.md +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/__init__.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/backends/claude_code_settings.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/composition.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/natural/__init__.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/resilience/__init__.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/src/nighthawk/runtime/tool_calls.py +0 -0
- {nighthawk_python-0.13.0/src/nighthawk/runtime → nighthawk_python-0.15.0/src/nighthawk/tools}/__init__.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/AGENTS.md +0 -0
- {nighthawk_python-0.13.0/src/nighthawk/tools → nighthawk_python-0.15.0/tests}/__init__.py +0 -0
- {nighthawk_python-0.13.0/tests → nighthawk_python-0.15.0/tests/backends}/__init__.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/backends/test_claude_code_sdk.py +0 -0
- {nighthawk_python-0.13.0/tests/backends → nighthawk_python-0.15.0/tests/docs}/__init__.py +0 -0
- {nighthawk_python-0.13.0/tests/docs → nighthawk_python-0.15.0/tests/evals}/__init__.py +0 -0
- {nighthawk_python-0.13.0/tests/execution → nighthawk_python-0.15.0/tests/evals/model_tools}/__init__.py +0 -0
- {nighthawk_python-0.13.0 → nighthawk_python-0.15.0}/tests/integration/__init__.py +0 -0
- /nighthawk_python-0.13.0/tests/integration/test_claude_code_cli_integration.py → /nighthawk_python-0.15.0/tests/integration/test_claude_code_cli.py +0 -0
- /nighthawk_python-0.13.0/tests/integration/test_claude_code_sdk_integration.py → /nighthawk_python-0.15.0/tests/integration/test_claude_code_sdk.py +0 -0
- {nighthawk_python-0.13.0/tests/natural → nighthawk_python-0.15.0/tests/lifecycle}/__init__.py +0 -0
- {nighthawk_python-0.13.0/tests/public → nighthawk_python-0.15.0/tests/natural}/__init__.py +0 -0
- {nighthawk_python-0.13.0/tests/resilience → nighthawk_python-0.15.0/tests/oversight}/__init__.py +0 -0
- {nighthawk_python-0.13.0/tests/tools → nighthawk_python-0.15.0/tests/resilience}/__init__.py +0 -0
- /nighthawk_python-0.13.0/tests/test_renderer.py → /nighthawk_python-0.15.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 `
|
|
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
|
-
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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/
|
|
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
|
|
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
|
-
|
|
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.
|
|
@@ -19,13 +19,17 @@ jobs:
|
|
|
19
19
|
name: Lint and type check
|
|
20
20
|
runs-on: ubuntu-latest
|
|
21
21
|
steps:
|
|
22
|
-
- uses: actions/checkout@
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
23
|
with:
|
|
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
28
|
with:
|
|
28
29
|
python-version: "3.13"
|
|
30
|
+
# Same dependency set and cache key as "test (3.13)". Only that job
|
|
31
|
+
# saves the entry; concurrent writers race to reserve the same key.
|
|
32
|
+
save-cache: false
|
|
29
33
|
|
|
30
34
|
- name: Install dependencies
|
|
31
35
|
run: uv sync --all-extras --all-groups
|
|
@@ -48,11 +52,12 @@ jobs:
|
|
|
48
52
|
python-version: ["3.13", "3.14"]
|
|
49
53
|
continue-on-error: ${{ matrix.python-version != '3.13' }}
|
|
50
54
|
steps:
|
|
51
|
-
- uses: actions/checkout@
|
|
55
|
+
- uses: actions/checkout@v7
|
|
52
56
|
with:
|
|
53
57
|
persist-credentials: false
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
# Sole writer of the per-Python-version dependency cache.
|
|
60
|
+
- uses: astral-sh/setup-uv@v10.0.1
|
|
56
61
|
with:
|
|
57
62
|
python-version: ${{ matrix.python-version }}
|
|
58
63
|
|
|
@@ -67,15 +72,27 @@ jobs:
|
|
|
67
72
|
needs: [lint, test]
|
|
68
73
|
runs-on: ubuntu-latest
|
|
69
74
|
steps:
|
|
70
|
-
- uses: actions/checkout@
|
|
75
|
+
- uses: actions/checkout@v7
|
|
71
76
|
with:
|
|
72
77
|
persist-credentials: false
|
|
73
78
|
|
|
74
|
-
|
|
79
|
+
# Keep packaging and its fresh installation check independent of the
|
|
80
|
+
# source test job's dependency cache.
|
|
81
|
+
- uses: astral-sh/setup-uv@v10.0.1
|
|
82
|
+
with:
|
|
83
|
+
enable-cache: false
|
|
75
84
|
|
|
76
85
|
- name: Build sdist and wheel
|
|
77
86
|
run: uv build
|
|
78
87
|
|
|
88
|
+
- name: Verify documented examples against the installed wheel
|
|
89
|
+
run: |
|
|
90
|
+
uv sync --all-groups
|
|
91
|
+
uv venv "$RUNNER_TEMP/nighthawk-distribution"
|
|
92
|
+
uv pip install --python "$RUNNER_TEMP/nighthawk-distribution/bin/python" dist/*.whl
|
|
93
|
+
NIGHTHAWK_DISTRIBUTION_PYTHON="$RUNNER_TEMP/nighthawk-distribution/bin/python" \
|
|
94
|
+
uv run pytest -q tests/docs/test_runtime_examples.py
|
|
95
|
+
|
|
79
96
|
- name: Upload distribution artifacts
|
|
80
97
|
uses: actions/upload-artifact@v6
|
|
81
98
|
with:
|
|
@@ -24,9 +24,15 @@ jobs:
|
|
|
24
24
|
build:
|
|
25
25
|
runs-on: ubuntu-latest
|
|
26
26
|
steps:
|
|
27
|
-
- uses: actions/checkout@
|
|
27
|
+
- uses: actions/checkout@v7
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
# setup-uv publishes no floating major tag since v8, so pin an exact release.
|
|
30
|
+
- uses: astral-sh/setup-uv@v10.0.1
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.13"
|
|
33
|
+
# The docs group is a subset of the cache "test (3.13)" saves under
|
|
34
|
+
# this key, so restore it here but never overwrite it.
|
|
35
|
+
save-cache: false
|
|
30
36
|
|
|
31
37
|
- name: Install dependencies
|
|
32
38
|
run: uv sync --group docs
|
|
@@ -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
|
-
|
|
38
|
+
ExecPlans: write under `.agents/execplans/` only on request; follow `.agents/PLANS.md`.
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
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,113 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.15.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Immutable `StepDefinition` declarations and synchronous/asynchronous embedded step execution use explicit host namespaces and keep validated writeback inside the ordinary lifecycle boundary.
|
|
15
|
+
- Shared binding inference and ordered validation expose `MISSING_ANNOTATION` and structured binding errors through `nighthawk.runtime`.
|
|
16
|
+
|
|
17
|
+
- Exact Natural definition lookup, optional whole-function call handlers, inert function model declarations, and preserving executor model resolution.
|
|
18
|
+
|
|
19
|
+
- `StepEnvironment` separates Python lexical bindings, inherited working state, scoped task references, and tracked step assignments, with source-qualified lookup and progressing discovery.
|
|
20
|
+
- Replaceable `ContextBuilder` presentation and shared static value inspection preserve application helper-name collisions and complete discovery continuations, including pages nested in ordinary containers.
|
|
21
|
+
- 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.
|
|
22
|
+
- Lifecycle start and operation notifications support asynchronous handlers alongside terminal delivery.
|
|
23
|
+
- `ExecutionReference.parent_step_execution_id` correlates joined child steps with their active parent.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- 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.
|
|
28
|
+
|
|
29
|
+
- 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.
|
|
30
|
+
|
|
31
|
+
- Refreshed locked dependencies, including Pydantic 2.14.1, OpenAI 3.31.0, MCP 2.3.0, and Logfire 5.2.0.
|
|
32
|
+
- `task_references` replaces `implicit_references`. Injection remains separate from Python module globals.
|
|
33
|
+
- 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.
|
|
34
|
+
- Commit rewrites validate supplied replacements once without repeating inspection or expression effects; supplied output mappings replace the full selected mapping.
|
|
35
|
+
- 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.
|
|
36
|
+
- 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.
|
|
37
|
+
- `Oversight.inspect_operation` replaces both tool-call and return-expression inspection hooks with one `OperationRequest` boundary.
|
|
38
|
+
- Output contracts use supported explicit annotations before initial-value inference; unresolved required annotations fail preparation rather than weakening validation.
|
|
39
|
+
- 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.
|
|
40
|
+
- 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.
|
|
41
|
+
- 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.
|
|
42
|
+
- 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.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- 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.
|
|
47
|
+
- Error-handling guides distinguish Natural-selected exceptions, recoverable tool errors, and finalization failures. Published handlers are executed against deterministic runtime responses.
|
|
48
|
+
- Tests follow environment, prompt, executor, and model-selection ownership; scope tests use current composition terminology and avoid duplicate replacement checks or fixed instrumentation names.
|
|
49
|
+
|
|
50
|
+
- `run()` and `scope()` reject invalid executor objects before changing the active execution context.
|
|
51
|
+
- Tool-return content projection receives an explicit rendering policy; MCP discovery content respects the caller's selected policy.
|
|
52
|
+
- 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.
|
|
53
|
+
|
|
54
|
+
- Source instrumentation retains defaults, live closure cells and globals, Python unbound-name behavior, and application names that resemble generated helpers.
|
|
55
|
+
- Variadic output bindings validate their tuple or dictionary elements, preserving `Annotated` constraints and unpacked collection contracts.
|
|
56
|
+
- 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.
|
|
57
|
+
- Ordered model tool batches and coding-agent callbacks preserve per-step operation order and stop after terminal operation failure.
|
|
58
|
+
- 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.
|
|
59
|
+
- Coding-agent callbacks use the request's event loop and captured scope; process and transport failures preserve their originating exceptions.
|
|
60
|
+
- 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.
|
|
61
|
+
- Bridge startup interruption joins already launched workers, and asynchronous generator shutdown failures remain inspectable in the propagated exception chain.
|
|
62
|
+
- Caller interruption and notification timeouts preserve cleanup that a notification has already entered through its own cancellation.
|
|
63
|
+
- Synchronous bridge interruption also preserves a root task's existing cancellation cleanup, including its final effects and exception chain.
|
|
64
|
+
- Rejected synchronous DSL returns preserve borrowed application coroutines; only Core-created unstarted await wrappers are disposed.
|
|
65
|
+
|
|
66
|
+
### Removed
|
|
67
|
+
|
|
68
|
+
- 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.
|
|
69
|
+
- `scope(implicit_references=...)` and `get_implicit_references()`; use scoped task references and the active step environment.
|
|
70
|
+
- `Oversight.inspect_tool_call`, `Oversight.inspect_return_expression`, and the associated `ToolCall`, `ToolCallDecision`, and `ReturnExpression` types.
|
|
71
|
+
- `Rewrite.return_value`; replace a return through `Rewrite.outcome`.
|
|
72
|
+
- The executor protocol's separate program, context, binding, and control arguments and outcome/bindings tuple result; use `StepRequest` and `StepCandidate`.
|
|
73
|
+
|
|
74
|
+
### Migration notes for hosts
|
|
75
|
+
|
|
76
|
+
These changes apply after 0.14.0; earlier release sections describe their own APIs.
|
|
77
|
+
The removed entry points have no compatibility aliases.
|
|
78
|
+
|
|
79
|
+
| Before | After |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `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. |
|
|
82
|
+
| `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. |
|
|
83
|
+
| `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"`. |
|
|
84
|
+
| `ToolCallDecision` | Use `Accept` or `Reject` for operation decisions; `StepCommitDecision` additionally permits `Rewrite`. |
|
|
85
|
+
| `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. |
|
|
86
|
+
| `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`. |
|
|
87
|
+
| 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. |
|
|
88
|
+
|
|
89
|
+
Custom executors still pass through mandatory finalization.
|
|
90
|
+
Ordinary helper exceptions now propagate to Python; return a domain observation when an expected failure should be handled by the model.
|
|
91
|
+
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.
|
|
92
|
+
|
|
93
|
+
## [0.14.0]
|
|
94
|
+
|
|
95
|
+
### Added
|
|
96
|
+
|
|
97
|
+
- Scoped `nh.lifecycle.StepLifecycle` delivers typed completion, DSL raise, failure, or interruption records after generated caller assignments. Hosts can record one terminal event and translate failures with explicit exception chaining.
|
|
98
|
+
- `Oversight.inspect_return_expression` approves expressions before core evaluation, await, and return validation.
|
|
99
|
+
- `StepDeliveryError` supports host storage adapters without claiming persistence succeeded.
|
|
100
|
+
|
|
101
|
+
### Changed
|
|
102
|
+
|
|
103
|
+
- `ExecutionReference` and `get_execution_reference` replace the abbreviated identity API. `step_execution_id` identifies each invocation; `source_location` identifies its source. StepContext, inspection, testing observations, terminal records, and spans share this identity.
|
|
104
|
+
- Runtime internal exceptions, including preparation and await failures, now propagate through `ExecutionError.step_failed` with the original exception as cause. Rejection is a classified failure. DSL exceptions remain distinct.
|
|
105
|
+
- Completion tracing follows actual caller assignments. Cancellation retains priority if terminal delivery fails. Delivery errors never retry execution or undo effects.
|
|
106
|
+
- Natural functions preserve original closure cells for nonlocal assignments and source locations for generated execution.
|
|
107
|
+
|
|
108
|
+
### Fixed
|
|
109
|
+
|
|
110
|
+
- Lifecycle handlers can rethrow an already-recorded host exception or interruption without replacing its original cause with a self-reference.
|
|
111
|
+
- Host integration guidance distinguishes one delivery attempt from ledger deduplication and explains the validation, await, and rewrite limits of name-only return approval.
|
|
112
|
+
|
|
113
|
+
### Removed
|
|
114
|
+
|
|
115
|
+
- `ExecutionRef`, `get_execution_ref`, and `step_id`, without compatibility aliases. Span attributes use `step.execution.id` and `step.source_location`.
|
|
116
|
+
|
|
10
117
|
## [0.13.0]
|
|
11
118
|
|
|
12
119
|
### Added
|
|
@@ -240,7 +347,9 @@ Invalid initial results fail before oversight; use resilience retries to recover
|
|
|
240
347
|
- Step executor abstraction and provider integration foundation.
|
|
241
348
|
- Core documentation and project scaffolding.
|
|
242
349
|
|
|
243
|
-
[Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.
|
|
350
|
+
[Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.15.0...HEAD
|
|
351
|
+
[0.15.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.14.0...v0.15.0
|
|
352
|
+
[0.14.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.13.0...v0.14.0
|
|
244
353
|
[0.13.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.12.0...v0.13.0
|
|
245
354
|
[0.12.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.11.0...v0.12.0
|
|
246
355
|
[0.11.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.10.0...v0.11.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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
147
|
+
This guide covers the public API: the objects rendered by `docs/api.md`.
|
|
134
148
|
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
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
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: nighthawk-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: A Python library where Python controls flow and LLMs or coding agents reason within constrained Natural blocks.
|
|
5
5
|
Project-URL: Repository, https://github.com/kurusugawa-computer/nighthawk-python
|
|
6
6
|
Project-URL: Documentation, https://kurusugawa-computer.github.io/nighthawk-python/
|
|
@@ -20,7 +20,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
20
20
|
Classifier: Typing :: Typed
|
|
21
21
|
Requires-Python: >=3.13
|
|
22
22
|
Requires-Dist: headson>=0.16.1
|
|
23
|
-
Requires-Dist: pydantic-ai-slim
|
|
23
|
+
Requires-Dist: pydantic-ai-slim<2.38,>=2.37.0
|
|
24
24
|
Requires-Dist: pydantic>=2.13.3
|
|
25
25
|
Requires-Dist: pyyaml>=6.0.3
|
|
26
26
|
Requires-Dist: tenacity>=9.1.4
|
|
@@ -44,14 +44,11 @@ Description-Content-Type: text/markdown
|
|
|
44
44
|
<img src="https://github.com/kurusugawa-computer/nighthawk-python/raw/main/docs/assets/nighthawk_logo-128x128.png" alt="nighthawk-logo" width="128px" margin="10px"></img>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
Nighthawk is a Python library
|
|
47
|
+
Nighthawk is a Python library that makes natural-language judgment composable with ordinary Python functions.
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
The same mechanism handles lightweight LLM judgments ("classify this sentiment") and autonomous agent executions ("refactor this module and write tests"). See **[Philosophy](https://kurusugawa-computer.github.io/nighthawk-python/philosophy/)** for the full design rationale.
|
|
53
|
-
|
|
54
|
-
This repository is a compact reimplementation of the core ideas of [Nightjar](https://github.com/psg-mit/nightjarpy).
|
|
49
|
+
Use Natural blocks for interpretation, classification, and other judgments; combine actions, constraints, and verification through Python functions and existing libraries.
|
|
50
|
+
Python owns the surrounding control flow, state, and recovery.
|
|
51
|
+
The same typed boundaries support provider-backed LLM calls and coding-agent executions.
|
|
55
52
|
|
|
56
53
|
## Installation
|
|
57
54
|
|
|
@@ -69,7 +66,7 @@ For other providers, see [Pydantic AI providers](https://kurusugawa-computer.git
|
|
|
69
66
|
import nighthawk as nh
|
|
70
67
|
|
|
71
68
|
|
|
72
|
-
def python_average(numbers):
|
|
69
|
+
def python_average(numbers: list[float]) -> float:
|
|
73
70
|
return sum(numbers) / len(numbers)
|
|
74
71
|
|
|
75
72
|
|
|
@@ -78,38 +75,39 @@ step_executor = nh.AgentStepExecutor.from_configuration(configuration=nh.StepExe
|
|
|
78
75
|
with nh.run(step_executor):
|
|
79
76
|
|
|
80
77
|
@nh.natural_function
|
|
81
|
-
def calculate_average(numbers):
|
|
78
|
+
def calculate_average(numbers: list[object]) -> float:
|
|
79
|
+
result: float = 0.0
|
|
82
80
|
"""natural
|
|
83
81
|
Map each element of <numbers> to the number it represents,
|
|
84
82
|
then compute <:result> by calling <python_average> with the mapped list.
|
|
85
83
|
"""
|
|
86
84
|
return result
|
|
87
85
|
|
|
88
|
-
calculate_average([1, "2", "three", "cuatro"]) # 2.5
|
|
86
|
+
print(calculate_average([1, "2", "three", "cuatro"])) # 2.5
|
|
89
87
|
```
|
|
90
88
|
|
|
89
|
+
Natural interprets the mixed representations, `python_average` performs the deterministic calculation, and the output binding validates `result` as a `float` before Python resumes.
|
|
90
|
+
Type validation constrains the result's shape; it does not prove the interpretation is correct.
|
|
91
|
+
|
|
91
92
|
See the **[Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/)** for setup details, credentials, and troubleshooting.
|
|
92
93
|
|
|
94
|
+
## Embedding in an application
|
|
95
|
+
|
|
96
|
+
Hosts can admit whole function calls, select models without losing scoped controls, and observe block outcomes and model usage.
|
|
97
|
+
See [Runtime configuration](https://kurusugawa-computer.github.io/nighthawk-python/runtime-configuration/) for usage and [execution boundaries](https://kurusugawa-computer.github.io/nighthawk-python/specification/#embedded-execution-boundaries) for the guarantees.
|
|
98
|
+
The [runtime configuration guide](https://kurusugawa-computer.github.io/nighthawk-python/runtime-configuration/#whole-function-admission) includes executable host-integration examples that run without credentials.
|
|
99
|
+
|
|
93
100
|
## Documentation
|
|
94
101
|
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
- **[Pydantic AI providers](https://kurusugawa-computer.github.io/nighthawk-python/pydantic-ai-providers/)** -- LLM provider configuration.
|
|
102
|
-
- **[Coding agent backends](https://kurusugawa-computer.github.io/nighthawk-python/coding-agent-backends/)** -- Claude Code and Codex integration.
|
|
103
|
-
- **[Specification](https://kurusugawa-computer.github.io/nighthawk-python/specification/)** -- Canonical specification.
|
|
104
|
-
- **[API Reference](https://kurusugawa-computer.github.io/nighthawk-python/api/)** -- Auto-generated API documentation.
|
|
105
|
-
- **[For coding agents](https://kurusugawa-computer.github.io/nighthawk-python/for-coding-agents/)** -- Development guide for coding agents (LLMs) building Python projects with Nighthawk.
|
|
106
|
-
- **[Philosophy](https://kurusugawa-computer.github.io/nighthawk-python/philosophy/)** -- Design rationale and positioning.
|
|
107
|
-
- **[Roadmap](https://kurusugawa-computer.github.io/nighthawk-python/roadmap/)** -- Future directions.
|
|
102
|
+
- [Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/) -- Install and run a Natural function.
|
|
103
|
+
- [Natural blocks](https://kurusugawa-computer.github.io/nighthawk-python/natural-blocks/) -- Design prompts, bindings, and Python helpers.
|
|
104
|
+
- [Patterns](https://kurusugawa-computer.github.io/nighthawk-python/patterns/) and [Verification](https://kurusugawa-computer.github.io/nighthawk-python/verification/) -- Compose, test, and debug workflows.
|
|
105
|
+
- [Specification](https://kurusugawa-computer.github.io/nighthawk-python/specification/) and [API reference](https://kurusugawa-computer.github.io/nighthawk-python/api/) -- Runtime contracts and public interfaces.
|
|
106
|
+
- [For coding agents](https://kurusugawa-computer.github.io/nighthawk-python/for-coding-agents/) -- A compact operational guide.
|
|
107
|
+
- [Philosophy](https://kurusugawa-computer.github.io/nighthawk-python/philosophy/) and [Design drivers](https://kurusugawa-computer.github.io/nighthawk-python/design-drivers/) -- Principles, application needs, and Core responsibility.
|
|
108
108
|
|
|
109
109
|
## Development & Contributing
|
|
110
110
|
|
|
111
111
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, development commands, and contribution guidelines.
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- Nightjar (upstream concept): https://github.com/psg-mit/nightjarpy
|
|
113
|
+
Inspired by [Nightjar](https://github.com/psg-mit/nightjarpy).
|