|
|
@@ -91,6 +91,18 @@ COMMANDS=(
|
|
|
"git pull --rebase origin master"
|
|
|
"git diff --stat"
|
|
|
"docker exec household-mysql mysql -e 'SELECT COUNT(*) FROM center_orders'"
|
|
|
+ "go build ./cmd/app"
|
|
|
+ "go vet ./internal/pkg/..."
|
|
|
+ "pnpm install --frozen-lockfile"
|
|
|
+ "pnpm run typecheck:ci"
|
|
|
+ "git status --short"
|
|
|
+ "git stash && git pull && git stash pop"
|
|
|
+ "mysql -h127.0.0.1 -uhousehold -p**** household -e 'OPTIMIZE TABLE center_orders'"
|
|
|
+ "curl -s -o /dev/null -w '%{time_total}' http://127.0.0.1:8081/api/v1/orders/123"
|
|
|
+ "go tool pprof -top /tmp/cpu.prof"
|
|
|
+ "git tag v1.9.2 && git push origin v1.9.2"
|
|
|
+ "redis-cli -n 3 dbsize"
|
|
|
+ "journalctl -u backend-admin --since today --no-pager | grep -i error"
|
|
|
)
|
|
|
COMMAND_OUT=(
|
|
|
"ok 0.231s"
|
|
|
@@ -117,6 +129,18 @@ COMMAND_OUT=(
|
|
|
"Updating 8f3a2d1..c1e9b77 · 2 files changed, 41 insertions(+), 3 deletions(-)"
|
|
|
"internal/router/route.go +3 · internal/pkg/notify/notify.go +96 · 2 files changed"
|
|
|
"COUNT(*) = 128420 · +312 today, no archive lag"
|
|
|
+ "ok git.ooo.ink/household/app 0.18s"
|
|
|
+ "ok 0.421s"
|
|
|
+ "pnpm: All dependencies are up to date (resolved in 6.2s)"
|
|
|
+ "✓ 214 files checked, no type errors"
|
|
|
+ " M internal/pkg/notify/notify.go · ?? docs/api/notify.md"
|
|
|
+ "Auto-merging internal/pkg/notify/notify.go · stash applied, 1 conflict auto-resolved"
|
|
|
+ "Table optimized · freed 118MB · fragmentation 0%"
|
|
|
+ "0.184s"
|
|
|
+ "concatstrings 12% · encoding/json.Encode 8% · runtime.mallocgc 6% · (42 nodes)"
|
|
|
+ "* [new tag] v1.9.2 -> v1.9.2"
|
|
|
+ "12840"
|
|
|
+ "0 matches · clean today"
|
|
|
)
|
|
|
|
|
|
# ---- Standalone lines (tool returns / logs / a few AI actions) ----
|
|
|
@@ -195,6 +219,22 @@ STANDALONE=(
|
|
|
"[perf] slow-query log (1h) → 0 entries above 100ms · indexes effective under new partition layout"
|
|
|
"[warn] disk usage /var 78% · logrotate daily, expect stable below 85%"
|
|
|
"[err] worker#2 panic recovered · 1 job lost, requeued to DLQ for manual review"
|
|
|
+ "[ci] pipeline #417 → all 12 jobs passed · 4m12s, zero flakes this week"
|
|
|
+ "[review] PR #318 → 2 approvals · comments resolved, codeowner sign-off in"
|
|
|
+ "[lint] govulncheck ./... → 0 known vulnerabilities · scan 20s"
|
|
|
+ "[test] coverage diff +3.2% on notify pkg · overall 87.4% maintained"
|
|
|
+ "[race] go test -race ./... → ok · 0 races across 6 packages"
|
|
|
+ "[db] EXPLAIN SELECT ... WHERE created_at > now() → uses orders_idx_created · no temp table"
|
|
|
+ "[redis] INFO stats → hits 92.4% misses 7.6% · evictions 0 in last 24h"
|
|
|
+ "[metrics] Prometheus scrape → 214 series healthy · 3 targets up, 0 down"
|
|
|
+ "[backup] restore dry-run on staging → 47/47 tables verified, checksum match"
|
|
|
+ "[i18n] en/ja/zh-cn locales in sync · 98 strings, 0 missing keys"
|
|
|
+ "[migrate] down migration ran on staging → reversible, schema back to prior state"
|
|
|
+ "[cron] daily order reconciliation → 0 mismatches · settled + unpaid tallied"
|
|
|
+ "[cache] warmup on deploy → 8.2k keys preloaded in 2.1s · cold-hit avoided"
|
|
|
+ "[security] zap scan → 0 high, 3 medium (info-leak headers) · tracked in backlog"
|
|
|
+ "[sso] token refresh job → ok · 214 sessions rotated, none expired mid-flight"
|
|
|
+ "[observability] trace sample rate 5% · p95 spans < 800ms across service mesh"
|
|
|
)
|
|
|
|
|
|
# 输出/日志/错误行(可重复,作为“裸输出”随机插入)
|
|
|
@@ -227,6 +267,19 @@ OUTPUTS=(
|
|
|
"Test run finished: 3 passed, 0 failed"
|
|
|
"security scan: 0 critical, 2 medium findings"
|
|
|
"cache flushed"
|
|
|
+ "up to date"
|
|
|
+ "done · 0 errors"
|
|
|
+ "Build successful"
|
|
|
+ "ok (10 tests)"
|
|
|
+ "WARN: slow query detected (1.2s > 100ms threshold)"
|
|
|
+ "ERROR: cannot allocate memory in thread cache"
|
|
|
+ "fatal: unable to access remote: Could not resolve host"
|
|
|
+ "test: all passed"
|
|
|
+ "checks passed: 6/6"
|
|
|
+ "Deploy aborted: health check failed"
|
|
|
+ "200 OK (cached)"
|
|
|
+ "gzip: 1.9MB → 610KB saved"
|
|
|
+ "→ build #417 succeeded in 24.8s"
|
|
|
)
|
|
|
|
|
|
# 动态随机数字行(消除固定值反复出现)
|
|
|
@@ -314,7 +367,7 @@ rand_delay() {
|
|
|
colorize() {
|
|
|
case "$1" in
|
|
|
'$ '*) printf '\033[1;36m%s\033[0m' "$1" ;;
|
|
|
- *FATAL*) printf '\033[1;31m%s\033[0m' "$1" ;;
|
|
|
+ *[Ff][Aa][Tt][Aa][Ll]*) printf '\033[1;31m%s\033[0m' "$1" ;;
|
|
|
*ERROR* | *ERR:* | *\[err\]* | *err:*) printf '\033[31m%s\033[0m' "$1" ;;
|
|
|
*warn* | *WARN*) printf '\033[33m%s\033[0m' "$1" ;;
|
|
|
*'✓'* | *PASS* | *'ok '* | *'HTTP 200'* | *PONG* | *'no type errors'* | *'completed successfully'* | *'Build succeeded'*) printf '\033[32m%s\033[0m' "$1" ;;
|