[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6N9NMBVV7BNFV01M2Q4SE61":3,"skill-same:01M6N9NMBVV7BNFV01M2Q4SE61":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M6N9NMBVV7BNFV01M2Q4SE61","bubbles-observability-adapter",null,"How to author and wire telemetry adapters under bubbles\u002Fadapters\u002Fobservability\u002F — uniform 4-verb contract, none default, prometheus reference, swappable per downstream repo. Also how to use the validate plane during live-category tests (integration\u002Fe2e\u002Fstress\u002Fload) to discover defects — error spans, latency outliers, fan-out\u002FN+1 — and route findings to bug artifacts.","pkirsanov\u002Fsmackerel","pkirsanov","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F138962?v=4","01M6N8NAPD2KXMVC17X6GJ0WZ5","01M6N8NATQ9SAZ00H9D61R0TPV",1,"MIT","https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbubbles-observability-adapter\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"observability","bubbles observability adapter","adapter","live","telemetry","defects","plane","stress","error","prometheus","how to","tests","how","contract","latency","discover","route","default","bug","repo","2026-11-10 10:12:30",false,"---\ndescription: How to author and wire telemetry adapters under bubbles\u002Fadapters\u002Fobservability\u002F — uniform 4-verb contract, none default, prometheus reference, swappable per downstream repo. Also how to use the validate plane during live-category tests (integration\u002Fe2e\u002Fstress\u002Fload) to discover defects — error spans, latency outliers, fan-out\u002FN+1 — and route findings to bug artifacts.\n---\n\n# bubbles-observability-adapter\n\nBubbles ships a uniform adapter contract for fetching live production telemetry (alerts, SLO burn, error rate, deploy impact). Mirrors the knb offsite-backup adapter pattern: declarative selection in `traceContracts.observability.endpoints`, swappable backends under `bubbles\u002Fadapters\u002Fobservability\u002F\u003Cname>.sh`, `none` as the safe default. Selection is split across two planes — `validate` (the ephemeral per-run test stack) and `operate` (prod, read-only).\n\n> **Consumer status (read this first).** This adapter layer is WIRED to live runtime consumers. Operate-plane signals are fetched **read-only** by `bubbles.stabilize` (incident diagnosis — alerts\u002Ferror-rate\u002Fdeploy-impact fetched first), `bubbles.upkeep` (the weekly `slo-review` task — SLO burn + error rate), and `bubbles.train` (deploy-impact \u002F SLO burn consulted before promote and as a rollback signal). `bubbles.devops` owns the wiring EXECUTION (authoring adapters, dashboards, alert rules); the three agents above are read-only CONSUMERS. The validate plane is exercised by instrumented feature scopes. (`bubbles.retro` is NOT a telemetry consumer — earlier drafts named it in error.)\n\n## When to author a new adapter\n\n- You run a telemetry stack (Sentry, Grafana Cloud, Datadog, New Relic, custom Prometheus federation) that the shipped `prometheus` adapter does not cover.\n- You want Bubbles ops agents to read live signals from that stack. The operate-plane consumers (`bubbles.stabilize`, `bubbles.upkeep`, `bubbles.train`) invoke the `fetch-*` verbs at runtime through the plane resolver, so authoring the adapter immediately lights up incident diagnosis, the `slo-review` task, and promote\u002Frollback gating for your stack.\n\n## Contract (every adapter MUST implement all 4 verbs)\n\n| Verb | Stdout | Exit 0 means | Exit 1 means |\n|------|--------|--------------|--------------|\n| `fetch-alerts` | JSON array of active alerts | Adapter reachable, no parse errors | Adapter unreachable \u002F parse failure (NOT a framework failure) |\n| `fetch-slo-burn` | JSON map service→burn-rate | (same) | (same) |\n| `fetch-error-rate` | JSON map service→error-pct | (same) | (same) |\n| `fetch-deploy-impact` | JSON map sha→regression-delta | (same) | (same) |\n\nUnknown verbs MUST exit 1 with `unknown verb` on stderr. `-h` \u002F `--help` MUST print a usage block and exit 0.\n\n## File location\n\n`bubbles\u002Fadapters\u002Fobservability\u002F\u003Cadapter-name>.sh` (chmod +x).\n\n## Required structure\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\nVERB=\"${1:-}\"\n# validate env \u002F dependencies\ncase \"$VERB\" in\n  fetch-alerts) ... ;;\n  fetch-slo-burn) ... ;;\n  fetch-error-rate) ... ;;\n  fetch-deploy-impact) ... ;;\n  -h|--help|\"\") usage; exit 0 ;;\n  *) echo \"[\u003Cname>][ERROR] unknown verb '$VERB'\" >&2; exit 1 ;;\nesac\n```\n\nThe case statement is what `observability-adapter-lint.sh` greps for. If a verb is not listed verbatim, the lint fails.\n\n## NO defaults for adapter inputs\n\nAdapters that need env vars (URL, token, etc.) MUST refuse to run when the var is unset. NO `: \"${VAR:=fallback}\"`. Example: `prometheus.sh` requires `PROMETHEUS_BASE_URL` and exits 1 with an explicit error if it is missing.\n\nThis matches the framework-wide NO DEFAULTS policy. The operator (or knb adapter overlay) sets the env var explicitly per environment.\n\n## Wiring\n\nIn your repo's `.github\u002Fbubbles-project.yaml`, under the `traceContracts.observability` block (start from `templates\u002Fobservability.yaml.tmpl`):\n\n```yaml\ntraceContracts:\n  observability:\n    endpoints:\n      validate:                              # ephemeral per-run test stack\n        sloBurn: { adapter: prometheus, profile: test }\n        errorRate: { adapter: prometheus, profile: test }\n        alerts: { adapter: none }\n        deployImpact: { adapter: none }\n      operate:                               # prod (read-only)\n        alerts: { adapter: prometheus, profile: prod }\n        sloBurn: { adapter: prometheus, profile: prod }\n        errorRate: { adapter: prometheus, profile: prod }\n        deployImpact: { adapter: none }      # mix-and-match is fine\n```\n\nA resolver (`bubbles\u002Fscripts\u002Fobservability-endpoint-resolve.sh`) maps `(plane, signal) → { adapter, profile }`. Adapter values are provider **names** (never URLs\u002Ftokens); `profile` selects the env binding. The operate-plane consumers (`bubbles.stabilize`, `bubbles.upkeep`, `bubbles.train`) read this config through the resolver at runtime; the validate plane is read by instrumented feature scopes.\n\n## Posture model\n\n`traceContracts.observability.posture` is a tri-state decision every repo makes:\n\n| Posture | Meaning |\n|---------|---------|\n| `wired` | Telemetry is wired; instrumented scopes must prove telemetry + SLOs. At least one non-`none` validate-plane signal is required (all-`none` is rejected as *fake-wired*). |\n| `opted-out` | A legitimate, recorded, expiring choice. Requires a full `optOut` block. |\n| *(absent)* | Undeclared — the only \"nag\" state. `policy.undeclaredPosture` decides warn vs block. |\n\n## Two planes, one provider, a profile per plane\n\n- **validate** → resolves to the ephemeral per-run test stack (`profile: test`). Feature scopes use the validate plane only; test telemetry stays `env=test*` (G115 protects prod).\n- **operate** → resolves to prod (`profile: prod`), read-only, and only for deploy \u002F train \u002F upkeep \u002F incident \u002F release scopes.\n\nAdapter names are provider names, never environment names — the `profile` selects env vars\u002Fendpoints, so there is no `prometheus-test` adapter file proliferation.\n\n## Opt-out lifecycle\n\nWhen `posture: opted-out`, the `optOut` block is REQUIRED and carries `reasonCode` (`no-runtime` | `pre-monitoring` | `external-monitoring-only`), `reason`, `declaredAt`, `revisitAfter`, and `approvedBy`. `revisitAfter` is the single source of truth for expiry — once an opt-out passes its `revisitAfter`, an opt-in reminder escalates. `reasonCode` only seeds the *default* `revisitAfter` that setup proposes. A `wired → opted-out` transition (monitoring decommissioned) is legitimate but never silent: it must set a fresh `decision` and a full `optOut`.\n\n## Evidence-file convention\n\nCaptured telemetry lands under `.specify\u002Fruntime\u002Fobservability\u002F\u003Cworkflow>.\u003Csignal>.{txt,json}` (trace\u002Flog evidence may stay line-oriented text; SLO evidence is normalized JSON). Two stores, non-duplicative:\n\n- `.specify\u002Fruntime\u002Ftool-calls.jsonl` — provenance that the capture command ran (MCP `record_evidence`).\n- `.specify\u002Fruntime\u002Fobservability\u002F\u003Cworkflow>.\u003Csignal>.json` — the parsed metric artifact the SLO guard reads (an *output* of the captured run, never a second source of truth).\n\n`.specify\u002Fruntime\u002F` is gitignored.\n\n## Acceptance heuristic — \"3 AM reconstructibility\"\n\nFor a wired, instrumented scope (a Test Plan row declaring `observabilityWorkflow`), the DoD item *\"telemetry captured in integration\u002Fe2e\"* (Gate G080) is satisfied only when the captured trace passes the **3 AM reconstructibility** question:\n\n> *Could an on-call engineer, paged at 3 AM with nothing but this trace, reconstruct the full story of what the workflow did and where it broke — without reading the source?*\n\nIf the answer is no — spans are missing, attributes that name the actor \u002F resource \u002F outcome are absent, or the failure point is ambiguous — the instrumentation is insufficient and the DoD item stays `[ ]`, regardless of whether the SLO numbers happen to pass. This is the human acceptance bar behind G080; the `trace-contract-guard.sh` check is the mechanical floor beneath it, and the G100 SLO guard asserts the numeric target on top. See [`scope-workflow.md`](..\u002F..\u002Fagents\u002Fbubbles_shared\u002Fscope-workflow.md) → \"Observability DoD Injection (MUST-when-wired)\".\n\n## Trace-driven defect discovery (during live-category tests)\n\nCapturing SLO numbers (G100) proves a workflow met its target; it does NOT surface the defects hiding inside a passing run. During every live-category test (`integration` \u002F `e2e-api` \u002F `e2e-ui` \u002F `stress` \u002F `load`) against a `wired` stack, actively MINE the validate-plane telemetry for defects, then file what you find. **A green test over a sick trace is an undiscovered bug, not a pass.**\n\n### When to run\n\n- Any `integration` \u002F `e2e-api` \u002F `e2e-ui` \u002F `stress` \u002F `load` run against a `posture: wired` stack (validate plane, `profile: test`, `env=test*`).\n- NOT for `unit` \u002F `ui-unit` (no real stack to trace), and NEVER against the operate\u002Fprod plane (read-only; off-limits to feature tests — G115).\n\n### The four defect classes to scan for\n\nPull the exercised workflow's traces\u002Fmetrics from the validate-plane stack and look for:\n\n1. **Error \u002F exception spans** — any span with `error=true`, a non-OK status, or a logged exception — *even when the top-level request returned success*. A swallowed or silently-retried error is a defect.\n2. **Latency outliers** — spans that breach the workflow's `traceContracts.observability.slos` target, or that dominate the critical path when they should not (the slowest span is not the expected one).\n3. **Fan-out \u002F N+1** — the same downstream span (DB query, RPC, cache call) repeated per-item instead of batched; a span count that scales with input size.\n4. **Retries \u002F timeouts \u002F missing spans** — silent retries, near-timeout spans, or a step that emits NO span (a blind spot that also fails the 3 AM bar above).\n\n### What to do with a finding\n\n- Treat it as a **defect, not noise**: file it through `bubbles.bug` (see `bubbles-bug-template`) with the captured trace as before-fix evidence. Do NOT defer it to \"follow-up\".\n- Completion gating applies: under `bubbles-dod-validation` + `bubbles-anti-fabrication`, a scope cannot be marked done while a discovered error-span, SLO-breaching latency, or N+1 remains unfixed.\n- Record the capture as evidence (`bubbles-evidence-capture`); it lands under `.specify\u002Fruntime\u002Fobservability\u002F\u003Cworkflow>.\u003Csignal>.{txt,json}` (gitignored).\n\n### Repo wiring this needs\n\nThe validate-plane stack must be reachable from the test (`prometheus` \u002F `jaeger` \u002F `tempo` on the ephemeral `profile: test` stack), plus a capture command the test or agent runs to deposit evidence — the repo's own observability-capture surface. Defect-mining reuses the same validate-plane access as SLO capture; it just queries the trace\u002Fspan signals, not only the SLO aggregate.\n\n### Works well with\n\n- `bubbles-test-integrity` — the test-quality gates this method runs alongside (Step 8, live categories).\n- `bubbles-evidence-capture` — the evidence shape for the captured trace\u002Fmetric.\n- `bubbles-bug-template` \u002F `bubbles.bug` — where a discovered defect is filed.\n- `bubbles-dod-validation` \u002F `bubbles-anti-fabrication` — why an unfixed finding blocks done.\n\n## Verification\n\n```bash\nbash bubbles\u002Fscripts\u002Fobservability-adapter-lint.sh\n# Output:\n# [observability-adapter-lint] OK (2 adapter(s) validated)\n```\n\nIf you add a third adapter (e.g. `sentry.sh`), the lint discovers it via the `*.sh` glob. No registry update needed.\n\n## Reference adapters\n\n| Adapter | Verbs | Env vars |\n|---------|-------|----------|\n| `none` | `fetch-alerts` returns `[]`; `fetch-slo-burn` \u002F `fetch-error-rate` \u002F `fetch-deploy-impact` return `{}` | — |\n| `prometheus` | all 4 query Prometheus HTTP API (`fetch-alerts` normalized to a bare array) | `PROMETHEUS_BASE_URL`, `PROMETHEUS_CURL_MAX_TIME`, `PROMETHEUS_QUERY_SLO_BURN`, `PROMETHEUS_QUERY_ERROR_RATE`, `PROMETHEUS_QUERY_DEPLOY_IMPACT` (all required; no defaults), `PROMETHEUS_BEARER_TOKEN` (optional secret) |\n\n> **Canonical per-verb shapes (shipped):** `fetch-alerts` → JSON **array** (`[]` when empty); `fetch-slo-burn` \u002F `fetch-error-rate` \u002F `fetch-deploy-impact` → JSON **map** (`{}` when empty). These shapes are defined in [`docs\u002Fguides\u002FCONTROL_PLANE_SCHEMAS.md`](..\u002F..\u002Fdocs\u002Fguides\u002FCONTROL_PLANE_SCHEMAS.md), enforced per-verb by `observability-adapter-lint.sh`, and already implemented in `none.sh` and `prometheus.sh` (the `fetch-alerts` array-vs-map split landed in IMP-001 SCOPE-3a). The earlier \"all 4 return `{}`\" behavior is superseded.\n\n## Failure semantics\n\nAdapter exit 1 is **not** a framework failure. It means \"telemetry unavailable, proceed without enrichment\". Consumers MUST gracefully degrade when an adapter returns non-zero or empty. The framework continues normally.\n\n## Anti-patterns\n\n| Don't | Why |\n|-------|-----|\n| Hardcode a default URL\u002Ftoken in the adapter | Violates NO DEFAULTS policy — operator sets env vars |\n| Return non-JSON on success | Breaks consumer parsing |\n| Exit 2+ on adapter unavailable | Reserved for framework-level errors |\n| Skip the `-h` \u002F `--help` block | Lint and human discovery both expect it |\n| Edit `bubbles\u002Fscripts\u002F*` to mention a specific adapter | Adapters discovered via filesystem glob; never hard-referenced |\n","# bubbles-observability-adapter\n\nBubbles ships a uniform adapter contract for fetching live production telemetry (alerts, SLO burn, error rate, deploy impact). Mirrors the knb offsite-backup adapter pattern: declarative selection in `traceContracts.observability.endpoints`, swappable backends under `bubbles\u002Fadapters\u002Fobservability\u002F\u003Cname>.sh`, `none` as the safe default. Selection is split across two planes — `validate` (the ephemeral per-run test stack) and `operate` (prod, read-only).\n\n> **Consumer status (read this first).** This adapter layer is WIRED to live runtime consumers. Operate-plane signals are fetched **read-only** by `bubbles.stabilize` (incident diagnosis — alerts\u002Ferror-rate\u002Fdeploy-impact fetched first), `bubbles.upkeep` (the weekly `slo-review` task — SLO burn + error rate), and `bubbles.train` (deploy-impact \u002F SLO burn consulted before promote and as a rollback signal). `bubbles.devops` owns the wiring EXECUTION (authoring adapters, dashboards, alert rules); the three agents above are read-only CONSUMERS. The validate plane is exercised by instrumented feature scopes. (`bubbles.retro` is NOT a telemetry consumer — earlier drafts named it in error.)\n\n## When to author a new adapter\n\n- You run a telemetry stack (Sentry, Grafana Cloud, Datadog, New Relic, custom Prometheus federation) that the shipped `prometheus` adapter does not cover.\n- You want Bubbles ops agents to read live signals from that stack. The operate-plane consumers (`bubbles.stabilize`, `bubbles.upkeep`, `bubbles.train`) invoke the `fetch-*` verbs at runtime through the plane resolver, so authoring the adapter immediately lights up incident diagnosis, the `slo-review` task, and promote\u002Frollback gating for your stack.\n\n## Contract (every adapter MUST implement all 4 verbs)\n\n| Verb | Stdout | Exit 0 means | Exit 1 means |\n|------|--------|--------------|--------------|\n| `fetch-alerts` | JSON array of active alerts | Adapter reachable, no parse errors | Adapter unreachable \u002F parse failure (NOT a framework failure) |\n| `fetch-slo-burn` | JSON map service→burn-rate | (same) | (same) |\n| `fetch-error-rate` | JSON map service→error-pct | (same) | (same) |\n| `fetch-deploy-impact` | JSON map sha→regression-delta | (same) | (same) |\n\nUnknown verbs MUST exit 1 with `unknown verb` on stderr. `-h` \u002F `--help` MUST print a usage block and exit 0.\n\n## File location\n\n`bubbles\u002Fadapters\u002Fobservability\u002F\u003Cadapter-name>.sh` (chmod +x).\n\n## Required structure\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\nVERB=\"${1:-}\"\n# validate env \u002F dependencies\ncase \"$VERB\" in\n  fetch-alerts) ... ;;\n  fetch-slo-burn) ... ;;\n  fetch-error-rate) ... ;;\n  fetch-deploy-impact) ... ;;\n  -h|--help|\"\") usage; exit 0 ;;\n  *) echo \"[\u003Cname>][ERROR] unknown verb '$VERB'\" >&2; exit 1 ;;\nesac\n```\n\nThe case statement is what `observability-adapter-lint.sh` greps for. If a verb is not listed verbatim, the lint fails.\n\n## NO defaults for adapter inputs\n\nAdapters that need env vars (URL, token, etc.) MUST refuse to run when the var is unset. NO `: \"${VAR:=fallback}\"`. Example: `prometheus.sh` requires `PROMETHEUS_BASE_URL` and exits 1 with an explicit error if it is missing.\n\nThis matches the framework-wide NO DEFAULTS policy. The operator (or knb adapter overlay) sets the env var explicitly per environment.\n\n## Wiring\n\nIn your repo's `.github\u002Fbubbles-project.yaml`, under the `traceContracts.observability` block (start from `templates\u002Fobservability.yaml.tmpl`):\n\n```yaml\ntraceContracts:\n  observability:\n    endpoints:\n      validate:                              # ephemeral per-run test stack\n        sloBurn: { adapter: prometheus, profile: test }\n        errorRate: { adapter: prometheus, profile: test }\n        alerts: { adapter: none }\n        deployImpact: { adapter: none }\n      operate:                               # prod (read-only)\n        alerts: { adapter: prometheus, profile: prod }\n        sloBurn: { adapter: prometheus, profile: prod }\n        errorRate: { adapter: prometheus, profile: prod }\n        deployImpact: { adapter: none }      # mix-and-match is fine\n```\n\nA resolver (`bubbles\u002Fscripts\u002Fobservability-endpoint-resolve.sh`) maps `(plane, signal) → { adapter, profile }`. Adapter values are provider **names** (never URLs\u002Ftokens); `profile` selects the env binding. The operate-plane consumers (`bubbles.stabilize`, `bubbles.upkeep`, `bubbles.train`) read this config through the resolver at runtime; the validate plane is read by instrumented feature scopes.\n\n## Posture model\n\n`traceContracts.observability.posture` is a tri-state decision every repo makes:\n\n| Posture | Meaning |\n|---------|---------|\n| `wired` | Telemetry is wired; instrumented scopes must prove telemetry + SLOs. At least one non-`none` validate-plane signal is required (all-`none` is rejected as *fake-wired*). |\n| `opted-out` | A legitimate, recorded, expiring choice. Requires a full `optOut` block. |\n| *(absent)* | Undeclared — the only \"nag\" state. `policy.undeclaredPosture` decides warn vs block. |\n\n## Two planes, one provider, a profile per plane\n\n- **validate** → resolves to the ephemeral per-run test stack (`profile: test`). Feature scopes use the validate plane only; test telemetry stays `env=test*` (G115 protects prod).\n- **operate** → resolves to prod (`profile: prod`), read-only, and only for deploy \u002F train \u002F upkeep \u002F incident \u002F release scopes.\n\nAdapter names are provider names, never environment names — the `profile` selects env vars\u002Fendpoints, so there is no `prometheus-test` adapter file proliferation.\n\n## Opt-out lifecycle\n\nWhen `posture: opted-out`, the `optOut` block is REQUIRED and carries `reasonCode` (`no-runtime` | `pre-monitoring` | `external-monitoring-only`), `reason`, `declaredAt`, `revisitAfter`, and `approvedBy`. `revisitAfter` is the single source of truth for expiry — once an opt-out passes its `revisitAfter`, an opt-in reminder escalates. `reasonCode` only seeds the *default* `revisitAfter` that setup proposes. A `wired → opted-out` transition (monitoring decommissioned) is legitimate but never silent: it must set a fresh `decision` and a full `optOut`.\n\n## Evidence-file convention\n\nCaptured telemetry lands under `.specify\u002Fruntime\u002Fobservability\u002F\u003Cworkflow>.\u003Csignal>.{txt,json}` (trace\u002Flog evidence may stay line-oriented text; SLO evidence is normalized JSON). Two stores, non-duplicative:\n\n- `.specify\u002Fruntime\u002Ftool-calls.jsonl` — provenance that the capture command ran (MCP `record_evidence`).\n- `.specify\u002Fruntime\u002Fobservability\u002F\u003Cworkflow>.\u003Csignal>.json` — the parsed metric artifact the SLO guard reads (an *output* of the captured run, never a second source of truth).\n\n`.specify\u002Fruntime\u002F` is gitignored.\n\n## Acceptance heuristic — \"3 AM reconstructibility\"\n\nFor a wired, instrumented scope (a Test Plan row declaring `observabilityWorkflow`), the DoD item *\"telemetry captured in integration\u002Fe2e\"* (Gate G080) is satisfied only when the captured trace passes the **3 AM reconstructibility** question:\n\n> *Could an on-call engineer, paged at 3 AM with nothing but this trace, reconstruct the full story of what the workflow did and where it broke — without reading the source?*\n\nIf the answer is no — spans are missing, attributes that name the actor \u002F resource \u002F outcome are absent, or the failure point is ambiguous — the instrumentation is insufficient and the DoD item stays `[ ]`, regardless of whether the SLO numbers happen to pass. This is the human acceptance bar behind G080; the `trace-contract-guard.sh` check is the mechanical floor beneath it, and the G100 SLO guard asserts the numeric target on top. See [`scope-workflow.md`](..\u002F..\u002Fagents\u002Fbubbles_shared\u002Fscope-workflow.md) → \"Observability DoD Injection (MUST-when-wired)\".\n\n## Trace-driven defect discovery (during live-category tests)\n\nCapturing SLO numbers (G100) proves a workflow met its target; it does NOT surface the defects hiding inside a passing run. During every live-category test (`integration` \u002F `e2e-api` \u002F `e2e-ui` \u002F `stress` \u002F `load`) against a `wired` stack, actively MINE the validate-plane telemetry for defects, then file what you find. **A green test over a sick trace is an undiscovered bug, not a pass.**\n\n### When to run\n\n- Any `integration` \u002F `e2e-api` \u002F `e2e-ui` \u002F `stress` \u002F `load` run against a `posture: wired` stack (validate plane, `profile: test`, `env=test*`).\n- NOT for `unit` \u002F `ui-unit` (no real stack to trace), and NEVER against the operate\u002Fprod plane (read-only; off-limits to feature tests — G115).\n\n### The four defect classes to scan for\n\nPull the exercised workflow's traces\u002Fmetrics from the validate-plane stack and look for:\n\n1. **Error \u002F exception spans** — any span with `error=true`, a non-OK status, or a logged exception — *even when the top-level request returned success*. A swallowed or silently-retried error is a defect.\n2. **Latency outliers** — spans that breach the workflow's `traceContracts.observability.slos` target, or that dominate the critical path when they should not (the slowest span is not the expected one).\n3. **Fan-out \u002F N+1** — the same downstream span (DB query, RPC, cache call) repeated per-item instead of batched; a span count that scales with input size.\n4. **Retries \u002F timeouts \u002F missing spans** — silent retries, near-timeout spans, or a step that emits NO span (a blind spot that also fails the 3 AM bar above).\n\n### What to do with a finding\n\n- Treat it as a **defect, not noise**: file it through `bubbles.bug` (see `bubbles-bug-template`) with the captured trace as before-fix evidence. Do NOT defer it to \"follow-up\".\n- Completion gating applies: under `bubbles-dod-validation` + `bubbles-anti-fabrication`, a scope cannot be marked done while a discovered error-span, SLO-breaching latency, or N+1 remains unfixed.\n- Record the capture as evidence (`bubbles-evidence-capture`); it lands under `.specify\u002Fruntime\u002Fobservability\u002F\u003Cworkflow>.\u003Csignal>.{txt,json}` (gitignored).\n\n### Repo wiring this needs\n\nThe validate-plane stack must be reachable from the test (`prometheus` \u002F `jaeger` \u002F `tempo` on the ephemeral `profile: test` stack), plus a capture command the test or agent runs to deposit evidence — the repo's own observability-capture surface. Defect-mining reuses the same validate-plane access as SLO capture; it just queries the trace\u002Fspan signals, not only the SLO aggregate.\n\n### Works well with\n\n- `bubbles-test-integrity` — the test-quality gates this method runs alongside (Step 8, live categories).\n- `bubbles-evidence-capture` — the evidence shape for the captured trace\u002Fmetric.\n- `bubbles-bug-template` \u002F `bubbles.bug` — where a discovered defect is filed.\n- `bubbles-dod-validation` \u002F `bubbles-anti-fabrication` — why an unfixed finding blocks done.\n\n## Verification\n\n```bash\nbash bubbles\u002Fscripts\u002Fobservability-adapter-lint.sh\n# Output:\n# [observability-adapter-lint] OK (2 adapter(s) validated)\n```\n\nIf you add a third adapter (e.g. `sentry.sh`), the lint discovers it via the `*.sh` glob. No registry update needed.\n\n## Reference adapters\n\n| Adapter | Verbs | Env vars |\n|---------|-------|----------|\n| `none` | `fetch-alerts` returns `[]`; `fetch-slo-burn` \u002F `fetch-error-rate` \u002F `fetch-deploy-impact` return `{}` | — |\n| `prometheus` | all 4 query Prometheus HTTP API (`fetch-alerts` normalized to a bare array) | `PROMETHEUS_BASE_URL`, `PROMETHEUS_CURL_MAX_TIME`, `PROMETHEUS_QUERY_SLO_BURN`, `PROMETHEUS_QUERY_ERROR_RATE`, `PROMETHEUS_QUERY_DEPLOY_IMPACT` (all required; no defaults), `PROMETHEUS_BEARER_TOKEN` (optional secret) |\n\n> **Canonical per-verb shapes (shipped):** `fetch-alerts` → JSON **array** (`[]` when empty); `fetch-slo-burn` \u002F `fetch-error-rate` \u002F `fetch-deploy-impact` → JSON **map** (`{}` when empty). These shapes are defined in [`docs\u002Fguides\u002FCONTROL_PLANE_SCHEMAS.md`](..\u002F..\u002Fdocs\u002Fguides\u002FCONTROL_PLANE_SCHEMAS.md), enforced per-verb by `observability-adapter-lint.sh`, and already implemented in `none.sh` and `prometheus.sh` (the `fetch-alerts` array-vs-map split landed in IMP-001 SCOPE-3a). The earlier \"all 4 return `{}`\" behavior is superseded.\n\n## Failure semantics\n\nAdapter exit 1 is **not** a framework failure. It means \"telemetry unavailable, proceed without enrichment\". Consumers MUST gracefully degrade when an adapter returns non-zero or empty. The framework continues normally.\n\n## Anti-patterns\n\n| Don't | Why |\n|-------|-----|\n| Hardcode a default URL\u002Ftoken in the adapter | Violates NO DEFAULTS policy — operator sets env vars |\n| Return non-JSON on success | Breaks consumer parsing |\n| Exit 2+ on adapter unavailable | Reserved for framework-level errors |\n| Skip the `-h` \u002F `--help` block | Lint and human discovery both expect it |\n| Edit `bubbles\u002Fscripts\u002F*` to mention a specific adapter | Adapters discovered via filesystem glob; never hard-referenced |\n",{"description":7},"main","ed893cc338281a0bb9bb9ecf3415716cb242bb3f",".github\u002Fskills\u002Fbubbles-observability-adapter",0,"https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel","https:\u002F\u002Fgithub.com\u002Fpkirsanov","2026-11-07 02:54:37",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add pkirsanov\u002Fsmackerel --skill bubbles-observability-adapter",{"tool":56,"command":57},"bunx","bunx skills add pkirsanov\u002Fsmackerel --skill bubbles-observability-adapter",{"tool":59,"command":60},"pnpm","pnpm dlx skills add pkirsanov\u002Fsmackerel --skill bubbles-observability-adapter","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbubbles-observability-adapter\u002FSKILL.md",true,[],[65,86,111,136,156,180],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":38},"01M6N9V5TBHQT20V5SCCJ1VRBC","smackerel-trace-capture","Wire Smackerel's concrete validate-plane stack into the framework trace-driven defect-discovery method. Use when running live-category tests (integration\u002Fe2e\u002Fe2e-ui\u002Fstress) against the ephemeral test stack; capturing SLO or trace evidence; hunting latency\u002Ferror\u002Fperf bugs from spans; querying the test-stack Jaeger or Prometheus; or touching `.specify\u002Fruntime\u002Fobservability`. Concrete smackerel endpoints + the exact `capture-slo.sh` command; do NOT duplicate `bubbles-observability-adapter` — this only adds the wiring.","https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsmackerel-trace-capture\u002FSKILL.md",[],[72,73,74,75,18,27,76,77,78,79,80,81,82,83,32,84,29,20,26,85],"trace","capture","smackerel trace capture","perf","specify","e2e","discovery","use","slo","only","evidence","do","runtime","bugs",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":38},"01M6N9TZDEV26RZ7W34HEFPQE9","smackerel-no-defaults","Enforce Smackerel's NO-DEFAULTS \u002F fail-loud SST policy. Use when editing config, Docker Compose, deploy adapters, docs, instructions, skills, env handling, host bind addresses, or any runtime value that could be hidden by fallback syntax.","https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsmackerel-no-defaults\u002FSKILL.md",[],[93,94,95,96,97,98,99,100,101,79,102,103,84,104,105,106,107,108,109,110],"smackerel no defaults","docker","policy","config","deploy","docker compose","syntax","editing","instructions","compose","enforce","bind","env","host","Adapters","sst","addresses","value",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":38},"01M6N9TJRS5PF83JH2W4614D4W","bubbles-workflow-mode-resolution","Resolve a Bubbles workflow mode against `bubbles\u002Fworkflows.yaml`, including template inheritance, status ceilings, gate wiring, and decision policy. Use when picking a mode for a request, when a guard reports a mode-related failure, or when extending workflows.yaml with a new mode or template. Covers natural-language intent routing and the workflow registry consistency rules.","https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbubbles-workflow-mode-resolution\u002FSKILL.md",[],[118,119,120,121,95,122,123,124,125,126,127,79,128,129,130,131,132,133,134,135],"workflow","resolution","mode","bubbles workflow mode resolution","workflows","routing","guard","template","decision","Rules","reports","intent","inheritance","with","consistency","natural-language","for","wiring",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":38},"01M6N9TC98D6DJR0D64SSN0SN3","bubbles-workflow-execution-loops","Run per-round synchronous workflow execution loops correctly. Use when orchestrating a multi-round workflow, dispatching specialist subagents, handling round-based remediation, or interpreting a workflow mode's execution policy. Covers authorized direct execution, dispatch-and-wait, batch-then-summarize prohibition, and mapped-mode execution.","https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbubbles-workflow-execution-loops\u002FSKILL.md",[],[118,143,144,145,146,95,147,148,149,150,151,79,152,153,154,155,120],"execution","loops","bubbles workflow execution loops","summarize","run","batch","remediation","direct","subagents","dispatch","wait","multi","multi-round",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":38},"01M6N9SYXQNJDQ1T1YT81JH2BG","bubbles-vscode-agent-constraints","Design agents that fit the VS Code Copilot Chat runtime instead of fighting it. Use when authoring or editing any `*.agent.md`; when adding `tools:`, `agents:`, `handoffs:`, `model:`, `user-invocable:`, or `disable-model-invocation:` frontmatter; when designing an orchestrator that dispatches specialists; when a design implies agent-calls-agent-calls-agent chaining; when a subagent dispatch silently no-ops or an agent cannot be selected in the dropdown; or when writing a governance rule about delegation that the runtime cannot actually enforce. Prevents multi-level-subagent designs, prose-only dispatch laws, and frontmatter\u002Fbody contradictions.","https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbubbles-vscode-agent-constraints\u002FSKILL.md",[],[163,164,165,166,167,168,169,170,171,172,173,174,100,175,81,84,176,177,178,179],"vscode","constraints","bubbles vscode agent constraints","design","writing","copilot","code","delegation","Tools","subagent","model","chaining","orchestrator","authoring","fit","subagent dispatch","frontmatter",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":38},"01M6N9SD78SK12PRT9KBRZ6TB3","bubbles-upkeep-cadence","How to schedule, dispatch, and record recurring operational upkeep tasks (backup, restore-drill, BCDR-drill, patch-cycle, secret-rotation, flag-cleanup, compliance-sweep). Use when authoring or modifying `config\u002Fupkeep-calendar.yaml`, when investigating a missed task, when reading the upkeep ledger, or when adding a new task type.","https:\u002F\u002Fgithub.com\u002Fpkirsanov\u002Fsmackerel\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbubbles-upkeep-cadence\u002FSKILL.md",[],[187,188,189,190,191,192,193,194,79,195,196,197,198,199,200,201,202,28,203,204],"cadence","bubbles upkeep cadence","tasks","cleanup","backup","sweep","schedule","recurring","patch","restore","task","cycle","record","missed","type","drill","new task","rotation"]