AGENT SKILL

confighub-source-truth

Use when the user wants a STRATEGY-TYPED, PILOT-ACCEPTANCE-SHAPED VERDICT about whether ConfigHub / controller / runtime agree under a declared delivery strategy — the `compare source-truth` workflow with the explicit `--strategy <name>` requirement. Natural phrasing: "give me a source-truth verdict for deploy/api", "verify under git-argo strategy that ConfigHub matches the cluster", "run the source-truth contract for upstream Pilot acceptance", "compare source-truth confighub-oci-flux strategy across the namespace", "produce strategy-relative correctness evidence", "show me where the strategy declaration is being violated". Composes `compare source-truth --strategy <s>` + the source-truth evidence contract + (optionally) `receipt verify --strategy <s>` for a fingerprinted version. Requires CONNECTED MODE. Do NOT load for: a single-resource live drift question without a declared strategy (use investigate-drift), a triage (use triage-unhealthy-workload), or a fleet-wide audit that doesn't need strategy framing (use audit-fleet-conformance). cub-scout NEVER infers a strategy — this skill enforces that boundary.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 14
Forks
1

01 前言 Front Matter

name
confighub-source-truth
phase
cross-cutting
description
Use when the user wants a STRATEGY-TYPED, PILOT-ACCEPTANCE-SHAPED VERDICT about whether ConfigHub / controller / runtime agree under a declared delivery strategy — the `compare source-truth` workflow with the explicit `--strategy <name>` requirement. Natural phrasing: "give me a source-truth verdict for deploy/api", "verify under git-argo strategy that ConfigHub matches the cluster", "run the source-truth contract for upstream Pilot acceptance", "compare source-truth confighub-oci-flux strategy across the namespace", "produce strategy-relative correctness evidence", "show me where the strategy declaration is being violated". Composes `compare source-truth --strategy <s>` + the source-truth evidence contract + (optionally) `receipt verify --strategy <s>` for a fingerprinted version. Requires CONNECTED MODE. Do NOT load for: a single-resource live drift question without a declared strategy (use investigate-drift), a triage (use triage-unhealthy-workload), or a fleet-wide audit that doesn't need strategy framing (use audit-fleet-conformance). cub-scout NEVER infers a strategy — this skill enforces that boundary.
allowed-tools
Bash(./cub-scout compare source-truth *) Bash(cub-scout compare source-truth *) Bash(cub scout compare source-truth *) Bash(./cub-scout compare three-way *) Bash(cub-scout compare three-way *) Bash(cub scout compare three-way *) Bash(./cub-scout receipt verify *) Bash(cub-scout receipt verify *) Bash(cub scout receipt verify *) Bash(./cub-scout receipt show *) Bash(cub-scout receipt show *) Bash(cub scout receipt show *) Bash(./cub-scout receipt list *) Bash(cub-scout receipt list *) Bash(cub scout receipt list *) Bash(./cub-scout explain *) Bash(cub-scout explain *) Bash(cub scout explain *) Bash(./cub-scout trace *) Bash(cub-scout trace *) Bash(cub scout trace *) Bash(./cub-scout status) Bash(cub-scout status) Bash(cub scout status) Bash(kubectl get *) Bash(cub space list *) Bash(cub unit get *) Bash(cub unit list *) Bash(cub link get *) Bash(cub link list *) Bash(cub view get *) Bash(cub view list *) Bash(cub unit-event list *) Bash(cub resource list *) Bash(cub release list *) Bash(cub changeset list *) Bash(cub auth status) Bash(argocd app get *) Bash(flux get *)

03 SKILL.md 正文

confighub-source-truth

The strategy-typed source-truth loop. The operator (or an acceptance kernel like Pilot) wants a deterministic verdict about whether ConfigHub / controller / runtime agree under a declared delivery strategy. cub-scout never infers the strategy — the user passes it; the verdict is then strategy-relative.

