feat: add production assurance dashboard flow

This commit is contained in:
thanhnv
2026-07-28 21:49:15 +07:00
parent ee5d1f7af5
commit cce3cbfd42
39 changed files with 1873 additions and 91 deletions
+28 -2
View File
@@ -75,7 +75,8 @@ Commands:
init [--runtime managed|vendored] Adopt/reconfigure CASAN (interactive wizard by default)
uninstall [--purge] Remove CASAN from this project (preserves user config)
doctor [--client ...] Verify configured hooks, pin, adapters, and VS Code route
level <show|set 1..4> Show / change the project's packaging level
edition <show|set> Show / change the product edition
level <show|set 1..4> Deprecated alias for edition
verify-harness Verify the resolved harness matches the project pin
run <in> <out> [action] [-- cmd...] Run a step through the harness (H4→H5→H6→exec→H4-out)
gate Run production checks from the project manifest
@@ -85,8 +86,11 @@ Commands:
project init <scaffold args...> Create an idempotent NestJS/React project shell
prompt verify Verify the adopted prompt-enforcement contract
prompt trace <trace-id> Verify that a prompt trace is H1-H7 certified
report latest [--json] Show the latest prompt assurance receipt
report export [trace] [--format] Export a trace snapshot on demand
view [trace-id] Open a trace in the enrolled Control Plane
pipeline [--manifest path] Run the manifest-driven SRS→test pipeline
dashboard [port] Serve the AgentOps dashboard (Platform only)
dashboard <start|status|stop|open> Run the local Control Plane (Platform only)
version Print version
help This help
@@ -120,6 +124,15 @@ case "$cmd" in
exec python3 "$DEVKIT_ROOT/casan-init.py" init --level "$n" "$@" ;;
*) echo "casan: usage: casan level <show|set <1..4>>" >&2; exit 64 ;;
esac ;;
edition)
[[ -f "$DEVKIT_ROOT/casan-init.py" ]] || { echo "casan: edition requires the casan-devkit package" >&2; exit 1; }
sub="${1:-show}"; shift || true
case "$sub" in
show) exec python3 "$DEVKIT_ROOT/casan-init.py" edition --show "$@" ;;
set) name="${1:-core}"; shift || true
exec python3 "$DEVKIT_ROOT/casan-init.py" init --edition "$name" "$@" ;;
*) echo "casan: usage: casan edition <show|set <core|devkit|platform|enterprise>>" >&2; exit 64 ;;
esac ;;
run) exec bash "$BASH_DIR/casan-harness.sh" "$@" ;;
gate)
if [[ -z "${CASAN_PROJECT_MANIFEST:-}${CASAN_PROJECT_ID:-}" \
@@ -155,11 +168,24 @@ case "$cmd" in
exec bash "$BASH_DIR/prompt-enforcement-verify.sh" --root "$CASAN_APP_ROOT" --trace-id "$trace_id" "$@" ;;
*) echo "casan: usage: casan prompt <verify|trace>" >&2; exit 64 ;;
esac ;;
report)
sub="${1:-latest}"; shift || true
case "$sub" in
latest) exec python3 "$HARNESS/scripts/python/report_cli.py" --root "$CASAN_APP_ROOT" latest "$@" ;;
export) exec python3 "$HARNESS/scripts/python/report_cli.py" --root "$CASAN_APP_ROOT" export "$@" ;;
*) echo "casan: usage: casan report <latest|export>" >&2; exit 64 ;;
esac ;;
view)
exec python3 "$HARNESS/scripts/python/report_cli.py" --root "$CASAN_APP_ROOT" view "$@" ;;
pipeline)
RUNNER="$CASAN_APP_ROOT/scripts/run-casan-pipeline.mjs"
[[ -f "$RUNNER" ]] || { echo "casan: pipeline runner is not installed" >&2; exit 1; }
exec node "$RUNNER" "$@" ;;
dashboard)
CONTROL_PLANE_SCRIPT="$HARNESS/../casan-control-panel/scripts/control-plane-local.sh"
if [[ -f "$CONTROL_PLANE_SCRIPT" ]]; then
exec bash "$CONTROL_PLANE_SCRIPT" "$@"
fi
[[ -f "$BASH_DIR/dashboard-serve.sh" ]] || {
echo "casan: dashboard requires the Platform bundle" >&2
exit 1