Files
Agent-System/scripts/arch-check.sh
weichenandCursor 84c0841acb feat(app): add composition root, stageflow, ContextUpdate, and SSE transport
Move construction and document OnOutbox out of server, give HTTP/CLI a shared task use case, and block already-cleared import/event arch rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-15 05:40:15 +00:00

40 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Architecture boundary check (U1).
# Production import / SQL write / path construction / event producer-consumer.
# Goose, *_test.go and fixtures are not production writers.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
MODE="warn"
while [[ $# -gt 0 ]]; do
case "$1" in
--mode) MODE="${2:-warn}"; shift 2 ;;
--mode=*) MODE="${1#--mode=}"; shift ;;
*) echo "usage: $0 [--mode warn|block]" >&2; exit 2 ;;
esac
done
if [[ "${MODE}" != "warn" && "${MODE}" != "block" ]]; then
echo "mode must be warn or block" >&2
exit 2
fi
cd "${ROOT}"
echo "arch-check mode=${MODE}"
echo "boundaries=${ROOT}/.doc/system-design/module-boundaries.yaml"
if ! go test ./internal/archtest -count=1; then
echo "arch-check: new, expired, or unowned findings failed go test ./internal/archtest" >&2
exit 1
fi
if [[ "${MODE}" == "block" ]]; then
if ! ARCHTEST_STRICT=1 go test ./internal/archtest -count=1 -run TestArchitectureBoundaries; then
echo "arch-check block: a cleared kind in block_kinds still has findings" >&2
exit 1
fi
fi
echo "arch-check ${MODE}: production gate passed"