wdi-method 0.6.18 → 0.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,6 +43,7 @@ Never a rule. When it disagrees with a guide, the guide wins and the disagreemen
43
43
  | [`language-guide.md`](language-guide.md) | Naming anything — a code identifier, a code file, a document file |
44
44
  | [`method-glossary.md`](method-glossary.md) | Unsure what a method term means — layer, wave, Product Component, ID code |
45
45
  | [`structure-guide.md`](structure-guide.md) | Writing or checking the two structure maps in `.control/` |
46
+ | [`ci-guide.md`](ci-guide.md) | Writing or changing a CI workflow; when a push may start a cloud run, and what MUST NOT |
46
47
 
47
48
  ## `document/` — document rules
48
49
 
@@ -0,0 +1,150 @@
1
+ ---
2
+ status: Accepted
3
+ ---
4
+
5
+ # CI Guide
6
+
7
+ **Loaded when:** writing or changing a GitHub Actions workflow, or deciding whether a push may start a
8
+ cloud run
9
+
10
+ Cloud runners are **metered**, and the meter is not flat: a Windows runner bills at **2×** the minutes it
11
+ uses and macOS at **10×**, and on a private repository every one of those minutes comes out of a monthly
12
+ allowance. One real run of `wdi-autopilot` over fifteen tickets pushed often enough to start CI dozens of
13
+ times and spent most of a month's allowance in two days.
14
+
15
+ **The fix is not fewer commits.** Commits stay granular — one per ticket, plus the memlog and registry
16
+ writes — because that is what makes a run reviewable and resumable. What changes is **what a push
17
+ triggers**.
18
+
19
+ ## One unit of work, one cloud run
20
+
21
+ | | Runs where | When |
22
+ |---|---|---|
23
+ | Build, typecheck, the full suite **during** the work | **Locally**, on the machine doing the work | Every ticket — `wdi-build` Phase 3 Step 2 already requires it, and it is free |
24
+ | The cloud workflow | GitHub Actions | **Once**, when the work is offered for review |
25
+
26
+ - A workflow MUST be configured so that an intermediate push — a ticket commit, a memlog rewrite, a
27
+ registry catch-up, a spec close — starts **nothing**.
28
+ - The cloud run MUST happen before the work is merged. Green CI on the **pushed head SHA** is still the
29
+ release evidence; what moves is how many times it is collected, not whether it is.
30
+ - Under a mandate the unit of work is the whole run, so the one cloud run belongs at `wdi-autopilot`
31
+ § Finish. That skill owns the sequence and this guide MUST NOT restate it.
32
+ - Where the repo's workflow cannot be changed — a shared org template, a workflow another team owns —
33
+ the run MUST keep intermediate work off the remote instead: hold the push, or make the pushed head
34
+ commit carry `[skip ci]`, which GitHub honours for `push` and `pull_request` events.
35
+
36
+ ## Trigger shape
37
+
38
+ | Event | Use it | Why |
39
+ |---|---|---|
40
+ | `workflow_dispatch` | **MUST** be present | The manual re-run. Without it, a red run can only be retried by pushing again |
41
+ | `pull_request:` `types: [ready_for_review]` | The one automatic trigger | A draft PR is work in progress; marking it ready is the moment somebody is asking for the verdict |
42
+ | `push:` `branches: [main]` | MAY | One run per merge, as the record of trunk health. Drop it where the allowance is tight |
43
+ | bare `on: push` | **MUST NOT** | Every branch, every commit, no filter. This is the setting that spends an allowance |
44
+
45
+ Two consequences worth stating, because both surprise people:
46
+
47
+ - With `types: [ready_for_review]` and no `synchronize`, a push **after** the PR is ready does not
48
+ re-run CI. Re-run it with `workflow_dispatch`, or convert the PR back to draft and mark it ready
49
+ again. That is the intended trade: the re-run is a decision, not a reflex.
50
+ - `concurrency` with `cancel-in-progress: true` stops two runs of the same ref from billing at once.
51
+ Every workflow below sets it.
52
+
53
+ ## What MUST NOT start a build
54
+
55
+ A change that touches only prose or only the corpus cannot break the code, so it MUST NOT start the
56
+ product's build. `paths-ignore` carries that: `**.md`, `.scratch/**`, and the method's own layers —
57
+ `.control/**`, `.what/**`, `.how/**`, `.constitution/**`, `_bmad-output/**`, `.work/**`.
58
+
59
+ The corpus workflow is the **mirror image** of that list and MUST stay a separate workflow: it runs the
60
+ validators, on Ubuntu, only when the corpus changed. Keeping the two apart is what lets the expensive one
61
+ be ignored while the cheap one still guards the registry.
62
+
63
+ ## Template — `.github/workflows/ci.yml`
64
+
65
+ The product's build and test. This is the expensive one; the `runs-on` and the two `run:` lines are the
66
+ product's, and they come from `.constitution/project/codebase-stack-guide.md`.
67
+
68
+ ```yaml
69
+ name: ci
70
+
71
+ on:
72
+ workflow_dispatch:
73
+ pull_request:
74
+ types: [ready_for_review]
75
+ paths-ignore:
76
+ - '**.md'
77
+ - '.scratch/**'
78
+ - '.control/**'
79
+ - '.what/**'
80
+ - '.how/**'
81
+ - '.constitution/**'
82
+ - '_bmad-output/**'
83
+ - '.work/**'
84
+ # One run per merge, as the record of trunk health. Delete this block where the allowance is tight.
85
+ push:
86
+ branches: [main]
87
+ paths-ignore:
88
+ - '**.md'
89
+ - '.scratch/**'
90
+ - '.control/**'
91
+ - '.what/**'
92
+ - '.how/**'
93
+ - '.constitution/**'
94
+ - '_bmad-output/**'
95
+ - '.work/**'
96
+
97
+ concurrency:
98
+ group: ci-${{ github.ref }}
99
+ cancel-in-progress: true
100
+
101
+ jobs:
102
+ build:
103
+ # A Windows runner bills 2× and macOS 10×. Name only the platforms the product actually ships on.
104
+ runs-on: ubuntu-latest
105
+ steps:
106
+ - uses: actions/checkout@v4
107
+ # Replace both lines with this product's build and test commands.
108
+ - run: echo "build command from codebase-stack-guide.md"
109
+ - run: echo "test command from codebase-stack-guide.md"
110
+ ```
111
+
112
+ ## Template — `.github/workflows/korpus.yml`
113
+
114
+ The corpus validators. Cheap, Ubuntu, and it runs only when the corpus moved — so it MAY keep the
115
+ default `pull_request` trigger, which gives a verdict on the registry while the expensive workflow stays
116
+ quiet. `korpus.yml` validates the corpus and **not** the code: a green run here is never build evidence.
117
+
118
+ ```yaml
119
+ name: korpus
120
+
121
+ on:
122
+ workflow_dispatch:
123
+ pull_request:
124
+ paths:
125
+ - '.control/**'
126
+ - '.what/**'
127
+ - '.how/**'
128
+ - '.constitution/**'
129
+
130
+ concurrency:
131
+ group: korpus-${{ github.ref }}
132
+ cancel-in-progress: true
133
+
134
+ jobs:
135
+ validate:
136
+ runs-on: ubuntu-latest
137
+ steps:
138
+ - uses: actions/checkout@v4
139
+ # The three scripts declare their dependencies inline (PEP 723); uv is what runs them.
140
+ - uses: astral-sh/setup-uv@v5
141
+ - run: uv run .constitution/method/scripts/validate.py
142
+ ```
143
+
144
+ ## Red flags
145
+
146
+ - `on: push` with no branch filter, in a repo whose runners are metered
147
+ - The product's build and the corpus validators in one workflow — the cheap half then cannot run alone
148
+ - A cloud run started to find out whether the code compiles, when the local suite answers that for free
149
+ - CI watched per ticket under a mandate, instead of once at § Finish
150
+ - A green `korpus.yml` read as a passing build