Files
boshu2__agentops/cli/embedded
Bo 56e4fde894 Harden .agents policy hook handling (#314)
## Summary
- make `dangerous-git-guard.sh` block staged `.agents/` additions only
when Git ignore policy marks the path as runtime state
- make `session-start.sh` avoid injecting a root `/.agents/` blanket
when a co-located `.agents/.gitignore` already owns the local policy
- sync embedded hook copies and add BATS coverage for ignored runtime
paths and child-policy allowlists

Tracked from Mt Olympus bead `mo-a1enre`.

## Validation
- `bats --filter 'session-start|dangerous-git-guard'
tests/hooks/test-hooks.bats`
- `bats --filter 'dangerous-git-guard'
tests/hooks/hook-stdin-contracts.bats`
- `shellcheck -S warning hooks/dangerous-git-guard.sh
hooks/session-start.sh cli/embedded/hooks/dangerous-git-guard.sh
cli/embedded/hooks/session-start.sh`
- `bash scripts/validate-hooks-doc-parity.sh`
- `bash scripts/test-hooks-output.sh`
- `scripts/validate-embedded-sync.sh`
- `git diff --check`
- `scripts/pre-push-gate.sh --fast` (passed; known warn-only
executable-spec messages for `scenarios --lint` and `trace --orphans`)

Co-authored-by: Codex <codex@example.invalid>
2026-05-18 09:46:41 -04:00
..