|
| 1 | +# /v:onboard — Operations / Deployment coverage dimension (design) |
| 2 | + |
| 3 | +> Fixes a coverage blind spot in the `/v:onboard` pipeline: it never documents the |
| 4 | +> CI/CD + DevOps layer of a project. Adds an explicit **Operations / Deployment** |
| 5 | +> dimension that produces a cited `docs/superpowers/architecture/operations.md`. |
| 6 | +> Authority doc: [`skills/compound-v/onboarding.md`](../../../skills/compound-v/onboarding.md). |
| 7 | +> Base design of record: [`2026-06-30-v-onboard-design.md`](2026-06-30-v-onboard-design.md). |
| 8 | +
|
| 9 | +## 1. Problem |
| 10 | + |
| 11 | +`/v:onboard` builds a citation-verified architecture KB but silently skips the |
| 12 | +operations layer. Confirmed against the code: |
| 13 | + |
| 14 | +- **PACK includes the raw material.** `scripts/compound-v-onboard.py` `_exclude_reason` |
| 15 | + drops only vendored / generated / binary paths — so `docker/**`, `.github/workflows/*`, |
| 16 | + Terraform, and deploy scripts all reach EXTRACT. The material is available, not excluded. |
| 17 | +- **DETECT never inventories it.** `onboarding.md` §1 inventories existing instruction |
| 18 | + files, stack, git remote, UI presence (`detect-ui`), style configs, cross-tool signal, |
| 19 | + and nested instruction files — but **not** CI/CD pipelines, Dockerfiles/compose, or |
| 20 | + deploy scripts. |
| 21 | +- **EXTRACT has no home for it.** Claim types are `architecture | business-logic | |
| 22 | + tech-context | convention`; nothing prompts deployment/infra/CI-CD coverage. The fixed |
| 23 | + arch doc set is `architecture.md` / `business-logic.md` / `tech-context.md`. |
| 24 | +- **`.github` appears only as untrusted `copilot-instructions` and as a high-impact |
| 25 | + taxonomy path** — never as a documentation dimension. |
| 26 | + |
| 27 | +**Net effect:** unless the operator hand-adds an ops step, Docker topology, GitHub Actions |
| 28 | +deploy, production domain, and runbooks are silently dropped from the generated KB — |
| 29 | +becoming confident partial truth downstream (the exact failure PACK's "silently dropped |
| 30 | +relevant file" caveat warns about). |
| 31 | + |
| 32 | +## 2. Scope |
| 33 | + |
| 34 | +- **In:** the `/v:onboard` pipeline only — DETECT, EXTRACT, a new conditional |
| 35 | + `operations.md`, the WRITE surface, and the refresh/staleness manifest; a deterministic |
| 36 | + `detect-ops` subcommand + selftest; the spec artifacts table. |
| 37 | +- **Out:** the brainstorm→execute pre-flights (`code-archaeologist`, `domain-expert`, |
| 38 | + `doc-validator`) are a separate subsystem and are **not** touched. No infra |
| 39 | + provisioning, no secret extraction into the doc (the existing `scan-output` blocking |
| 40 | + gate already refuses credentials in generated files). No `verify-citations` change — |
| 41 | + the claim `type` field is free-form data there. |
| 42 | + |
| 43 | +## 3. Decisions (resolved during brainstorm) |
| 44 | + |
| 45 | +1. **Gating = deterministic `detect-ops` subcommand**, mirroring `detect-ui` — not a |
| 46 | + prose-only DETECT glob. Consistent with how `detect-ui` gates `DESIGN.md`. |
| 47 | +2. **A 5th claim type `operations`** (not a `tech-context` reuse) — operations claims |
| 48 | + target `operations.md`. Cleanest `type → doc` mapping; free-form `type` means no |
| 49 | + `verify-citations` change. |
| 50 | +3. **Onboarding pipeline only** — no new pre-flight agent. |
| 51 | +4. **The "include DevOps?" ask lives at the HUMAN GATE (§6)**, not at DETECT. |
| 52 | + `operations.md` is generated then presented as its own explicit per-artifact confirm. |
| 53 | + A fully autonomous / unattended run (auto-approve / `--permission-mode dontAsk` — |
| 54 | + today the headless marathon, or any future autonomous onboarding cycle) auto-approves |
| 55 | + it, exactly as the gate already handles every other artifact. No separate |
| 56 | + autonomous-mode wiring is needed. |
| 57 | + |
| 58 | +## 4. Design |
| 59 | + |
| 60 | +### 4.1 `detect-ops` (deterministic, `scripts/compound-v-onboard.py`) |
| 61 | + |
| 62 | +Mirrors `detect_ui`, but ops has sub-categories, so it returns a small dict rather than a |
| 63 | +bare bool: |
| 64 | + |
| 65 | +``` |
| 66 | +detect_ops(repo) -> { |
| 67 | + "signals_found": bool, # true iff >=1 KNOWN signal matched. FALSE = "no signals found", |
| 68 | + # NOT "no ops layer" — a bespoke ship.sh matches nothing yet exists. |
| 69 | + "ci_cd": [paths...], |
| 70 | + "containers": [paths...], |
| 71 | + "deploy": [paths...], |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +Signal set (documented in-code; matched by walking the filesystem, excluding `VENDOR_DIRS` — |
| 76 | +not `git ls-files`, so the non-git `--selftest` temp trees also detect. Ops files are effectively |
| 77 | +always tracked, so this does not diverge from the git-tracked PACK/scope-gate in practice): |
| 78 | + |
| 79 | +- **CI/CD:** `.github/workflows/*.yml|*.yaml`, `.gitlab-ci.yml`, `.circleci/config.yml`, |
| 80 | + `Jenkinsfile`, `azure-pipelines.yml`, `.travis.yml`, `bitbucket-pipelines.yml`. |
| 81 | +- **Containers / infra:** `Dockerfile` (+ `Dockerfile.*`, nested `**/Dockerfile`), |
| 82 | + `docker-compose*.yml|.yaml`, `compose.yml|.yaml`, `*.tf` / `*.tfvars`, and k8s |
| 83 | + heuristics (`k8s/` dir, `kustomization.yaml`, Helm `Chart.yaml`). k8s detection is a |
| 84 | + filename/dir heuristic and is documented as such — honest about its limits, like the |
| 85 | + DESIGN.md linter caveats. |
| 86 | +- **Deploy / PaaS:** `Procfile`, `fly.toml`, `vercel.json`, `netlify.toml`, `render.yaml`, |
| 87 | + `serverless.yml`, `app.yaml`, `deploy*.sh`. |
| 88 | + |
| 89 | +CLI wiring (mirrors `detect-ui`): |
| 90 | + |
| 91 | +- `add_parser("detect-ops")` with `--repo` (default `.`) and `--json`. |
| 92 | +- `main()`: `detect-ops` prints `ops` / `no-signals` by default (deliberately **not** `no-ops` — |
| 93 | + the empty case is an open question, not an absence verdict); with `--json`, prints the grouped |
| 94 | + inventory dict. Exit 0. |
| 95 | +- **Selftest** in the existing selftest block: `detect_ops(...)["signals_found"] is True` on a |
| 96 | + fixture containing a `.github/workflows/ci.yml` (or `Dockerfile`); `... is False` **with empty |
| 97 | + category lists** on a bare tree (asserting the empty result carries no false verdict) — matching |
| 98 | + the shape of the existing `detect_ui` true/false selftests. |
| 99 | + |
| 100 | +### 4.2 `onboarding.md` authority-doc edits |
| 101 | + |
| 102 | +- **§1 DETECT** — add an **Operations / Deployment** bullet: run |
| 103 | + `python3 scripts/compound-v-onboard.py detect-ops --repo . --json`; inventory the three |
| 104 | + categories. Silent inventory, like `detect-ui` — the inclusion *ask* is at the gate, not |
| 105 | + here. This is the deterministic gate for the `operations.md` branch. |
| 106 | +- **§3 EXTRACT** — claim `type` enum becomes |
| 107 | + `architecture | business-logic | tech-context | convention | operations`. Operations |
| 108 | + claims carry `target_doc_section` pointing at `operations.md`. Load-bearing rules still |
| 109 | + bite: a deploy-secret path, a production/branch deploy gate, or a fail-closed CI check is |
| 110 | + **load-bearing** (`security` / `fail-closed`) and blocks on unsupported per the existing |
| 111 | + two-tier gate. |
| 112 | +- **New "operations.md" section** (parallel to the CONVENTIONS.md / DESIGN.md section) — |
| 113 | + `operations.md` is generated when `detect-ops` found signals (`signals_found: true`) **or** when |
| 114 | + the maintainer answers the GATE's open question by naming a bespoke deployer the signal list |
| 115 | + missed. It is skipped **only** when `signals_found: false` **and** the human confirmed there is |
| 116 | + genuinely nothing — never silently on an empty scan (verify BOTH the found path and the |
| 117 | + open-question path on dogfoods). Read-then-cite from real workflow / Docker / deploy files (or the |
| 118 | + file the maintainer pointed at). Covers: container topology, CI/CD stages, deploy target + |
| 119 | + production domain, runbook pointers. Never extracts a credential — `scan-output` (§7) still refuses. |
| 120 | +- **§6 HUMAN GATE** — the detector is an accelerator, never a verdict, so the gate surfaces ops in |
| 121 | + **both** branches: |
| 122 | + - `signals_found: true` → `operations.md` as its **own explicit per-artifact confirm**, framed |
| 123 | + with the detected inventory: *"DevOps/deployment tooling detected: `<ci_cd / containers / deploy |
| 124 | + inventory>` — include `operations.md`?"* Decline → dropped. |
| 125 | + - `signals_found: false` → **not** a silent skip but an **open question**: *"No explicit ops files |
| 126 | + detected — if this project deploys, point me at it (e.g. a hand-rolled `ship.sh`)."* Human names |
| 127 | + it → documented; human confirms nothing → skipped. The human, not the heuristic, decides. |
| 128 | + |
| 129 | + Under a fully autonomous / unattended run the gate auto-approves the `signals_found: true` doc |
| 130 | + (ops taken into account without asking — no new code path); with `signals_found: false` and no |
| 131 | + human, it records "no signals found (not confirmed absent)" rather than asserting no ops layer. |
| 132 | +- **§7 WRITE surface** — add `docs/superpowers/architecture/operations.md` to the approved |
| 133 | + v1 write set. It is a normal cited architecture doc: provenance header, output secret |
| 134 | + gate, commit-before-index all apply unchanged. |
| 135 | +- **Refresh / §9 manifest** — `operations.md` is a normal cited arch doc, so it rides the |
| 136 | + existing `.onboard-manifest.json` cited-evidence staleness machinery with no new gate. |
| 137 | + |
| 138 | +### 4.3 Spec `2026-06-30-v-onboard-design.md` |
| 139 | + |
| 140 | +- Add an artifacts-table row: |
| 141 | + `operations.md | docs/superpowers/architecture/ | ops signals found or maintainer-pointed, confirmed | citation hybrid (§7)`. |
| 142 | +- Note `operations.md` as the **conditional fourth** architecture doc (the durable set is |
| 143 | + three-always + `operations.md`-when-ops), consistent with the Cline Memory Bank framing. |
| 144 | + |
| 145 | +## 5. Files touched |
| 146 | + |
| 147 | +| File | Change | |
| 148 | +|---|---| |
| 149 | +| `scripts/compound-v-onboard.py` | `detect_ops()` + `detect-ops` CLI parser/output + selftest | |
| 150 | +| `skills/compound-v/onboarding.md` | §1 DETECT bullet, §3 EXTRACT type, new operations.md section, §6 gate confirm, §7 write surface, refresh note | |
| 151 | +| `docs/superpowers/specs/2026-06-30-v-onboard-design.md` | artifacts-table row + conditional-fourth prose | |
| 152 | + |
| 153 | +No `verify-citations` / claims-schema change. No pre-flight change. |
| 154 | + |
| 155 | +## 6. Verification |
| 156 | + |
| 157 | +- `detect_ops` selftest passes (`signals_found`-true on fixture; `signals_found`-false **with empty |
| 158 | + lists** on bare) inside the existing `python3 scripts/compound-v-onboard.py selftest` run; whole |
| 159 | + selftest stays green. |
| 160 | +- `detect-ops --json` returns the grouped inventory on a real ops repo (e.g. the Laravel+Vue |
| 161 | + dogfood with `docker/**` + `.github/workflows/ci.yml`); `no-signals` on a bare tree. |
| 162 | +- Manual pipeline read-through, **both** gate branches: an ops repo surfaces the confirm and, on |
| 163 | + approval, writes a cited `operations.md`; a signal-less repo surfaces the **open question** (not a |
| 164 | + silent skip) — the doc is written if the maintainer points at a bespoke deployer, skipped only if |
| 165 | + they confirm none. |
0 commit comments