Skip to content

chore(aiagents): drop hooks-state.json cache, make reconcile stateless#84

Open
swarit-stepsecurity wants to merge 1 commit into
step-security:mainfrom
swarit-stepsecurity:swarit/chore/stateless-hooks
Open

chore(aiagents): drop hooks-state.json cache, make reconcile stateless#84
swarit-stepsecurity wants to merge 1 commit into
step-security:mainfrom
swarit-stepsecurity:swarit/chore/stateless-hooks

Conversation

@swarit-stepsecurity
Copy link
Copy Markdown
Member

The managed entry in settings.json (claude-code) or config.toml (codex) is already the only thing that controls whether the hot path runs — if the entry is present, claude-code spawns the binary; if not, it doesn't. The parallel ~/.stepsecurity/hooks-state.json enable flag added a third state ("installed but disabled") that doesn't exist from the agent's perspective and that the hot path paid a process spawn + file read to honor.

Removes the cache file, its schema types, and the hot-path Read; the reconciler now just fetches and calls Install/Uninstall (both already idempotent). Verified end-to-end on the Ubuntu test VM: cache file is not recreated, settings.json entries remain intact, telemetry uploads succeed.

What does this PR do?

Type of change

  • Bug fix
  • Enhancement
  • Documentation

Testing

  • Tested on macOS (version: ___)
  • Binary runs without errors: ./stepsecurity-dev-machine-guard --verbose
  • JSON output is valid: ./stepsecurity-dev-machine-guard --json | python3 -m json.tool
  • No secrets or credentials included
  • Lint passes: make lint
  • Tests pass: make test

Related Issues

The managed entry in settings.json (claude-code) or config.toml (codex) is
already the only thing that controls whether the hot path runs — if the
entry is present, claude-code spawns the binary; if not, it doesn't. The
parallel `~/.stepsecurity/hooks-state.json` enable flag added a third
state ("installed but disabled") that doesn't exist from the agent's
perspective and that the hot path paid a process spawn + file read to
honor.

Removes the cache file, its schema types, and the hot-path Read; the
reconciler now just fetches and calls Install/Uninstall (both already
idempotent). Verified end-to-end on the Ubuntu test VM: cache file is
not recreated, settings.json entries remain intact, telemetry uploads
succeed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant