refactor(core): centralize tool context runtime bindings#839
Merged
Conversation
9b9f18f to
71476dc
Compare
Move ToolUseContext runtime/service helpers out of the tool framework into a core-owned runtime binding module. Centralize pipeline, manifest description, and write preflight context materialization there as well, while preserving existing custom_data, cancellation, path policy, runtime URI, remote containment, and Deep Review hook behavior behind focused regressions and boundary checks.
71476dc to
d6a1774
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ToolUseContextruntime/service bindings out offramework.rsinto core-ownedtool_context_runtime.rs.framework.rsfocused on context shape, portable facts projection, and theTooltrait.ToolUseContextmaterialization in the same runtime binding owner.custom_datashape, same-key overwrite order, cancellation state, runtime restrictions, workspace services, and Deep Review parent-context propagation.Behavior and Boundary Notes
This remains a structure-only runtime owner closure. It does not migrate
ToolUseContext, runtime service handles, concrete tools, collapsed unlock state,GetToolSpecTool, product tool registry snapshots, or product feature/build assembly out of core.The additional tool-related cleanup only moves remaining production context construction for prompt manifest description and write preflight into the same core-owned binding module. It preserves the current field values and insertion order, including the existing
context_varsoverwrite behavior for manifest descriptioncustom_data.The latest rebase to
gcwing/maincompleted without conflicts. The latest main-side change observed in this rebase does not affect the tool-runtime plan or document assumptions.Regression Coverage
custom_datakeys and Deep Review parent metadataValidation
rustfmt --edition 2024 --check --config skip_children=true src\crates\core\src\agentic\tools\tool_context_runtime.rs src\crates\core\src\agentic\execution\execution_engine.rs src\crates\core\src\agentic\execution\round_executor.rs src\crates\core\src\agentic\tools\framework.rs src\crates\core\src\agentic\tools\pipeline\tool_pipeline.rs src\crates\core\src\agentic\tools\mod.rsnode scripts\check-core-boundaries.mjs$env:BITFUN_BOUNDARY_CHECK_SELF_TEST='1'; node scripts\check-core-boundaries.mjsgit diff --check gcwing/main..HEADcargo test -p bitfun-core tool_context_runtime -- --nocapturecargo test -p bitfun-core pipeline_preserves_core_owned_tool_context_without_portable_runtime_leak -- --nocapturecargo test -p bitfun-core shared_context_tests -- --nocapturecargo test -p bitfun-core write_preflight -- --nocapturecargo check -p bitfun-core --features product-fullcargo check -p bitfun-core --no-default-features