nighthawk-python 0.7.0__tar.gz → 0.8.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.7.0 → nighthawk_python-0.8.0}/CHANGELOG.md +12 -2
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/PKG-INFO +1 -1
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/for-coding-agents.md +2 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/specification.md +43 -6
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/prompts/eval_default.txt +1 -1
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/pyproject.toml +1 -1
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/configuration.py +9 -3
- nighthawk_python-0.8.0/src/nighthawk/runtime/prompt.py +641 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/step_executor.py +4 -2
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/tools/contracts.py +1 -1
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/prompt_test_helpers.py +8 -3
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/test_globals_prompt.py +55 -1
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/test_runtime.py +21 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/test_variables_prompt.py +150 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/uv.lock +87 -87
- nighthawk_python-0.7.0/src/nighthawk/runtime/prompt.py +0 -345
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.claude/rules/docs.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.claude/rules/promptfoo.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.claude/rules/src.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.claude/rules/tests.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.claude/settings.json +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.claude/unset_envs.sh +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.devcontainer/Dockerfile.devcontainer +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.devcontainer/Dockerfile.litellm +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.devcontainer/devcontainer.json +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.devcontainer/docker-compose.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.devcontainer/litellm-config.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.github/dependabot.yml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.github/workflows/ci.yml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.github/workflows/docs.yml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.github/workflows/publish.yml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.gitignore +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/.python-version +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/AGENTS.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/CLAUDE.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/CONTRIBUTING.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/LICENSE +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/README.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/AGENTS.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/api.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/assets/nighthawk_logo-128x128.png +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/coding-agent-backends.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/executors.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/index.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/natural-blocks.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/patterns.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/philosophy.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/pydantic-ai-providers.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/quickstart.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/roadmap.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/runtime-configuration.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/docs/verification.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/assertions/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/assertions/binding_value.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/assertions/outcome_kind.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/assertions/raise_message.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/evidence/2026-03-26-baseline-prompt-ab.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/evidence/2026-03-26-baseline-regression.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/evidence/2026-03-26-baseline-suffix-ab.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/promptfooconfig-agents.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/promptfooconfig-prompt-ab.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/promptfooconfig-suffix-ab.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/promptfooconfig.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/prompts/eval_coding_agent.txt +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/prompts/eval_mutation_aware.txt +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/prompts/eval_sequenced.txt +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/provider.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/research-result.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/test_cases/binding_operations.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/test_cases/edge_cases.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/test_cases/loop_outcomes.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/test_cases/multi_step.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/test_cases/null_handling.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/test_cases/outcome_kinds.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/evals/promptfoo/test_cases/tool_selection.yaml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/mkdocs.yml +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/pyrightconfig.json +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/AGENTS.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/base.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/claude_code_cli.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/claude_code_sdk.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/claude_code_settings.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/codex.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/mcp_boundary.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/mcp_server.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/backends/tool_bridge.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/errors.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/identifier_path.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/json_renderer.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/natural/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/natural/blocks.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/natural/decorator.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/natural/transform.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/resilience/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/resilience/_budget.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/resilience/_circuit_breaker.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/resilience/_fallback.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/resilience/_retry.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/resilience/_timeout.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/resilience/_vote.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/async_bridge.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/runner.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/scoping.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/step_context.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/step_contract.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/runtime/tool_calls.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/testing.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/tools/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/tools/assignment.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/tools/execution.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/tools/provided.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/tools/registry.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/src/nighthawk/ulid.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/AGENTS.md +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/backends/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/backends/test_claude_code_cli.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/backends/test_claude_code_sdk.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/backends/test_codex.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/conftest.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/docs/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/docs/test_coding_agent_examples.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/docs/test_docs_architecture.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/docs/test_prompt_examples.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/stub_executor.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/test_execution_outcome_prompt_fragment.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/test_infer_binding_types.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/test_natural_block_ordering.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/execution/test_natural_traceback.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/integration/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/integration/skip_helpers.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/integration/test_carry_pattern.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/integration/test_claude_code_cli_integration.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/integration/test_claude_code_sdk_integration.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/integration/test_codex_integration.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/integration/test_llm_integration.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/natural/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/natural/test_blocks.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/public/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/public/test_public_api.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/public/test_readme_example.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/public/test_usage_meter.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/test_budget.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/test_circuit_breaker.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/test_composition.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/test_fallback.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/test_retry.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/test_timeout.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/resilience/test_vote.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/test_renderer.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/test_testing.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/tools/__init__.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/tools/test_assignment_async.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/tools/test_contracts.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/tools/test_provided_async.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/tools/test_registry.py +0 -0
- {nighthawk_python-0.7.0 → nighthawk_python-0.8.0}/tests/tools/test_tool_boundary.py +0 -0
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.8.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Unit tests covering prompt token-budget injection: system prompt resolves `$tool_result_max_tokens`, and custom user prompt templates can resolve the same placeholder.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Default step system prompt now states that tool result `value` is a preview and includes the injected max-token limit.
|
|
17
|
+
- User prompt template rendering now uses `Template.safe_substitute`, aligned with system prompt injection behavior and compatible with optional `$tool_result_max_tokens` placeholders.
|
|
18
|
+
|
|
10
19
|
## [0.7.0]
|
|
11
20
|
|
|
12
21
|
### Added
|
|
@@ -118,8 +127,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
118
127
|
- Step executor abstraction and provider integration foundation.
|
|
119
128
|
- Core documentation and project scaffolding.
|
|
120
129
|
|
|
121
|
-
[Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.
|
|
122
|
-
[0.
|
|
130
|
+
[Unreleased]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.8.0...HEAD
|
|
131
|
+
[0.8.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.7.0...v0.8.0
|
|
132
|
+
[0.7.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.6.1...v0.7.0
|
|
123
133
|
[0.6.1]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.6.0...v0.6.1
|
|
124
134
|
[0.6.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.5.0...v0.6.0
|
|
125
135
|
[0.5.0]: https://github.com/kurusugawa-computer/nighthawk-python/compare/v0.4.0...v0.5.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nighthawk-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.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/
|
|
@@ -273,6 +273,8 @@ Do not inject untrusted raw text into Natural source. If input is user-controlle
|
|
|
273
273
|
Rules:
|
|
274
274
|
|
|
275
275
|
- The model sees callable signatures from both LOCALS and GLOBALS.
|
|
276
|
+
- For object read bindings, the model also sees a capability view: object header, public methods (with signatures), and public fields (with typed previews).
|
|
277
|
+
- Object capability views expose public members only. Private/dunder members are omitted, and properties are not evaluated.
|
|
276
278
|
- Put per-invocation data in function parameters. Put stable, reusable capabilities at module level.
|
|
277
279
|
- Do not annotate callable parameters as `object` or `Any` -- this erases the signature the model needs:
|
|
278
280
|
|
|
@@ -103,7 +103,7 @@ The condensed coding agent guide (`for-coding-agents.md`) is a derivative docume
|
|
|
103
103
|
- `step_user_prompt_template`: user prompt template.
|
|
104
104
|
- `StepContextLimits`
|
|
105
105
|
- Limits for rendering dynamic context into the LLM prompt.
|
|
106
|
-
- Fields: `locals_max_tokens`, `locals_max_items`, `globals_max_tokens`, `globals_max_items`, `value_max_tokens`, `tool_result_max_tokens`.
|
|
106
|
+
- Fields: `locals_max_tokens`, `locals_max_items`, `globals_max_tokens`, `globals_max_items`, `value_max_tokens`, `object_max_methods`, `object_max_fields`, `object_field_value_max_tokens`, `tool_result_max_tokens`.
|
|
107
107
|
- `JsonableValue`
|
|
108
108
|
- Type alias for JSON-serializable Python values (`dict | list | str | int | float | bool | None`).
|
|
109
109
|
- `ExecutionContext`
|
|
@@ -254,12 +254,49 @@ Ordering:
|
|
|
254
254
|
|
|
255
255
|
Rendering format:
|
|
256
256
|
|
|
257
|
-
-
|
|
257
|
+
- `TypeAliasType` values (PEP 695): `name: type = underlying_type`.
|
|
258
258
|
- Callable values: `name: (signature)`, where `(signature)` is the result of `inspect.signature`. Type annotations are included when available (e.g., `(base: int, bonus: int) -> int`).
|
|
259
259
|
- If the callable has a meaningful docstring, the first line is appended as `# first_line`.
|
|
260
|
-
- If
|
|
260
|
+
- If the callable is async, `async` is appended in metadata comments.
|
|
261
|
+
- If multiple callable entries share the same signature text, each is annotated with `# disambiguation: use name`.
|
|
261
262
|
- If the signature cannot be resolved (e.g., `__signature__` raises), the entry renders as `name: <callable; signature-unavailable>`.
|
|
262
|
-
-
|
|
263
|
+
- Object capability values (non-callable, non-scalar, non-container values):
|
|
264
|
+
- Header line: `name: object = TypeName`.
|
|
265
|
+
- Public method lines: `name.method: (signature)` using callable rules above.
|
|
266
|
+
- Public field lines: `name.field: type_name = json_value`.
|
|
267
|
+
- Public means names that do not start with `_`; private and dunder names are excluded.
|
|
268
|
+
- Properties are not evaluated.
|
|
269
|
+
- Field discovery uses safe sources: instance `__dict__`, dataclass fields, Pydantic model fields, and readable public `__slots__` entries.
|
|
270
|
+
- Class attributes that are public and non-callable are included as fields.
|
|
271
|
+
- Method expansion is bounded by `context_limits.object_max_methods`; field expansion is bounded by `context_limits.object_max_fields`; each field value preview is bounded by `context_limits.object_field_value_max_tokens`.
|
|
272
|
+
- If object member limits are exceeded, explicit omission lines are added: `name.<methods>: <snipped N public methods>` and/or `name.<fields>: <snipped N public fields>`.
|
|
273
|
+
- Other non-callable values: `name: type_name = json_value`, where `json_value` is bounded by `context_limits.value_max_tokens`.
|
|
274
|
+
|
|
275
|
+
Callable disambiguation considers both top-level callable entries and object method entries in the same section.
|
|
276
|
+
|
|
277
|
+
Ordering:
|
|
278
|
+
|
|
279
|
+
- Top-level entries are rendered in lexicographic order by top-level name.
|
|
280
|
+
- Object methods and fields are rendered in lexicographic order by member name.
|
|
281
|
+
- Methods are rendered before fields for each object entry.
|
|
282
|
+
- If a section-level budget prevents rendering all top-level entries, `<snipped>` is appended at the end of the section.
|
|
283
|
+
|
|
284
|
+
Safety:
|
|
285
|
+
|
|
286
|
+
- Prompt rendering does not call user methods.
|
|
287
|
+
- Prompt rendering does not evaluate properties or descriptors requiring attribute execution.
|
|
288
|
+
- Slot and field access failures are ignored for rendering purposes.
|
|
289
|
+
|
|
290
|
+
Token budgeting:
|
|
291
|
+
|
|
292
|
+
- Section budgets remain governed by `locals_max_tokens` / `globals_max_tokens` and item budgets by `locals_max_items` / `globals_max_items`.
|
|
293
|
+
- Object method and field expansion is additionally governed by object-specific limits listed above.
|
|
294
|
+
- Line-level token counting includes newline separators during budget checks.
|
|
295
|
+
|
|
296
|
+
Observability:
|
|
297
|
+
|
|
298
|
+
- Section-level token truncation emits `prompt_context_truncated` logs with section, reason, and configured max token details.
|
|
299
|
+
- Object member omission due to object-specific member limits does not emit a separate log event.
|
|
263
300
|
|
|
264
301
|
Truncation:
|
|
265
302
|
|
|
@@ -421,7 +458,7 @@ Atomicity requirement:
|
|
|
421
458
|
#### 8.3.1. Supporting types (internal)
|
|
422
459
|
|
|
423
460
|
- `ToolBoundaryError`: Exception carrying `kind` (ErrorKind), `message`, and optional `guidance`. Raised by tool implementations to signal structured failures.
|
|
424
|
-
- `ToolResultRenderingPolicy`: Frozen dataclass controlling how tool
|
|
461
|
+
- `ToolResultRenderingPolicy`: Frozen dataclass controlling how tool result previews are rendered (tokenizer encoding name, max tokens, JSON renderer style).
|
|
425
462
|
|
|
426
463
|
### 8.4. Execution contract (final JSON)
|
|
427
464
|
|
|
@@ -691,7 +728,7 @@ Instance attributes:
|
|
|
691
728
|
- `configuration: StepExecutorConfiguration` — the resolved configuration.
|
|
692
729
|
- `agent_is_managed: bool` — `True` when the agent was built internally from the configuration, `False` when provided externally via `from_agent`.
|
|
693
730
|
- `token_encoding` — tiktoken encoding resolved from the configuration.
|
|
694
|
-
- `tool_result_rendering_policy: ToolResultRenderingPolicy` — policy for rendering tool
|
|
731
|
+
- `tool_result_rendering_policy: ToolResultRenderingPolicy` — policy for rendering tool result previews, derived from configuration.
|
|
695
732
|
|
|
696
733
|
### 14.3. Custom backends
|
|
697
734
|
|
|
@@ -22,4 +22,4 @@ Trust boundaries:
|
|
|
22
22
|
|
|
23
23
|
Notes:
|
|
24
24
|
- In async Natural functions, expressions may use `await`.
|
|
25
|
-
- Tool calls return {"value": ..., "error": ...}
|
|
25
|
+
- Tool calls return {"value": ..., "error": ...}; "value" is a preview (max $tool_result_max_tokens tokens), so persist large/intermediate data via nh_assign and inspect with focused nh_eval reads.
|
|
@@ -32,7 +32,7 @@ Trust boundaries:
|
|
|
32
32
|
|
|
33
33
|
Notes:
|
|
34
34
|
- In async Natural functions, expressions may use `await`.
|
|
35
|
-
- Tool calls return {"value": ..., "error": ...}
|
|
35
|
+
- Tool calls return {"value": ..., "error": ...}; "value" is a preview (max $tool_result_max_tokens tokens), so persist large/intermediate data via nh_assign and inspect with focused nh_eval reads.
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
38
|
|
|
@@ -81,8 +81,11 @@ class StepContextLimits(BaseModel):
|
|
|
81
81
|
locals_max_items: Maximum items rendered in the locals section.
|
|
82
82
|
globals_max_tokens: Maximum tokens for the globals section.
|
|
83
83
|
globals_max_items: Maximum items rendered in the globals section.
|
|
84
|
-
value_max_tokens: Maximum tokens for a single value
|
|
85
|
-
|
|
84
|
+
value_max_tokens: Maximum tokens for a single value preview.
|
|
85
|
+
object_max_methods: Maximum public methods rendered for one object capability view.
|
|
86
|
+
object_max_fields: Maximum public fields rendered for one object capability view.
|
|
87
|
+
object_field_value_max_tokens: Maximum tokens for one object field value preview.
|
|
88
|
+
tool_result_max_tokens: Maximum tokens for a tool result preview.
|
|
86
89
|
"""
|
|
87
90
|
|
|
88
91
|
model_config = ConfigDict(extra="forbid", frozen=True)
|
|
@@ -94,6 +97,9 @@ class StepContextLimits(BaseModel):
|
|
|
94
97
|
globals_max_items: int = Field(default=40, ge=1)
|
|
95
98
|
|
|
96
99
|
value_max_tokens: int = Field(default=200, ge=1)
|
|
100
|
+
object_max_methods: int = Field(default=16, ge=0)
|
|
101
|
+
object_max_fields: int = Field(default=16, ge=0)
|
|
102
|
+
object_field_value_max_tokens: int = Field(default=120, ge=1)
|
|
97
103
|
tool_result_max_tokens: int = Field(default=1_200, ge=1)
|
|
98
104
|
|
|
99
105
|
|