nighthawk-python 0.5.0__tar.gz → 0.6.1__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.6.1/.claude/rules/docs.md +232 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.github/workflows/docs.yml +1 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/AGENTS.md +6 -3
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/CHANGELOG.md +25 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/PKG-INFO +25 -18
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/README.md +23 -17
- nighthawk_python-0.6.1/docs/AGENTS.md +1 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/docs/api.md +31 -4
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/docs/coding-agent-backends.md +117 -74
- nighthawk_python-0.6.1/docs/executors.md +72 -0
- nighthawk_python-0.6.1/docs/for-coding-agents.md +389 -0
- nighthawk_python-0.6.1/docs/index.md +69 -0
- nighthawk_python-0.6.1/docs/natural-blocks.md +472 -0
- nighthawk_python-0.6.1/docs/patterns.md +480 -0
- nighthawk_python-0.6.1/docs/philosophy.ja.md +172 -0
- nighthawk_python-0.6.1/docs/philosophy.md +172 -0
- nighthawk_python-0.6.1/docs/pydantic-ai-providers.md +103 -0
- nighthawk_python-0.6.1/docs/quickstart.md +73 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/docs/roadmap.md +67 -9
- nighthawk_python-0.6.1/docs/runtime-configuration.md +100 -0
- nighthawk_python-0.5.0/docs/design.md → nighthawk_python-0.6.1/docs/specification.md +95 -18
- nighthawk_python-0.6.1/docs/verification.md +255 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/provider.py +2 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/mkdocs.yml +20 -13
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/pyproject.toml +2 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/base.py +35 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/claude_code_cli.py +14 -53
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/claude_code_sdk.py +11 -47
- nighthawk_python-0.6.1/src/nighthawk/backends/claude_code_settings.py +33 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/codex.py +13 -37
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/natural/decorator.py +1 -2
- nighthawk_python-0.6.1/src/nighthawk/resilience/__init__.py +34 -0
- nighthawk_python-0.6.1/src/nighthawk/resilience/_circuit_breaker.py +204 -0
- nighthawk_python-0.6.1/src/nighthawk/resilience/_fallback.py +185 -0
- nighthawk_python-0.6.1/src/nighthawk/resilience/_retry.py +196 -0
- nighthawk_python-0.6.1/src/nighthawk/resilience/_timeout.py +111 -0
- nighthawk_python-0.6.1/src/nighthawk/resilience/_vote.py +139 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/prompt.py +4 -3
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/runner.py +73 -8
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/scoping.py +2 -2
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/step_context.py +1 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/testing.py +1 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/tools/assignment.py +17 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/tools/provided.py +7 -7
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/tools/registry.py +5 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/backends/test_claude_code_cli.py +7 -7
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/backends/test_codex.py +20 -19
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/conftest.py +1 -1
- nighthawk_python-0.6.1/tests/docs/test_coding_agent_examples.py +137 -0
- nighthawk_python-0.6.1/tests/docs/test_docs_architecture.py +218 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/docs/test_prompt_examples.py +25 -7
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/prompt_test_helpers.py +15 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/test_variables_prompt.py +272 -8
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/integration/skip_helpers.py +1 -1
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/integration/test_carry_pattern.py +1 -1
- nighthawk_python-0.6.1/tests/resilience/test_circuit_breaker.py +213 -0
- nighthawk_python-0.6.1/tests/resilience/test_composition.py +210 -0
- nighthawk_python-0.6.1/tests/resilience/test_fallback.py +228 -0
- nighthawk_python-0.6.1/tests/resilience/test_retry.py +203 -0
- nighthawk_python-0.6.1/tests/resilience/test_timeout.py +120 -0
- nighthawk_python-0.6.1/tests/resilience/test_vote.py +173 -0
- nighthawk_python-0.6.1/tests/tools/__init__.py +0 -0
- nighthawk_python-0.6.1/tests/tools/test_assignment_async.py +269 -0
- nighthawk_python-0.6.1/tests/tools/test_provided_async.py +106 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/tools/test_tool_boundary.py +1 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/uv.lock +128 -117
- nighthawk_python-0.5.0/.claude/rules/docs.md +0 -106
- nighthawk_python-0.5.0/docs/for-coding-agents.md +0 -254
- nighthawk_python-0.5.0/docs/index.md +0 -31
- nighthawk_python-0.5.0/docs/philosophy.md +0 -167
- nighthawk_python-0.5.0/docs/practices.md +0 -470
- nighthawk_python-0.5.0/docs/providers.md +0 -112
- nighthawk_python-0.5.0/docs/quickstart.md +0 -115
- nighthawk_python-0.5.0/docs/tutorial.md +0 -653
- nighthawk_python-0.5.0/tests/docs/test_coding_agent_examples.py +0 -263
- nighthawk_python-0.5.0/tests/tools/test_assignment_async.py +0 -101
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.claude/rules/coding.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.claude/rules/promptfoo.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.claude/rules/tests.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.claude/settings.json +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.claude/unset_envs.sh +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.devcontainer/Dockerfile.devcontainer +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.devcontainer/Dockerfile.litellm +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.devcontainer/devcontainer.json +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.devcontainer/docker-compose.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.devcontainer/litellm-config.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.github/dependabot.yml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.github/workflows/ci.yml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.github/workflows/publish.yml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.gitignore +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/.python-version +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/CLAUDE.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/CONTRIBUTING.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/LICENSE +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/docs/assets/nighthawk_logo-128x128.png +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/assertions/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/assertions/binding_value.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/assertions/outcome_kind.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/assertions/raise_message.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/evidence/2026-03-26-baseline-prompt-ab.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/evidence/2026-03-26-baseline-regression.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/evidence/2026-03-26-baseline-suffix-ab.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/promptfooconfig-agents.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/promptfooconfig-prompt-ab.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/promptfooconfig-suffix-ab.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/promptfooconfig.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/prompts/eval_coding_agent.txt +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/prompts/eval_default.txt +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/prompts/eval_mutation_aware.txt +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/prompts/eval_sequenced.txt +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/research-result.md +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/test_cases/binding_operations.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/test_cases/edge_cases.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/test_cases/loop_outcomes.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/test_cases/multi_step.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/test_cases/null_handling.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/test_cases/outcome_kinds.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/evals/promptfoo/test_cases/tool_selection.yaml +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/pyrightconfig.json +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/mcp_boundary.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/mcp_server.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/backends/tool_bridge.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/configuration.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/errors.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/identifier_path.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/json_renderer.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/natural/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/natural/blocks.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/natural/transform.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/async_bridge.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/step_contract.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/step_executor.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/runtime/tool_calls.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/tools/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/tools/contracts.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/tools/execution.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/src/nighthawk/ulid.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/backends/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/backends/test_claude_code_sdk.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/docs/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/stub_executor.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/test_execution_outcome_prompt_fragment.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/test_globals_prompt.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/test_infer_binding_types.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/test_natural_block_ordering.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/test_natural_traceback.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/execution/test_runtime.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/integration/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/integration/test_claude_code_cli_integration.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/integration/test_claude_code_sdk_integration.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/integration/test_codex_integration.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/integration/test_llm_integration.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/natural/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/natural/test_blocks.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/public/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/public/test_public_api.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/public/test_readme_example.py +0 -0
- {nighthawk_python-0.5.0/tests/tools → nighthawk_python-0.6.1/tests/resilience}/__init__.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/test_renderer.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/test_testing.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/tools/test_contracts.py +0 -0
- {nighthawk_python-0.5.0 → nighthawk_python-0.6.1}/tests/tools/test_registry.py +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- "docs/**/*.md"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation rules
|
|
7
|
+
|
|
8
|
+
## Canonical ownership
|
|
9
|
+
|
|
10
|
+
Each topic must have exactly one canonical owner file. Other files may restate the topic only as a deliberate derivative summary, quickstart, or routing pointer.
|
|
11
|
+
|
|
12
|
+
General rules:
|
|
13
|
+
|
|
14
|
+
- Prefer cross-references over duplication.
|
|
15
|
+
- If a topic appears in multiple files, one file must be the declared source of truth.
|
|
16
|
+
- Derivative documents may compress or subset canonical content when that serves a distinct audience.
|
|
17
|
+
- `for-coding-agents.md` is the main exception: it is a derivative operational guide for coding agents and may restate material from human-oriented docs.
|
|
18
|
+
|
|
19
|
+
Public API documentation layering:
|
|
20
|
+
|
|
21
|
+
- `api.md` owns the exhaustive inventory of the supported public API surface (existence, types, signatures, exceptions, docstrings). Low-level utilities and extension hooks belong here.
|
|
22
|
+
- `specification.md` owns API semantics, contracts, boundaries, and runtime behavior. It is the canonical source for *what a symbol means and how it behaves*.
|
|
23
|
+
- `quickstart.md`, `natural-blocks.md`, `patterns.md`, `runtime-configuration.md`, and `verification.md` are task-oriented. They cover *when to use* and *how to use* selected APIs -- not every public symbol. A public API having no coverage in these pages is expected when the symbol serves a narrow or advanced use case already documented by `api.md` and `specification.md`.
|
|
24
|
+
|
|
25
|
+
`docs/AGENTS.md` is governance-only content. It is a symlink to `.claude/rules/docs.md` and must not appear as an accidental published governance page. It is excluded from the published site via `exclude_docs` in `mkdocs.yml`.
|
|
26
|
+
|
|
27
|
+
## File roles and boundaries
|
|
28
|
+
|
|
29
|
+
| File | Audience | Role | Scope |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| `index.md` | First-time visitors | Landing page | Value proposition, one runnable example, entry path routing. No API, no how-to. |
|
|
32
|
+
| `quickstart.md` | New users | First success | Minimal setup, minimal example, minimal troubleshooting, explicit next-step link. |
|
|
33
|
+
| `natural-blocks.md` | Learners | What Natural blocks are | Natural block anatomy, prompt structure, read/write bindings, Pydantic model bindings, f-string injection, functions and discoverability, binding function design (principles and basic examples), responsibility split, structured output design. |
|
|
34
|
+
| `executors.md` | Learners / evaluators | Choose an execution backend | Capability / cost / latency matrix, decision tree, `StepExecutorConfiguration` basics, and routing to side references and `runtime-configuration.md`. |
|
|
35
|
+
| `runtime-configuration.md` | Learners | Configure execution | `nh.run()`, `nh.scope()`, configuration patching, prompt suffix fragments, context limits, JSON rendering style, and runtime execution identity. |
|
|
36
|
+
| `patterns.md` | Practitioners | Apply Natural blocks in workflows | Outcomes, deny frontmatter, error handling, custom exception types, async, carry pattern, cross-block composition, resilience patterns, and common mistakes. |
|
|
37
|
+
| `verification.md` | Practitioners | Verify and debug | Mock tests, integration tests, prompt inspection, diagnosing snipped markers, OpenTelemetry span hierarchy, step events, local trace inspection. |
|
|
38
|
+
| `pydantic-ai-providers.md` | Model configurers | Pydantic AI provider reference | Provider list, installation, model identifiers, credentials, model settings, provider-specific troubleshooting. No chooser. No custom backends. |
|
|
39
|
+
| `coding-agent-backends.md` | Backend users | Backend reference | Backend-specific settings, shared capabilities, skills, MCP tool exposure, working directory, troubleshooting. |
|
|
40
|
+
| `for-coding-agents.md` | Coding agents (LLMs) | Operational guide | Condensed, decision-oriented rules derived from human-oriented docs. Self-contained with absolute URLs. |
|
|
41
|
+
| `specification.md` | Implementors | Canonical spec | Syntax, state layers, tools, outcomes, frontmatter, runtime semantics, observability contract, and custom backend capability/protocol semantics. Numbered section headings. |
|
|
42
|
+
| `philosophy.md` | Evaluators | Design rationale | Execution model, harness evidence, design consequences (resilience, scoped execution contexts, tool exposure, multi-agent coordination, tradeoffs), runtime evaluation rationale, design landscape. |
|
|
43
|
+
| `api.md` | Developers | API reference | Auto-generated from docstrings, including protocol and extension-hook symbols. |
|
|
44
|
+
| `roadmap.md` | Contributors | Future directions | Ideas only. Remove when implemented. |
|
|
45
|
+
| `docs/AGENTS.md` | Coding agents editing docs | Documentation governance | Canonical ownership, page roles, routing rules, and docs test invariants. Symlink to `.claude/rules/docs.md`. |
|
|
46
|
+
|
|
47
|
+
## Content routing
|
|
48
|
+
|
|
49
|
+
List only topics that commonly drift across multiple files or are easy to misplace.
|
|
50
|
+
|
|
51
|
+
- **Credentials** -> `quickstart.md` (minimal first run), `pydantic-ai-providers.md` (Pydantic AI providers), `coding-agent-backends.md` (backend prerequisites)
|
|
52
|
+
- **Executor selection** -> `executors.md` (capability and cost tradeoffs), `coding-agent-backends.md` (backend behavior and constraints), `for-coding-agents.md` (block-level operational guidance), `quickstart.md` (minimal entry example only)
|
|
53
|
+
- **Runtime setup and scoping** (`nh.run()`, `nh.scope()`, configuration patching) -> `runtime-configuration.md` (canonical), `patterns.md` (usage-only references), `for-coding-agents.md` (condensed)
|
|
54
|
+
- **Context limits / JSON rendering / execution identity** -> `runtime-configuration.md` (canonical), `verification.md` (`<snipped>` diagnosis only), `specification.md` (formal semantics), `for-coding-agents.md` (condensed)
|
|
55
|
+
- **Bindings** -> `natural-blocks.md` (canonical), `specification.md` (formal definition), `for-coding-agents.md` (condensed)
|
|
56
|
+
- **Binding function design** -> `natural-blocks.md` (principles and basic examples), `patterns.md` (only when binding functions participate in multi-block patterns), `for-coding-agents.md` (condensed)
|
|
57
|
+
- **Resilience** -> `patterns.md` (canonical patterns), `for-coding-agents.md` (condensed operational rules), `philosophy.md` (positioning only)
|
|
58
|
+
- **Testing** -> `verification.md` (canonical patterns and examples), `for-coding-agents.md` (condensed operational rules), `specification.md` (testing is out of scope except for boundary statements)
|
|
59
|
+
- **Observability** -> `verification.md` (usage and debugging workflow), `specification.md` (specification and runtime semantics), `for-coding-agents.md` (normally omit; mention only when needed to explain execution constraints)
|
|
60
|
+
- **Deny frontmatter** -> `patterns.md` (standard patterns), `specification.md` (canonical specification), `for-coding-agents.md` (condensed operational rules)
|
|
61
|
+
- **Coding agent control** -> `philosophy.md` (execution model and design consequences), `coding-agent-backends.md` (configuration and constraints)
|
|
62
|
+
- **Coding agent backend impact** -> `philosophy.md` (execution model and design consequences), `index.md` (brief summary), `coding-agent-backends.md` (details)
|
|
63
|
+
- **Async** -> `patterns.md` (patterns), `specification.md` (specification), `for-coding-agents.md` (condensed rules)
|
|
64
|
+
- **Structured output / Pydantic models** -> `natural-blocks.md` (design guidelines), `specification.md` (type validation specification)
|
|
65
|
+
- **Custom backends** -> `specification.md` (semantics), `api.md` (protocol symbols), `executors.md` (chooser-level mention only)
|
|
66
|
+
- **Workflow engine comparison** -> `philosophy.md` (canonical, design landscape section), `index.md` (link), `executors.md` (link)
|
|
67
|
+
- **Tool exposure tradeoffs** -> `philosophy.md` (canonical, design consequences section), `index.md` (link), `executors.md` (link)
|
|
68
|
+
- **Docs governance** -> `docs/AGENTS.md` and `.claude/rules/docs.md`. No derivative restatement elsewhere.
|
|
69
|
+
|
|
70
|
+
## Shared writing guidelines
|
|
71
|
+
|
|
72
|
+
### General
|
|
73
|
+
|
|
74
|
+
- Headings: sentence case. Capitalize first word, proper nouns (Nighthawk, Natural, Pydantic), acronyms (LLM, JSON, MCP).
|
|
75
|
+
- Anchors: name-based (`#writing-guidelines`), not number-based (`#1-writing-guidelines`). Exception: `specification.md` is a specification document and may use numbered section headings as its stable citation hierarchy.
|
|
76
|
+
- Cross-references: relative links. Exception: `for-coding-agents.md` uses absolute URLs from `site_url`.
|
|
77
|
+
- Terminology: "task" = structural unit (contract), "judgment" = cognitive act. Use "one task per block".
|
|
78
|
+
- Code examples: self-contained and understandable without surrounding prose.
|
|
79
|
+
- Built-in tools (`nh_eval`, `nh_assign`): implementation details. Only `specification.md` may expose them.
|
|
80
|
+
- `@nh.tool`: `specification.md` documents as spec, `natural-blocks.md` may mention it with a "prefer binding functions" note, all others must not reference it.
|
|
81
|
+
- Package name: always `nighthawk-python` in `pip install` commands.
|
|
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
|
+
- When a governance file under `docs/` is not meant for publication, its MkDocs handling must be explicit.
|
|
84
|
+
- `natural-blocks.md` and `patterns.md` together replace the former `guide.md`.
|
|
85
|
+
- References to `design.md` should use `specification.md`.
|
|
86
|
+
- References to `providers.md` should use `pydantic-ai-providers.md`.
|
|
87
|
+
|
|
88
|
+
### Prerequisite notes
|
|
89
|
+
|
|
90
|
+
Pages in the Getting started, Patterns & verification, and Configuration nav groups must open with a short prerequisite note. This supports non-linear readers who jump directly to a topic. The note should be one sentence naming the assumed prior reading. Pages in Reference, Background, and Project groups (`specification.md`, `philosophy.md`, `roadmap.md`, `api.md`) are exempt -- they serve independent audiences that do not follow the learning path.
|
|
91
|
+
|
|
92
|
+
## Per-file rules
|
|
93
|
+
|
|
94
|
+
**`index.md`**
|
|
95
|
+
|
|
96
|
+
- Links list must stay in sync with `nav` in `mkdocs.yml`.
|
|
97
|
+
- One representative code example (Python + Natural block + binding function). The example must be self-contained and runnable (include executor setup and `nh.run()` context).
|
|
98
|
+
- Brief positioning summaries linking to `philosophy.md`. No comparisons or benchmarks.
|
|
99
|
+
|
|
100
|
+
**`quickstart.md`**
|
|
101
|
+
|
|
102
|
+
- Optimize for copy-paste.
|
|
103
|
+
- Include only the minimum needed for a first success.
|
|
104
|
+
- Retain one explicit sentence stating the trust model / hard constraint for Natural blocks and imported markdown.
|
|
105
|
+
- End with a next-page link to `natural-blocks.md`.
|
|
106
|
+
- No backend alternatives beyond a one-line link to `executors.md`.
|
|
107
|
+
|
|
108
|
+
**`natural-blocks.md`**
|
|
109
|
+
|
|
110
|
+
- Prerequisite note: "This page assumes you have completed [Quickstart](quickstart.md)."
|
|
111
|
+
- Owns Natural block anatomy, prompt structure, binding semantics, discoverability, binding function design (principles and basic examples), responsibility split, and structured output design guidelines.
|
|
112
|
+
- Binding function design includes principles and basic examples that are complete within a single block. Advanced multi-block patterns (carry, branching, resilience) belong in `patterns.md`.
|
|
113
|
+
- Owns migrated `prompt-example` test anchors (`basic-binding`, `fstring-injection`, `local-function-signature`, `global-function-reference`). Exception: `carry-pattern` belongs in `patterns.md`.
|
|
114
|
+
- Backend-agnostic: examples use the Quickstart default executor.
|
|
115
|
+
- Cross-reference `specification.md` for formal definitions.
|
|
116
|
+
- Ends with a routing sentence: "Choosing an executor is in [Executors](executors.md). Runtime configuration (`nh.run()`, `nh.scope()`, limits) is in [Runtime configuration](runtime-configuration.md)."
|
|
117
|
+
|
|
118
|
+
**`executors.md`**
|
|
119
|
+
|
|
120
|
+
- Prerequisite note: "This page assumes you have completed [Quickstart](quickstart.md) and [Natural blocks](natural-blocks.md)."
|
|
121
|
+
- Owns executor selection: capability matrix, decision tree, and `StepExecutorConfiguration` basics.
|
|
122
|
+
- Links to `philosophy.md` for positioning instead of duplicating it.
|
|
123
|
+
- Capability matrix must include relative cost and latency columns.
|
|
124
|
+
- Must include an explicit custom-backend routing subsection with a minimal `AgentStepExecutor.from_agent(agent=agent)` runnable example (3-5 lines). Direct `AsyncStepExecutor` implementation belongs in `specification.md`.
|
|
125
|
+
- Ends with routing: side trips to `pydantic-ai-providers.md` and `coding-agent-backends.md`, then next-step link to `runtime-configuration.md`.
|
|
126
|
+
- Runtime configuration topics (`nh.run()`, `nh.scope()`, configuration patching, prompt suffix, context limits, JSON rendering, execution identity) belong in `runtime-configuration.md`, not here.
|
|
127
|
+
|
|
128
|
+
**`runtime-configuration.md`**
|
|
129
|
+
|
|
130
|
+
- Prerequisite note: "This page assumes you have completed [Executors](executors.md)."
|
|
131
|
+
- Owns all runtime configuration: `nh.run()`, `nh.scope()`, configuration patching, prompt suffix fragments, context limits, JSON rendering style, and runtime execution identity.
|
|
132
|
+
- These topics are independent of executor choice. The page applies equally to Pydantic AI providers and coding agent backends.
|
|
133
|
+
- Cross-reference `specification.md` for formal semantics.
|
|
134
|
+
- Ends with next-step link to `patterns.md`.
|
|
135
|
+
|
|
136
|
+
**`patterns.md`**
|
|
137
|
+
|
|
138
|
+
- Prerequisite note: "This page assumes you have completed [Natural blocks](natural-blocks.md) and [Runtime configuration](runtime-configuration.md)."
|
|
139
|
+
- Owns outcomes, deny, async, carry, composition, resilience, and common mistakes.
|
|
140
|
+
- Scope: multi-block coordination and operational patterns. Single-block-complete topics belong in `natural-blocks.md`.
|
|
141
|
+
- Backend-agnostic: no backend-specific file layouts or credentials.
|
|
142
|
+
- Cross-reference `specification.md` for formal definitions.
|
|
143
|
+
|
|
144
|
+
**`verification.md`**
|
|
145
|
+
|
|
146
|
+
- Prerequisite note: "Mock testing is readable after [Natural blocks](natural-blocks.md); later sections assume [Patterns](patterns.md)."
|
|
147
|
+
- Owns mock tests, integration tests, prompt inspection, debugging workflow, and OpenTelemetry usage.
|
|
148
|
+
- Normative observability contracts belong in `specification.md`.
|
|
149
|
+
|
|
150
|
+
**`pydantic-ai-providers.md`**
|
|
151
|
+
|
|
152
|
+
- Prerequisite note: "See [Executors](executors.md) for choosing between providers, backends, and custom executors."
|
|
153
|
+
- Pure Pydantic AI provider reference: installation, model identifiers, model settings, troubleshooting.
|
|
154
|
+
- No chooser table.
|
|
155
|
+
- No custom backends.
|
|
156
|
+
|
|
157
|
+
**`coding-agent-backends.md`**
|
|
158
|
+
|
|
159
|
+
- Prerequisite note: "See [Executors](executors.md) for when to choose a coding agent backend over a provider-backed executor."
|
|
160
|
+
- Reference-first page: minimal orientation only, then backend-specific settings, skills, MCP, working directory, and troubleshooting.
|
|
161
|
+
- Must not become a second chooser page. Capability, latency, cost, and positioning comparisons belong in `executors.md` and `philosophy.md`.
|
|
162
|
+
- Shared capabilities section for common features.
|
|
163
|
+
- Reference `executors.md` for capability and cost comparisons.
|
|
164
|
+
|
|
165
|
+
**`specification.md`**
|
|
166
|
+
|
|
167
|
+
- All current specification rules apply, with the new name.
|
|
168
|
+
- Numbered section headings remain stable.
|
|
169
|
+
- Owns custom backend capability/protocol semantics, placed as a subsection under Section 14 (Step executor) to avoid top-level section number disruption.
|
|
170
|
+
- Includes a non-runnable skeletal shape of the `AsyncStepExecutor` protocol surface under Section 14. No runnable implementation example is required (the runnable `from_agent` example lives in `executors.md`).
|
|
171
|
+
|
|
172
|
+
**`philosophy.md`**
|
|
173
|
+
|
|
174
|
+
- Owns the cumulative argument: execution model, harness evidence, design consequences (resilience, scoped execution contexts, tool exposure, multi-agent coordination, tradeoffs), runtime evaluation rationale, and design landscape.
|
|
175
|
+
- External references acceptable. Prefer stable URLs with enough inline context to survive link rot.
|
|
176
|
+
- No how-to code examples for patterns in `natural-blocks.md` or `patterns.md`. Exception: positioning examples may reuse function names from those pages.
|
|
177
|
+
|
|
178
|
+
**`for-coding-agents.md`**
|
|
179
|
+
|
|
180
|
+
- Reader is a coding agent. Write for immediate applicability with runnable templates and decision rules.
|
|
181
|
+
- Information flows from human-oriented docs only; never introduce new product behavior here first.
|
|
182
|
+
- May derive from `natural-blocks.md`, `patterns.md`, `runtime-configuration.md`, `verification.md`, `specification.md`, `pydantic-ai-providers.md`, and `coding-agent-backends.md`.
|
|
183
|
+
- Self-contained with absolute URLs from `site_url` (`https://kurusugawa-computer.github.io/nighthawk-python/`).
|
|
184
|
+
- Prefer decision rules over encyclopedic coverage.
|
|
185
|
+
- Recommend provider-backed executors by default and coding agent backends only for blocks that need autonomous long-horizon work.
|
|
186
|
+
- Keep trust-model constraints explicit.
|
|
187
|
+
- Condensation policy: compress tables and lists to inline summaries or subsets with links to canonical docs. Verbatim duplication only for compact, self-contained content.
|
|
188
|
+
- Common mistakes: subset of most impactful items with link to fuller guidance.
|
|
189
|
+
- Include resilience and scoped overrides.
|
|
190
|
+
- Omit observability except when needed to explain execution constraints.
|
|
191
|
+
- Omit exception hierarchy beyond `ExecutionError` unless a narrower rule is essential for safe coding.
|
|
192
|
+
- Published as a derivative operational reference under `Reference` in nav, not as a top-level learner-path peer.
|
|
193
|
+
- Absolute URLs use topic-based canonical owner mapping:
|
|
194
|
+
- Bindings, block anatomy, responsibility split, binding function design -> `/natural-blocks/`
|
|
195
|
+
- Carry, deny, async, resilience, multi-block composition -> `/patterns/`
|
|
196
|
+
- Executor selection, `StepExecutorConfiguration` basics -> `/executors/`
|
|
197
|
+
- `nh.run()`, `nh.scope()`, configuration patching, context limits, JSON rendering, execution identity -> `/runtime-configuration/`
|
|
198
|
+
- Provider-specific setup -> `/pydantic-ai-providers/`
|
|
199
|
+
- Coding agent backend config -> `/coding-agent-backends/`
|
|
200
|
+
- Spec references -> `/specification/`
|
|
201
|
+
|
|
202
|
+
**`api.md`**
|
|
203
|
+
|
|
204
|
+
- Exhaustive inventory of the supported public API surface. Every supported public symbol should appear here.
|
|
205
|
+
- Auto-generated from source docstrings. Hand-editing limited to `:::` directive structure.
|
|
206
|
+
- Use `members` filters to avoid duplicate rendering.
|
|
207
|
+
- A symbol appearing only in `api.md` (with no learner-facing page coverage) is acceptable. Task-oriented docs select symbols by pedagogical value, not completeness.
|
|
208
|
+
|
|
209
|
+
**`roadmap.md`**
|
|
210
|
+
|
|
211
|
+
- Future-facing only. Remove items once implemented.
|
|
212
|
+
- Each item should reference the relevant `specification.md` section where that helps maintain traceability.
|
|
213
|
+
|
|
214
|
+
**`docs/AGENTS.md`**
|
|
215
|
+
|
|
216
|
+
- Is a symlink to `.claude/rules/docs.md`. No separate synchronization step needed.
|
|
217
|
+
- Must not appear as an accidental published governance page. Exclude via `exclude_docs` in `mkdocs.yml`, listing `AGENTS.md` explicitly by filename.
|
|
218
|
+
|
|
219
|
+
## Documentation test invariants
|
|
220
|
+
|
|
221
|
+
- Treat executable or doctrinal claims in docs as testable when practical.
|
|
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
|
+
- `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
|
+
- 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.
|
|
231
|
+
- `mkdocs build` must succeed without `--strict`. Warnings are acceptable.
|
|
232
|
+
- All internal relative links must resolve.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
### Allowed abbreviations (Glossary)
|
|
15
15
|
|
|
16
|
-
`Id` (Identifier), `DSL` (Domain Specific Language), `LLM` (Large Language Model), `NH`/`nh` (Nighthawk), `max` (maximum), `min` (minimum), loop indices `i`/`j`/`k
|
|
16
|
+
`Id` (Identifier), `DSL` (Domain Specific Language), `LLM` (Large Language Model), `NH`/`nh` (Nighthawk), `max` (maximum), `min` (minimum), loop indices `i`/`j`/`k`, type parameters `P` (ParamSpec), `R` (Return type), `T` (Type variable).
|
|
17
17
|
|
|
18
18
|
### Rules
|
|
19
19
|
|
|
@@ -37,7 +37,7 @@ Natural DSL sources and included markdown are trusted, repository-managed assets
|
|
|
37
37
|
|
|
38
38
|
- `src/nighthawk/`: Library package.
|
|
39
39
|
- `tests/`: Pytest suite.
|
|
40
|
-
- `docs/`:
|
|
40
|
+
- `docs/`: User-facing documentation (MkDocs).
|
|
41
41
|
- `.agents/`: `execplans/` (on request only), `PLANS.md` (format spec).
|
|
42
42
|
- `.devcontainer/`: Devcontainer definition.
|
|
43
43
|
- `pyproject.toml`, `uv.lock`: Metadata and locked dependencies.
|
|
@@ -54,7 +54,10 @@ Python 3.13+, `uv` for dependencies, `pytest` for tests. Prefer LSP-based toolin
|
|
|
54
54
|
| `uv run ruff check --fix .` | Auto-fix lint |
|
|
55
55
|
| `uv run pyright` | Type check |
|
|
56
56
|
| `uv run pytest -q` | Tests (quiet) |
|
|
57
|
-
| `
|
|
57
|
+
| `NIGHTHAWK_OPENAI_INTEGRATION_TESTS=1 uv run pytest -q` | Integration tests (OpenAI) |
|
|
58
|
+
| `NIGHTHAWK_CODEX_INTEGRATION_TESTS=1 uv run pytest -q` | Integration tests (Codex) |
|
|
59
|
+
| `NIGHTHAWK_CLAUDE_SDK_INTEGRATION_TESTS=1 uv run pytest -q` | Integration tests (Claude Code SDK) |
|
|
60
|
+
| `NIGHTHAWK_CLAUDE_CLI_INTEGRATION_TESTS=1 uv run pytest -q` | Integration tests (Claude Code CLI) |
|
|
58
61
|
|
|
59
62
|
`uv` hardlinking warnings do not indicate failure. Suppress: `export UV_LINK_MODE=copy`.
|
|
60
63
|
|
|
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.1]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Implicit type alias discovery: callable signatures in step locals and referenced globals are now scanned for PEP 695 `TypeAliasType` references, automatically including their definitions in the prompt globals section so the LLM can resolve type names like `-> Labels`.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- `nh_eval` and `nh_assign` provided tools are now async, directly awaiting coroutines in async contexts instead of bridging through a background thread.
|
|
17
|
+
|
|
18
|
+
## [0.6.0]
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- `nighthawk.resilience` module with composable function transformers for production resilience: `retrying` (tenacity-based), `fallback`, `vote`/`plurality`, `timeout`, `circuit_breaker`/`CircuitState`/`CircuitOpenError`.
|
|
22
|
+
- `tenacity>=9` as a core dependency.
|
|
23
|
+
- `BackendModelSettings` base class and `ClaudeCodeModelSettings` intermediate class extracting shared settings across coding agent backends.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Refactored backend settings hierarchy: extracted shared fields (`allowed_tool_names`, `working_directory`) into `BackendModelSettings` and Claude Code fields (`max_turns`, `permission_mode`, `setting_sources`) into `ClaudeCodeModelSettings`; renamed `claude_executable`/`codex_executable` to `executable`, `claude_max_turns` to `max_turns`.
|
|
27
|
+
- `nh_assign` now resolves type annotations via `get_type_hints` for plain classes and dataclasses, enabling type-mismatch retry beyond Pydantic models.
|
|
28
|
+
- Simplified intent hint formatting: dropped `intent: ` prefix from callable metadata comments in prompt context.
|
|
29
|
+
- Renamed `NIGHTHAWK_RUN_INTEGRATION_TESTS` to `NIGHTHAWK_OPENAI_INTEGRATION_TESTS` for consistency with other per-backend environment variables.
|
|
30
|
+
- Restructured documentation into sectioned navigation: split monolithic tutorial into focused guides (`natural-blocks`, `executors`, `runtime-configuration`, `patterns`, `verification`, `pydantic-ai-providers`); renamed `design.md` to `specification.md`; removed `practices.md`, `providers.md`, `tutorial.md`.
|
|
31
|
+
|
|
10
32
|
## [0.5.0]
|
|
11
33
|
|
|
12
34
|
### Added
|
|
@@ -80,7 +102,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
80
102
|
- Step executor abstraction and provider integration foundation.
|
|
81
103
|
- Core documentation and project scaffolding.
|
|
82
104
|
|
|
83
|
-
[Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.
|
|
105
|
+
[Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.6.1...HEAD
|
|
106
|
+
[0.6.1]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.6.0...v0.6.1
|
|
107
|
+
[0.6.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.5.0...v0.6.0
|
|
84
108
|
[0.5.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.4.0...v0.5.0
|
|
85
109
|
[0.4.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.3.1...v0.4.0
|
|
86
110
|
[0.3.1]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.3.0...v0.3.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nighthawk-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: An experimental Python library that embeds Natural blocks inside Python functions and executes them using an LLM.
|
|
5
5
|
Project-URL: Repository, https://github.com/kurusugawa-computer/nighthawk-python
|
|
6
6
|
Project-URL: Documentation, https://kurusugawa-computer.github.io/nighthawk-python/
|
|
@@ -23,6 +23,7 @@ Requires-Dist: headson>=0.16.1
|
|
|
23
23
|
Requires-Dist: pydantic-ai-slim>=1.68
|
|
24
24
|
Requires-Dist: pydantic>=2
|
|
25
25
|
Requires-Dist: pyyaml>=6
|
|
26
|
+
Requires-Dist: tenacity>=9
|
|
26
27
|
Requires-Dist: tiktoken>=0.12
|
|
27
28
|
Provides-Extra: claude-code-cli
|
|
28
29
|
Requires-Dist: mcp>=1.26; extra == 'claude-code-cli'
|
|
@@ -60,44 +61,50 @@ Prerequisites: Python 3.13+
|
|
|
60
61
|
pip install nighthawk-python pydantic-ai-slim[openai]
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
For other providers, see [
|
|
64
|
+
For other providers, see [Pydantic AI providers](https://kurusugawa-computer.github.io/nighthawk-python/pydantic-ai-providers/).
|
|
64
65
|
|
|
65
66
|
## Example
|
|
66
67
|
|
|
67
68
|
```py
|
|
68
69
|
import nighthawk as nh
|
|
69
70
|
|
|
71
|
+
def python_average(numbers):
|
|
72
|
+
return sum(numbers) / len(numbers)
|
|
73
|
+
|
|
70
74
|
step_executor = nh.AgentStepExecutor.from_configuration(
|
|
71
|
-
configuration=nh.StepExecutorConfiguration(model="openai-responses:gpt-5.4-
|
|
75
|
+
configuration=nh.StepExecutorConfiguration(model="openai-responses:gpt-5.4-nano")
|
|
72
76
|
)
|
|
73
77
|
|
|
74
78
|
with nh.run(step_executor):
|
|
75
79
|
|
|
76
80
|
@nh.natural_function
|
|
77
|
-
def
|
|
78
|
-
total = 0
|
|
81
|
+
def calculate_average(numbers):
|
|
79
82
|
"""natural
|
|
80
|
-
|
|
83
|
+
Map each element of <numbers> to the number it represents,
|
|
84
|
+
then compute <:result> by calling <python_average> with the mapped list.
|
|
81
85
|
"""
|
|
82
|
-
return
|
|
86
|
+
return result
|
|
83
87
|
|
|
84
|
-
|
|
85
|
-
# => 20
|
|
88
|
+
calculate_average([1, "2", "three", "cuatro"]) # 2.5
|
|
86
89
|
```
|
|
87
90
|
|
|
88
91
|
See the **[Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/)** for setup details, credentials, and troubleshooting.
|
|
89
92
|
|
|
90
93
|
## Documentation
|
|
91
94
|
|
|
92
|
-
- **[Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/)**
|
|
93
|
-
- **[
|
|
94
|
-
- **[
|
|
95
|
-
- **[
|
|
96
|
-
- **[
|
|
97
|
-
- **[
|
|
98
|
-
- **[
|
|
99
|
-
- **[
|
|
100
|
-
- **[
|
|
95
|
+
- **[Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/)** -- Setup and first example.
|
|
96
|
+
- **[Natural blocks](https://kurusugawa-computer.github.io/nighthawk-python/natural-blocks/)** -- Block anatomy, bindings, functions, and writing guidelines.
|
|
97
|
+
- **[Executors](https://kurusugawa-computer.github.io/nighthawk-python/executors/)** -- Choose an execution backend.
|
|
98
|
+
- **[Runtime configuration](https://kurusugawa-computer.github.io/nighthawk-python/runtime-configuration/)** -- Scoping, patching, context limits, and execution identity.
|
|
99
|
+
- **[Patterns](https://kurusugawa-computer.github.io/nighthawk-python/patterns/)** -- Outcomes, async, composition, resilience, and common mistakes.
|
|
100
|
+
- **[Verification](https://kurusugawa-computer.github.io/nighthawk-python/verification/)** -- Mock tests, integration tests, and OpenTelemetry tracing.
|
|
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.
|
|
101
108
|
|
|
102
109
|
## Development & Contributing
|
|
103
110
|
|
|
@@ -26,44 +26,50 @@ Prerequisites: Python 3.13+
|
|
|
26
26
|
pip install nighthawk-python pydantic-ai-slim[openai]
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
For other providers, see [
|
|
29
|
+
For other providers, see [Pydantic AI providers](https://kurusugawa-computer.github.io/nighthawk-python/pydantic-ai-providers/).
|
|
30
30
|
|
|
31
31
|
## Example
|
|
32
32
|
|
|
33
33
|
```py
|
|
34
34
|
import nighthawk as nh
|
|
35
35
|
|
|
36
|
+
def python_average(numbers):
|
|
37
|
+
return sum(numbers) / len(numbers)
|
|
38
|
+
|
|
36
39
|
step_executor = nh.AgentStepExecutor.from_configuration(
|
|
37
|
-
configuration=nh.StepExecutorConfiguration(model="openai-responses:gpt-5.4-
|
|
40
|
+
configuration=nh.StepExecutorConfiguration(model="openai-responses:gpt-5.4-nano")
|
|
38
41
|
)
|
|
39
42
|
|
|
40
43
|
with nh.run(step_executor):
|
|
41
44
|
|
|
42
45
|
@nh.natural_function
|
|
43
|
-
def
|
|
44
|
-
total = 0
|
|
46
|
+
def calculate_average(numbers):
|
|
45
47
|
"""natural
|
|
46
|
-
|
|
48
|
+
Map each element of <numbers> to the number it represents,
|
|
49
|
+
then compute <:result> by calling <python_average> with the mapped list.
|
|
47
50
|
"""
|
|
48
|
-
return
|
|
51
|
+
return result
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
# => 20
|
|
53
|
+
calculate_average([1, "2", "three", "cuatro"]) # 2.5
|
|
52
54
|
```
|
|
53
55
|
|
|
54
56
|
See the **[Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/)** for setup details, credentials, and troubleshooting.
|
|
55
57
|
|
|
56
58
|
## Documentation
|
|
57
59
|
|
|
58
|
-
- **[Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/)**
|
|
59
|
-
- **[
|
|
60
|
-
- **[
|
|
61
|
-
- **[
|
|
62
|
-
- **[
|
|
63
|
-
- **[
|
|
64
|
-
- **[
|
|
65
|
-
- **[
|
|
66
|
-
- **[
|
|
60
|
+
- **[Quickstart](https://kurusugawa-computer.github.io/nighthawk-python/quickstart/)** -- Setup and first example.
|
|
61
|
+
- **[Natural blocks](https://kurusugawa-computer.github.io/nighthawk-python/natural-blocks/)** -- Block anatomy, bindings, functions, and writing guidelines.
|
|
62
|
+
- **[Executors](https://kurusugawa-computer.github.io/nighthawk-python/executors/)** -- Choose an execution backend.
|
|
63
|
+
- **[Runtime configuration](https://kurusugawa-computer.github.io/nighthawk-python/runtime-configuration/)** -- Scoping, patching, context limits, and execution identity.
|
|
64
|
+
- **[Patterns](https://kurusugawa-computer.github.io/nighthawk-python/patterns/)** -- Outcomes, async, composition, resilience, and common mistakes.
|
|
65
|
+
- **[Verification](https://kurusugawa-computer.github.io/nighthawk-python/verification/)** -- Mock tests, integration tests, and OpenTelemetry tracing.
|
|
66
|
+
- **[Pydantic AI providers](https://kurusugawa-computer.github.io/nighthawk-python/pydantic-ai-providers/)** -- LLM provider configuration.
|
|
67
|
+
- **[Coding agent backends](https://kurusugawa-computer.github.io/nighthawk-python/coding-agent-backends/)** -- Claude Code and Codex integration.
|
|
68
|
+
- **[Specification](https://kurusugawa-computer.github.io/nighthawk-python/specification/)** -- Canonical specification.
|
|
69
|
+
- **[API Reference](https://kurusugawa-computer.github.io/nighthawk-python/api/)** -- Auto-generated API documentation.
|
|
70
|
+
- **[For coding agents](https://kurusugawa-computer.github.io/nighthawk-python/for-coding-agents/)** -- Development guide for coding agents (LLMs) building Python projects with Nighthawk.
|
|
71
|
+
- **[Philosophy](https://kurusugawa-computer.github.io/nighthawk-python/philosophy/)** -- Design rationale and positioning.
|
|
72
|
+
- **[Roadmap](https://kurusugawa-computer.github.io/nighthawk-python/roadmap/)** -- Future directions.
|
|
67
73
|
|
|
68
74
|
## Development & Contributing
|
|
69
75
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
../.claude/rules/docs.md
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
- StepPromptTemplates
|
|
19
19
|
- StepContextLimits
|
|
20
20
|
- JsonableValue
|
|
21
|
+
- to_jsonable_value
|
|
21
22
|
- ExecutionContext
|
|
22
23
|
- get_current_step_context
|
|
23
24
|
- get_execution_context
|
|
@@ -37,6 +38,22 @@
|
|
|
37
38
|
|
|
38
39
|
::: nighthawk.backends.base
|
|
39
40
|
|
|
41
|
+
### Backend settings base
|
|
42
|
+
|
|
43
|
+
::: nighthawk.backends.base
|
|
44
|
+
options:
|
|
45
|
+
members:
|
|
46
|
+
- BackendModelSettings
|
|
47
|
+
|
|
48
|
+
### Claude Code shared settings
|
|
49
|
+
|
|
50
|
+
::: nighthawk.backends.claude_code_settings
|
|
51
|
+
options:
|
|
52
|
+
members:
|
|
53
|
+
- ClaudeCodeModelSettings
|
|
54
|
+
- PermissionMode
|
|
55
|
+
- SettingSource
|
|
56
|
+
|
|
40
57
|
### Claude Code (SDK)
|
|
41
58
|
|
|
42
59
|
::: nighthawk.backends.claude_code_sdk
|
|
@@ -44,8 +61,6 @@
|
|
|
44
61
|
members:
|
|
45
62
|
- ClaudeCodeSdkModel
|
|
46
63
|
- ClaudeCodeSdkModelSettings
|
|
47
|
-
- PermissionMode
|
|
48
|
-
- SettingSource
|
|
49
64
|
|
|
50
65
|
### Claude Code (CLI)
|
|
51
66
|
|
|
@@ -54,8 +69,6 @@
|
|
|
54
69
|
members:
|
|
55
70
|
- ClaudeCodeCliModel
|
|
56
71
|
- ClaudeCodeCliModelSettings
|
|
57
|
-
- PermissionMode
|
|
58
|
-
- SettingSource
|
|
59
72
|
|
|
60
73
|
### Codex
|
|
61
74
|
|
|
@@ -88,6 +101,20 @@
|
|
|
88
101
|
- ErrorKind
|
|
89
102
|
- ToolResultWrapperToolset
|
|
90
103
|
|
|
104
|
+
## Resilience
|
|
105
|
+
|
|
106
|
+
::: nighthawk.resilience
|
|
107
|
+
options:
|
|
108
|
+
members:
|
|
109
|
+
- retrying
|
|
110
|
+
- timeout
|
|
111
|
+
- fallback
|
|
112
|
+
- vote
|
|
113
|
+
- plurality
|
|
114
|
+
- circuit_breaker
|
|
115
|
+
- CircuitState
|
|
116
|
+
- CircuitOpenError
|
|
117
|
+
|
|
91
118
|
## Testing
|
|
92
119
|
|
|
93
120
|
::: nighthawk.testing
|