feat(ai-env): write runbooks and prompt context in Japanese, set HITL_LANG=ja
ランブック 11 本と prompts/topology.md・slo.md を日本語で書き直し、 system.md に「根拠と判断理由は日本語で書く」指示を追加した。 Discord ボットの文言も HITL_LANG=ja で日本語になる。 識別子(action id、ラベル、メトリクス名、オブジェクト名)は英語のまま。
This commit is contained in:
1 parent
027e896f30
commit
364654bb2c
16 files changed
+48
-45
No files matched your search
@@ -1,4 +1,4 @@
|
||||
Availability: avg_over_time(probe_success[5m]) >= 99.5% over the campaign. Latency: api p95 (histogram_quantile(0.95, sum by (le) (rate(demo_http_request_duration_seconds_bucket[5m])))) < 0.5 s. Error ratio: 5xx / all over 5 minutes < 1%.
|
||||
Recovery (t_recover) is declared by the harness when the probe succeeds 12 times in a row (3 minutes) and latency and error ratio are back inside the SLO over a 5-minute window.
|
||||
Layers: 1 = platform-internal automatic recovery (kubelet restart, ReplicaSet, Argo CD selfHeal, MIG autohealing, compose restart). 2 = your proposal + human approval in Discord, executed by the harness. 3 = human-only (irreversible actions, no approval within 15 minutes, confidence below 0.5).
|
||||
Alert rules and what they mean: ProbeDown (probe_success == 0 for 1 min, symptom only), ApiLatencyHigh (p95 > 500 ms for 3 min), ApiErrorRateHigh (5xx > 1% for 3 min), PodCrashLooping (3+ restarts in 5 min; layer 1 first, layer 2 after 5 min), LegacyUnhealthy (fewer than 2 legacy-api instances up; autohealing first, layer 2 after 10 min), DbReplicationLag (lag > 60 s or replay paused), DbPrimaryDown (TCP 5432 failing for 1 min), GitOpsDrift (OutOfSync 5 min; selfHeal handles it).
|
||||
可用性: キャンペーン期間を通じて avg_over_time(probe_success[5m]) >= 99.5%。レイテンシ: api の p95(histogram_quantile(0.95, sum by (le) (rate(demo_http_request_duration_seconds_bucket[5m]))))が 0.5 秒未満。エラー率: 5 分間の 5xx / 全リクエストが 1% 未満。
|
||||
復旧(t_recover)は、プローブが 12 回連続(3 分)で成功し、かつ 5 分窓のレイテンシとエラー率が SLO の内側に戻ったときにハーネスが宣言する。
|
||||
層: 1 = プラットフォーム内部の自動復旧(kubelet の再起動、ReplicaSet、Argo CD selfHeal、MIG autohealing、compose の restart)。2 = あなたの提案 + Discord での人の承認、実行はハーネス。3 = 人だけが行う(不可逆な操作、15 分以内に承認がない場合、確信度 0.5 未満)。
|
||||
アラートルールと意味: ProbeDown(probe_success == 0 が 1 分、症状のみ)、ApiLatencyHigh(p95 > 500 ms が 3 分)、ApiErrorRateHigh(5xx > 1% が 3 分)、PodCrashLooping(5 分で 3 回以上の再起動。まず層 1、5 分後に層 2)、LegacyUnhealthy(up な legacy-api インスタンスが 2 未満。まず autohealing、10 分後に層 2)、DbReplicationLag(遅延 > 60 秒、または replay が一時停止)、DbPrimaryDown(TCP 5432 の失敗が 1 分)、GitOpsDrift(OutOfSync が 5 分。selfHeal が処理する)。
|
||||
@@ -8,6 +8,7 @@ Role and constraints:
|
||||
5. Set confidence honestly. Below 0.5 the case goes to a human without a proposal. Use "unknown" when the evidence does not support any label.
|
||||
6. Keep rationale under 200 characters. Target must be the exact object name the harness needs: "demo/api" or "api" for deployments, a node name for drain, a pet VM name (selfheal-db-replica) or legacy instance name (legacy-xxxx) for GCE actions.
|
||||
7. Call submit_diagnosis exactly once, after at most a handful of tool calls. Do not write prose answers.
|
||||
8. Language: write every free-text field of submit_diagnosis (each evidence entry and the rationale) in Japanese, in the plain style an SRE would use in an incident channel. Keep identifiers as they are: label enum values, action ids, metric names, PromQL, object names, log lines you quote, numbers and units. The runbooks you retrieve are written in Japanese; quote them as they are.
|
||||
|
||||
Label hints (ground truth labels of the scenario catalogue):
|
||||
- api_pod_killed: one api pod killed, ReplicaSet recreates it (layer 1, usually none).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Container layer (AWS Tokyo, kubeadm v1.37, flannel): control plane ip-10-10-0-10 (10.10.0.10, API 6443), workers ip-10-10-10-11, ip-10-10-10-12, ip-10-10-11-11. Namespace demo: Deployment front (2 replicas, nginx) and api (3 replicas, Go) behind ingress-nginx; ALB forwards to NodePort 30080 on the workers; path /api/* -> api, / -> front. Argo CD (namespace argocd) syncs everything from the public gitops repository with selfHeal and prune. Chaos Mesh in namespace chaos-mesh injects faults during campaigns.
|
||||
VM layer (GCP Tokyo, subnet 10.20.0.0/20): observability VM selfheal-obs 10.20.0.10 (Mimir 9009, Loki 3100, Tempo 4317, Grafana 3000); harness VM selfheal-harness 10.20.0.11 (runner 8080, blackbox probes, k6 load); AI VM selfheal-ai 10.20.0.12 (this agent); PostgreSQL primary selfheal-db-primary 10.20.0.20 and streaming replica selfheal-db-replica 10.20.0.21 (role app, database app, table app.price); legacy-api runs in docker compose on the MIG selfheal-legacy-mig (2 instances named legacy-xxxx, port 8080) behind the internal load balancer 10.20.0.100:8080 with autohealing.
|
||||
Request path: client -> ALB -> ingress-nginx -> api pod -> (VPN) -> ILB 10.20.0.100 -> legacy-api -> db-primary. The two clouds are joined by an HA VPN (4 tunnels, BGP); AWS 10.10.0.0/16 <-> GCP 10.20.0.0/20.
|
||||
Synthetic probes (blackbox on the harness, every 15 s): target=alb (GET http://<ALB>/api/orders), target=db-primary (TCP 10.20.0.20:5432).
|
||||
コンテナ層(AWS 東京、kubeadm v1.37、flannel): コントロールプレーン ip-10-10-0-10(10.10.0.10、API 6443)、ワーカー ip-10-10-10-11、ip-10-10-10-12、ip-10-10-11-11。namespace demo には Deployment front(2 replicas、nginx)と api(3 replicas、Go)があり、ingress-nginx の後ろで動く。ALB はワーカーの NodePort 30080 に転送し、パス /api/* は api、/ は front に向く。Argo CD(namespace argocd)は公開 gitops リポジトリから selfHeal と prune 付きで全体を同期する。Chaos Mesh(namespace chaos-mesh)はキャンペーン中に障害を注入する。
|
||||
VM 層(GCP 東京、サブネット 10.20.0.0/20): 監視 VM selfheal-obs 10.20.0.10(Mimir 9009、Loki 3100、Tempo 4317、Grafana 3000)、ハーネス VM selfheal-harness 10.20.0.11(runner 8080、blackbox プローブ、k6 負荷)、AI VM selfheal-ai 10.20.0.12(このエージェント)、PostgreSQL プライマリ selfheal-db-primary 10.20.0.20 とストリーミングレプリカ selfheal-db-replica 10.20.0.21(ロール app、データベース app、テーブル app.price)。legacy-api は MIG selfheal-legacy-mig(legacy-xxxx という名前の 2 インスタンス、ポート 8080)上で docker compose として動き、内部ロードバランサ 10.20.0.100:8080 の後ろにあり、autohealing が付いている。
|
||||
リクエスト経路: クライアント -> ALB -> ingress-nginx -> api pod -> (VPN) -> ILB 10.20.0.100 -> legacy-api -> db-primary。2 つのクラウドは HA VPN(トンネル 4 本、BGP)でつながる。AWS 10.10.0.0/16 <-> GCP 10.20.0.0/20。
|
||||
合成プローブ(ハーネス上の blackbox、15 秒ごと): target=alb(GET http://<ALB>/api/orders)、target=db-primary(TCP 10.20.0.20:5432)。
|
||||
Reference in new issue
Block a user