Composes compare source-truth --strategy <s> + the source-truth evidence contract + optionally receipt verify --strategy <s> (to persist the verdict as a fingerprinted artifact).

Requires connected mode (cub auth login).

When to use

Explicit phrasings:

  • "Give me a source-truth verdict for deploy/api"
  • "Verify under git-argo strategy that ConfigHub matches the cluster"
  • "Run the source-truth contract for upstream Pilot acceptance"
  • "Compare source-truth confighub-oci-flux strategy across the namespace"
  • "Produce strategy-relative correctness evidence"
  • "Show me where the strategy declaration is being violated"
  • "Did the controller pull from the declared source?"

Implicit intents:

  • The user is operating in the architectural triad (cub-scout evidence ↔ ConfigHub authority ↔ Pilot judge); Pilot needs strategy-typed input
  • The user has a declared expectation about the delivery chain (Git→Argo, ConfigHub→OCI→Flux, etc.) and wants to check it
  • The user is gating CI / promotion on conformance with the declared strategy
  • The user wants the proof gaps surfaced explicitly (the omissions[]-style contract is the whole point)

Do not load for

  • Single-resource live drift WITHOUT a declared strategy — investigate-drift
  • Triage of a broken workload — triage-unhealthy-workload
  • Fleet-wide audit when strategy framing isn't needed — audit-fleet-conformance (which itself can compose compare source-truth per resource, but the broader-scope skill is the right entry point)
  • Incident-evidence capture after the fact — operator-incident-evidence
  • Authoring source-truth strategies. The strategy enumeration is fixed (see below); proposing new ones is a cub-scout/#393-class issue.

The nine strategies

cub-scout's source-truth contract enumerates nine strategies (Phase 1 + Phase 2 from #393 and #418). The user MUST pick one:

Strategy Delivery chain Controller
confighub-oci-argo ConfigHub authors a Unit → renders to OCI → Argo CD reads OCI → cluster Argo
confighub-oci-flux Same authoring → Flux Kustomization reads OCI → cluster Flux
git-argo Git → Argo CD → cluster (vanilla GitOps) Argo
git-flux Git → Flux → cluster Flux
helm-argo Helm chart → Argo as Helm renderer → cluster Argo
helm-flux Helm chart → Flux helm-controller → cluster Flux
kustomize-flux Kustomize base → Flux kustomize-controller → cluster Flux
oci-argo OCI artifact (non-ConfigHub) → Argo → cluster Argo
oci-flux OCI artifact (non-ConfigHub) → Flux → cluster Flux

Each strategy declares expected surfaces (which of ConfigHub / controller / runtime is required), expected controller kind (Argo vs Flux — never silently fall back), and strategy-implied authority (which surface is canonical for the comparison).

Pick by what's deployed, not by what's convenient. If the user can't name the strategy, the right answer is ASK (the contract's fourth status), not a guess.

The four statuses + five verdicts

cub-scout's source-truth contract emits two separate axes:

