Govern governed execute_code and fix schema hooks without early model_tools import#4
Merged
Merged
Conversation
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
execute_codeto the Hermes governed catalog (RUN_COMMANDviapython -c …) with adapter mapper, probes, and gateway E2E coverage.registry.get_definitionsandbuild_execute_code_schemainstead of importingmodel_toolsat plugin load (fixesread_terminalleaking into/v1/toolsets).hermes_argsfor validation; removeprocessfrom the governed catalog.Changes
Governance & adapter
execute_codeintools.yamlwithmapper: execute_codeandbuiltin_module: tools.code_execution_toolmap_execute_code()encodes Python aspython -c {shlex.quote(code)}forcommand_shield/ AST analysishermes_args_remainder()/_attach_hermes_args()on terminal, write_file, patch, execute_code mappersprocess(Hermes background-process tool stays native/un gated)Plugin schema finalization
registry_hook.py: wrapregistry.get_definitionsto inject requiredreasontool_definitions_hook.py: wrapbuild_execute_code_schemafor dynamic rebuild pathimport model_toolsduringregister()(avoids fulldiscover_builtin_tools())Tests & docs
execute_code(ALLOW + deterministic BLOCK viasudo)test_install_registry_hook_does_not_import_model_tools, schema hook coveragedocs/hermes-governance-execute-code-and-schema-hooks.md; updates to integration guides and READMEsTest plan
RUN_HERMES_GATEWAY_TOOLSETS=1 ./tests/scripts/test-hermes-gateway-toolsets.shHERMES_E2E_GOVERNED_TOOLS=execute_code RUN_HERMES_GATEWAY_E2E=1 ./tests/scripts/test-hermes-gateway-e2e.sh(pass 1, 2a, 2b)pr.yml— adapter, governance, plugin, gateway contract tests)RUN_HERMES_GATEWAY_E2E=1 ./tests/scripts/test-hermes-gateway-e2e.sh