Skip to content

fix(guard): tighten runtime hook state handling#1046

Merged
kantorcodes merged 3 commits into
mainfrom
capy/fix-posttool-package-check
Jun 22, 2026
Merged

fix(guard): tighten runtime hook state handling#1046
kantorcodes merged 3 commits into
mainfrom
capy/fix-posttool-package-check

Conversation

@capy-ai

@capy-ai capy-ai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • tighten post-execution hook state handling
  • add regression coverage for runtime artifact routing

Testing

  • uv run pytest -q tests/test_guard_runtime.py -k 'routes_post_tool_package_installs_without_pretool_decision or does_not_requeue_package_request_after_pretool_block or routes_package_installs_to_package_request'

Open POINT-023 POINT-023

Co-authored-by: kantorcodes <6068672+kantorcodes@users.noreply.github.com>
@capy-ai capy-ai Bot added the capy Generated by capy.ai label Jun 21, 2026
@capy-ai capy-ai Bot changed the title fix(guard): restore proper package request evaluation fix(guard): tighten runtime hook state handling Jun 21, 2026
@greptile-apps

greptile-apps Bot commented Jun 21, 2026

Copy link
Copy Markdown

Greptile Summary

Tightens runtime hook state handling for post-tool package install checks.
Normalizes camelCase preExecutionResult into the internal pre_execution_result field.
Preserves duplicate suppression when post-tool payloads already carry a pre-tool decision.
Adds regression coverage for package request routing and pre-tool block handling.

Confidence Score: 5/5

The changes are narrowly scoped to runtime hook state handling and are covered by targeted regression tests.

No correctness issues were identified in the modified hook payload/artifact routing paths, and the included tests exercise the relevant package-request and pre-tool decision scenarios.

T-Rex T-Rex Logs

What T-Rex did

  • Before the change, the base did not route the no-pretool PostToolUse npm install to package_request and did not normalize preExecutionResult into pre_execution_result.
  • After the change, the head creates a package_request for npm install react@18.3.0.
  • The pre_execution_result is normalized to 'block'.
  • The system suppresses duplicate artifact creation for the already-blocked install.
  • Two targeted pytest regressions were successfully passed.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "fix: handle camelcase hook pre-exec deci..." | Re-trigger Greptile

Co-authored-by: kantorcodes <6068672+kantorcodes@users.noreply.github.com>
Co-authored-by: kantorcodes <6068672+kantorcodes@users.noreply.github.com>
@internet-dot internet-dot enabled auto-merge (squash) June 22, 2026 01:51
@kantorcodes kantorcodes disabled auto-merge June 22, 2026 09:37
@kantorcodes kantorcodes merged commit 8a8f75f into main Jun 22, 2026
21 of 22 checks passed
@kantorcodes kantorcodes deleted the capy/fix-posttool-package-check branch June 22, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant