KeiSeiKit-1.0/hooks/agent-capability-verify.sh
Parfii-bot 0be354a920 KeiSeiKit-public — clean state
Single-commit clean baseline after security scrub of niche-tells,
project codenames, internal jargon, and contributor-email leaks.

Contents:
- 100 Rust crates (_primitives/_rust/)
- 37 agent manifests (_manifests/) + generated specs (_generated/)
- 67 user-invocable skills (skills/)
- 33 hooks (hooks/)
- Composition blocks (_blocks/)
- Documentation (docs/, README.md)
- TS adapter packages (_ts_packages/)
- Assembler (_assembler/)
- Roles (_roles/)
- Templates (_templates/)
- Forgejo CI (.forgejo/)

Author: Denis Parfionovich <info@greendragon.info>

License: see LICENSE.
2026-05-01 12:09:03 +08:00

29 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# agent-capability-verify.sh — orchestrator-driven verify glue (phase 4).
#
# Called by the orchestrator after agent return (NOT by Claude Code's
# hook protocol directly). The orchestrator sets the full context in env:
# KEI_CAPABILITY_NAME — e.g. "quality::cargo-check-green"
# AGENT_ID — ledger agent id
# TASK_TOML — path to task.toml (parameterizes scope/output caps)
# WORKTREE_PATH — agent's worktree
# MAIN_REPO — orchestrator's main repo root
# RUN_MODE — worktree | simulated-merge
#
# Passes through stdin, stdout, exit code from kei-capability verify.
# Fail-open on missing binary (exit 0 + stderr note) — same convention as
# the check side; absence of the adapter must not crash the merge ceremony.
#
# See docs/AGENT-SUBSTRATE-SCHEMA.md §Verify execution.
set -eu
CAP="${KEI_CAPABILITY_NAME:-}"
if [ -z "$CAP" ]; then
echo "[agent-capability-verify] KEI_CAPABILITY_NAME unset — nothing to verify" >&2
exit 0
fi
command -v kei-capability >/dev/null 2>&1 || {
echo "[agent-capability-verify] kei-capability binary not in PATH — fail-open pass-through" >&2
exit 0
}
exec kei-capability verify "$CAP"