Status (cub-scout's evidence-quality verdict):

Status Meaning
PASS All required surfaces present, all required equalities hold, no proof gaps. Pilot may accept.
WATCH Mostly present and consistent, but at least one soft signal warrants confirmation.
BLOCK A hard rule fails (strategy mismatch, controller-source resolution failure). Must not accept.
ASK cub-scout cannot classify deterministically. Used when strategy is unknown or surfaces fundamentally cannot be compared.

Verdict (cross-surface agreement, separate from status):

Verdict Meaning
AGREED The three surfaces line up under the declared strategy
MISMATCH At least one surface diverges from the strategy-implied authority
INCOMPLETE One or more surfaces missing required proof
BLOCKED cub-scout could not fetch one of the surfaces in read-only mode
UNKNOWN cub-scout has no opinion (used in ASK)

Status and verdict ARE separate — a verdict can be MISMATCH while status is BLOCK (strategy violation) OR WATCH (soft mismatch with proof gaps). See pkg/agent/source_truth.go for the closed enums.

The loop

  1. Confirm connected mode. cub-scout status must report connected; source-truth is meaningless without all three surfaces.
  2. Declare the strategy. The user MUST pass --strategy <name>. If they don't know, the answer is ASK + UNKNOWN.
  3. Invoke per resource. cub-scout compare source-truth <kind>/<name> -n <ns> --strategy <s> --format json.
  4. Read the structured evidence. Status + verdict + outlier + proof_gaps[] + safe_next_action + the three surfaces verbatim. See scout-compare.
  5. Optionally persist as a receipt. cub-scout receipt verify <kind>/<name> -n <ns> --strategy <s> --save produces a fingerprinted, immutable version Pilot or the audit log can attach to a decision. See scout-verify.

Step-by-step

Step 1 — confirm mode

$ cub-scout status --json
{
  "mode": "connected",
  "cluster_name": "default",
  "context": "prod-use2",
  "confighub_reads": true
}

confighub_reads is the answer: it is the verdict of the same gate compare source-truth itself uses. If it is false, refuse to claim a source-truth verdict and give the user confighub_reads_reason verbatim — it names the cause (an expired session, cub not installed, or ConfigHub reads turned off), and only one of those is fixed by cub auth login. Do not read the ConfigHub: mode line as the pre-flight: it describes hub.confighub.com and can say ● Connected while every connected command refuses, or ○ Offline against a self-hosted ConfigHub whose reads work. (Against v2.12.0 or earlier, which has no confighub_reads field, the mode line is all there is.)

Step 2 — pick the strategy

Match the actual delivery chain. Look at:

  • Workload labels (argocd.argoproj.io/instance → Argo; kustomize.toolkit.fluxcd.io/name → Flux Kustomization; helm.toolkit.fluxcd.io/name → Flux HelmRelease)
  • Argo Application spec (spec.source.repoURL — git URL vs OCI URL vs Helm chart URL)
  • Flux Kustomization spec (spec.sourceRef.kind — GitRepository vs OCIRepository vs HelmRepository vs Bucket)
  • ConfigHub linkage (confighub.com/UnitSlug label, plus the unit's render target)

cub-scout explain <kind>/<name> surfaces all these in one read. From there, picking the strategy is mechanical:

You see... Strategy is...
Argo + git source git-argo
Argo + OCI source (ConfigHub-rendered) confighub-oci-argo
Argo + OCI source (non-ConfigHub) oci-argo
Argo + Helm source helm-argo
Flux Kustomization + GitRepository git-flux
Flux Kustomization + OCIRepository confighub-oci-flux (if ConfigHub-managed) or oci-flux
Flux Kustomization (any source) kustomize-flux (if specifically the kustomize rendering)
Flux HelmRelease helm-flux

Step 3 — invoke

$ cub-scout compare source-truth deploy/api -n prod --strategy git-argo --format json
{
  "declared_strategy": "Git -> Argo -> Kubernetes",
  "status": "PASS",
  "source_truth": "AGREED",
  "outlier": "unknown",
  "surfaces": {
    "confighub": {
      "space": "payments",
      "unit": "payments-api",
      "revision": "42",
      "url": "https://hub.confighub.com/p/payments/u/payments-api"
    },
    "controller": {
      "kind": "Argo",
      "source": "https://github.com/org/platform-config",
      "revision_or_digest": "abc123def456",
      "health": "Synced",
      "multi_source": false
    },
    "runtime": {
      "resource": "Deployment/api in prod",
      "field": "spec.template.spec.containers[0].image",
      "value": "ghcr.io/org/api:v2.3.0",
      "health": "Ready"
    }
  },
  "proof_gaps": [],
  "safe_next_action": ""
}

The empty proof_gaps[] is the headline. status: PASS, source_truth: AGREED, all three surfaces present. Pilot accepts.

Step 4 — when the verdict is not PASS

$ cub-scout compare source-truth deploy/api -n prod --strategy git-argo --format json
{
  "declared_strategy": "Git -> Argo -> Kubernetes",
  "status": "BLOCK",
  "source_truth": "MISMATCH",
  "outlier": "controller",
  ...
  "proof_gaps": [],
  "safe_next_action": "Argo is tracking a different revision than the controller-resolved git anchor; investigate the divergence before any apply."
}

status: BLOCK + outlier: controller = the controller is the surface diverging from the strategy-implied authority. The safe_next_action field names the next read-only step (never a mutation).

Step 5 — persist as a receipt (optional)

For Pilot acceptance kernels or audit trails:

$ cub-scout receipt verify deploy/api -n prod --strategy git-argo --save
saved: /home/user/.local/share/cub-scout/receipts/2026-05-22T10-30-00Z__source-truth-pass__Deployment-api__abc123.receipt.json

The receipt wraps the source-truth evidence (verbatim) in an in-toto Statement v1 envelope with a SHA-256 fingerprint. Strategy mismatch between the caller and the evidence body is itself a BLOCK + OmissionStrategyMismatch — see scout-verify.

Receipts are immutable. Same scope + same fingerprint at the same instant → same canonical filename → "already saved" warning (file unchanged).

Strategy-relative correctness

This is the contract's central rule: identical observations get opposite verdicts under different declared strategies.

Example: an Argo CD Application reading from a git URL.

  • Under --strategy git-argo: PASS / AGREED. Argo reads Git; Git is the declared source; cluster matches Git. All good.
  • Under --strategy confighub-oci-argo: BLOCK / MISMATCH (outlier: controller). The strategy declares Argo should be reading from a ConfigHub-rendered OCI artifact — not Git. Argo is the outlier.

Same Argo, same git, same cluster, opposite verdict. Strategy declaration changes the question.

Lock that in your head: cub-scout doesn't grade the deployment — cub-scout grades it against the declared strategy. This is why --strategy is mandatory.

Proof gaps

Even on PASS / WATCH outcomes, proof_gaps[] lists the things cub-scout couldn't fully verify:

  • controller.revision_or_digest — controller didn't expose its revision/digest
  • confighub.unit_revision — unit didn't have a revision number (rare; ConfigHub usually populates)
  • runtime.helm_chart_anchor — Helm chart version not extractable from runtime (Phase 2 strategies; the chart-version extractor isn't fully wired — see #409)
  • controller.multi_source — Argo spec.sources[] has len > 1; cub-scout uses index 0, can't verify equality across sources

Proof gaps are not failures. They're explicit non-claims (the same pattern as receipt omissions). Pilot reads them and decides whether to accept the verdict given the named gaps.

Tool boundary

  • Allowed: compare source-truth, compare three-way (for the broader DRY/WET/LIVE context); receipt verify --strategy --save, receipt show / list / validate; explain, trace, status; cub <entity> get / list for the entities named in allowed-tools; cub auth status; argocd app get, flux get.
  • Not allowed: any mutation. cub * create/update/delete, argocd app sync, flux reconcile, kubectl apply/edit/patch/delete, cub-scout demo / import apply. The verdict is evidence; remediation is the user's call (or Pilot's downstream).

Pilot integration

cub-scout's source-truth contract is the canonical input for Pilot, the architectural-triad acceptance judge tracked alongside cub-scout in #444. Pilot reads source-truth evidence + receipts and produces verdicts that gate CD / promotion / rollback / compliance.

  • cub-scout = evidence (this skill produces it)
  • ConfigHub = authority (where the unit / Link / target lives)
  • Pilot = judge (decides accept / wait / block)

For agent workflows wiring Pilot to cub-scout, see scout-mcp (Pilot can call compare_source_truth as an MCP tool) and the pilot-* skill set (planned in #444).

References

  • scout-compare — verb-group skill for the four Compare verbs
  • scout-verify — receipts as fingerprinted evidence
  • scout-govern — connected-mode trust surface
  • audit-fleet-conformance — fleet-wide composition over per-resource source-truth
  • Source-truth contract: #393 (parent), #418 (Phase 2 enum expansion), #395 (producer fixtures)
  • Read-only triad: #410, #428
  • Code: pkg/agent/source_truth.go, pkg/agent/source_truth_logic.go (Derive)
  • Examples: examples/connect-and-compare/

Constraints

  • Strategy is always declared, never inferred. This is the single most important contract rule. If the user doesn't know the strategy, the right answer is ASK + UNKNOWN, not a guess.
  • Connected mode is required. Standalone source-truth verdicts are meaningless (no ConfigHub surface to read).
  • The strategy enum is closed at 9 entries. New strategies require a #393-class issue and a code change. Don't claim cub-scout supports an unlisted strategy.
  • helm-flux / helm-argo produce runtime.helm_chart_anchor proof gaps because the runtime extractor isn't fully wired. Surface the gap explicitly; don't pretend the verdict is comprehensive.
  • confighub-oci-* strategies also have an unshipped equality (ConfigHub doesn't yet expose a rendered digest per unit revision). The status field is correct; the per-field digest equality lands once the ConfigHub-side field exists.

04 同仓库更多 Skills

confighub
confighub/cub-scout

异常工作负载故障分诊

triage-unhealthy-workload

当用户需要在时间压力下应对出现故障的 Kubernetes 工作负载时使用——例如寻呼告警响起、CI 飘红、“生产环境挂了”的场景。自然表述包括:“deploy/api 出现 CrashLoopBackOff,该怎么办?”“发布卡住了,帮帮我”“这个 pod 起不来”“支付服务触发了寻呼告警”“argocd 里全红了”“我应该先检查什么?”“给我一份针对这个工作负载的分诊方案”。它将 doctor → explain → trace 组合成一个紧凑的约 30 秒循环,运维人员可在已确认寻呼告警的上下文中执行。不要用于:没有紧迫性的计划性排查(直接使用 scout-diagnose)、漂移相关问题(使用 investigate-drift),或任何变更操作(cub-scout 从不做变更——应由用户主导,转由 kubectl 处理)。

SRE 工程师生产事故响应与应急处置
★ 14
confighub
confighub/cub-scout

资源证据收据生成与校验

scout-verify

当用户需要针对某个 Kubernetes 资源生成带类型、带指纹、不可篡改(TYPED、FINGERPRINTED、IMMUTABLE)的证据工件时使用——即 cub-scout 的 Verify 动词组(在 #446 中发布的收据能力)。自然表述包括:“出具一份证明此资源合规的收据”“给我一份证明集群与 Git 一致的证明”“我需要一份可用于审计跟踪的可验证记录”“生成一份收据,证明自部署以来没有人工改动”“对照事实源(source-truth)校验 deploy/api 并保存工件”“验证此收据未被篡改”“展示我们有哪些收据”“此收据是否被篡改过?”“把证据附加到我的 CI 关卡”。当意图涉及 receipt / attestation / evidence-artifact / tamper-evident-record / verified-record / audit-trail / postmortem-evidence / acceptance-judge-input 时均应加载。不要用于:不落盘工件的实时比对(使用 scout-compare)、解读单个字段的来源出处(使用 scout-attribute),或真正实施修复(cub-scout 从不做变更——应由用户主导,转由 cub / argocd / kubectl 处理)。

SRE 工程师审计准备与证据管理
★ 14
confighub
confighub/cub-scout

scout-observe

Use when the user wants to SEE what is running in a Kubernetes cluster, who owns it, and how it is structured — the read-only Observe verb group of cub-scout. Natural phrasing: "what is running in my cluster?", "give me a map of resources", "who owns this Deployment?", "trace this back to its source", "show me the ownership tree", "scan this cluster for risk", "dump the cluster as JSON", "stream cluster events", "run cub-scout as a bot", "what is the connection status?", "is this cluster healthy?". Load when intent is observe / inventory / map / show / list / trace / scan / dump / stream / bot / health-check over a Kubernetes cluster. Do NOT load for: explaining WHY something is broken (use scout-diagnose), comparing cluster state to intended state (use scout-compare), provenance of individual field values (use scout-attribute), or any action that mutates the cluster (cub-scout never mutates — route to cub or kubectl with the user driving).

★ 14
confighub
confighub/cub-scout

scout-mcp

Use when the user wants to expose cub-scout to an AI agent over MCP, wants a deterministic AI-ready snapshot of cluster context, or wants cub-scout running as a read-only event bot — the Integrate verb group. Natural phrasing: "start the MCP server", "expose cub-scout to Claude / Codex / my agent", "give me an AI-ready context pack of this cluster", "set up the MCP gateway", "what MCP tools does cub-scout expose?", "run cub-scout as a bot", "produce JSON context for an LLM to reason about this cluster". Load whenever intent is mcp / mcp-gateway / mcp-serve / context-pack / bot / agent-context / ai-snapshot / llm-context / model-context-protocol. Do NOT load for: actually running a non-integrate verb (those are scout-observe / scout-diagnose / scout-compare / scout-attribute / scout-ingest / scout-govern / scout-verify), or `cub` MCP integration (that's a separate tool surface).

★ 14
confighub
confighub/cub-scout

scout-ingest

Use when the user wants to ADOPT existing Kubernetes / GitOps workload structure into ConfigHub after observing the live cluster — the adoption/import verb group of cub-scout. Natural phrasing: "discover workloads in this cluster and propose ConfigHub units", "show me the import proposal before I apply", "import this Argo Application set", "bring my Flux Kustomizations into ConfigHub", "preview what would land in ConfigHub if I imported this repo", "parse my git repo as a ConfigHub import bundle", "import a cluster aggregator", "what would --git-path produce for this repo?". Load whenever intent is adopt / import / ingest / preview / propose / parse-repo / discovery / aggregator / bring-into-confighub / what-would-confighub-see. Do NOT load for: questions about who changed a resource, whether it was edited by hand or drifted (use scout-attribute or investigate-drift); reading an exported `kubectl get -o yaml` dump to answer a question about the cluster (that is not an import); basic live-cluster inventory (use scout-observe), troubleshooting (use scout-diagnose), comparing live state to ConfigHub (use scout-compare), or the actual write to ConfigHub via `cub variant upload` (that is `cub`, not cub-scout — route to cub skills). Important: `cub-scout import apply` IS the mutating write into ConfigHub — this skill teaches the read-only preview path and explicitly refuses to invoke `import apply` itself.

★ 14
confighub
confighub/cub-scout

ConfigHub 治理信号查询

scout-govern

当用户希望从 cub-scout 获取已连接的(CONNECTED)ConfigHub 治理信号时使用该技能 —— Govern(治理)动词组。自然表述:"给我看这个单元的 ChangeSet 历史"、"如果我修改这个单元,影响范围(blast radius)有多大?"、"我的机群中哪些集群是异常值?"、"给我看昨天的连接摘要"、"在整个机群中呈现这个视图"、"审计谁修改了这个"、"上一次应用来自哪里?"、"列出我拥有的 ConfigHub bundle"、"给我看过往快照的目录"。当意图为历史 / 影响 / 影响范围 / 机群异常 / 摘要 / 视图 / 审计 / bundle / 目录 / 连接上下文时加载。不要用于:实时集群比较(使用 scout-compare)、回执(使用 scout-verify)、正在运行的 Pod 清单(使用 scout-observe),或通过 cub 进行的任何修改。该技能的大部分功能需要 `cub auth login` —— 请提前说明。

SRE 工程师工程变更管理
★ 14