@mriekki/lean 0.2.1 → 0.3.2

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.
@@ -1,357 +0,0 @@
1
- ---
2
- name: production-readiness
3
- description: Guided continuous deployment-environment discovery and enablement, including target OS/access, SSH trust, security/network/TLS, read-only checks, bounded provisioning, and readiness handoff to /deploy.
4
- argument-hint: "<deployment-enabler-ID> [discovery|enable|resume] [environment]"
5
- user-invocable: true
6
- disable-model-invocation: true
7
- ---
8
-
9
- # Production Readiness
10
-
11
- This is a guided operational workflow for preparing named deployment environments. It is not an autonomous production administrator and it is not the normal deployment executor.
12
-
13
- Modes:
14
-
15
- ```text
16
- discovery
17
- enable
18
- resume
19
- ```
20
-
21
- ## 1. Resolve minimum context
22
-
23
- Read `.github/lean-workspace.json` when present plus only the relevant deployment enabler requirements/decisions/readiness record, release/deployment guidance, environment/target configuration contract, and deployment code/workflows.
24
-
25
- Do not assume:
26
-
27
- - there is only one deployment environment,
28
- - an environment named `production` exists,
29
- - a particular work-item path,
30
- - target OS/runtime/hostname/IP,
31
- - SSH alias or discovery mechanism,
32
- - certificate model or hosting environment.
33
-
34
- Use the approved project context and checkout-local non-secret target configuration when the project defines it.
35
-
36
- ## 2. Mode boundaries
37
-
38
- ### discovery
39
-
40
- May begin early after the application's foundation/walking skeleton is proven.
41
-
42
- Purpose:
43
-
44
- - identify intended named deployment environments and their roles,
45
- - discover each selected environment's real target and expected target OS,
46
- - identify access/security/network/TLS/certificate dependencies,
47
- - establish the environment-to-target readiness contract without embedding household- or checkout-specific secrets in reusable source,
48
- - record non-secret facts,
49
- - surface blockers early.
50
-
51
- Discovery does not authorize remote writes or deployment.
52
-
53
- ### enable
54
-
55
- Require evidence that deployment engineering completed the normal delivery path, such as:
56
-
57
- ```text
58
- requirements approved under the configured authority model
59
- implementation complete
60
- local verification satisfactory
61
- Reviewer READY
62
- human meaningful-diff approval
63
- PR CI green
64
- merged to default branch
65
- required post-merge default-branch CI green
66
- ```
67
-
68
- If evidence is missing, stop enablement and route back through the failed gate or `/deliver`.
69
-
70
- Enablement prepares the selected environment so `/deploy` can safely use it. It does not itself authorize an application deployment.
71
-
72
- ### resume
73
-
74
- Continue from the project's existing environment-specific readiness record when one exists.
75
-
76
- ## 3. Select the environment before environment-specific readiness
77
-
78
- When more than one configured deployment environment exists, select the environment being discovered or enabled before asking environment-specific questions.
79
-
80
- Treat these as separate concepts:
81
-
82
- ```text
83
- named environment
84
- → environment role/policy
85
- → configured target binding
86
- → stable logical/SSH identity
87
- → current address discovery
88
- → independently verified host identity
89
- ```
90
-
91
- A non-production portable/staging target and a true production target may use the same deployment implementation while retaining independent target identities, data, credentials, readiness evidence, and deployment policy.
92
-
93
- Never let one environment silently fall back to another environment or target because discovery/access/readiness fails.
94
-
95
- ## 4. Session authorization
96
-
97
- Invocation begins read-only.
98
-
99
- Present a state/menu such as:
100
-
101
- ```text
102
- CURRENT STATE
103
- <selected environment + readiness summary>
104
-
105
- RECOMMENDED NEXT STEP
106
- <one action and why>
107
-
108
- OPTIONS
109
- 1. Begin/resume guided readiness [MODIFIES DOCS]
110
- 2. Review readiness evidence [READ ONLY]
111
- 3. Run available read-only checks only [READ ONLY]
112
- 4. Stop [NO ACTION]
113
- ```
114
-
115
- If option 1 is selected, focused updates to the existing deployment-readiness/decision record are authorized for the active session. If the repository has no permitted readiness document, keep session notes/proposed updates rather than inventing a competing authority.
116
-
117
- Never record secret values.
118
-
119
- ## 5. Continuous cadence
120
-
121
- Once a modifying readiness session is authorized:
122
-
123
- ```text
124
- ask one material question
125
- → human answers
126
- → record the non-secret resolved fact
127
- → explain impact/blocker
128
- → ask the next material question
129
- ```
130
-
131
- Use choice-first presentation from `INTERACTIVE_SESSION_GUIDE.md` for bounded operational decisions such as environment role, exposure mode, approved runtime model, TLS termination pattern, or another small set of credible policy/configuration alternatives.
132
-
133
- Ask environment-specific facts such as OS/version, hostname, IP address, target label, account, port, filesystem path, certificate identity, or observed system state as free-form/confirmation questions; do not invent plausible-looking operational values merely to offer choices.
134
-
135
- Do not ask after every answer whether to continue/update.
136
-
137
- Pause only for:
138
-
139
- - human stop,
140
- - natural readiness/action gate,
141
- - architecture/security conflict requiring a separate decision,
142
- - remote/GitHub/security write requiring explicit authorization.
143
-
144
- ## 6. Resolve the actual target OS and runtime per environment
145
-
146
- Do not choose commands before the selected environment and real target are confirmed.
147
-
148
- For the selected environment discover/verify, one at a time as relevant:
149
-
150
- - environment name and role (`production` or approved non-production role),
151
- - stable target label / binding,
152
- - expected target OS and version,
153
- - actual target OS and version,
154
- - CPU architecture,
155
- - hostname/current address/discovery model,
156
- - LAN/private/public exposure,
157
- - deployment/SSH account,
158
- - SSH port/authentication,
159
- - service-account model,
160
- - approved runtime (Docker/Compose or other),
161
- - persistent-data path,
162
- - backup path,
163
- - storage capacity.
164
-
165
- If the actual target conflicts materially with the environment's approved target OS/runtime/architecture, stop and resolve the design rather than silently adapting.
166
-
167
- Readiness is environment-specific. Do not treat successful readiness of one target as evidence that another target is ready.
168
-
169
- ## 7. SSH target identity and portable discovery
170
-
171
- When SSH is the approved deployment transport, keep address discovery separate from trust.
172
-
173
- Verify as applicable:
174
-
175
- - the selected environment resolves through its approved stable logical target/SSH alias,
176
- - the expected SSH host identity was independently verified before trust enrollment,
177
- - an unknown or changed host key stops access,
178
- - changing DHCP/mDNS/current address does not require weakening host-key verification,
179
- - no fallback scans the LAN, silently chooses another host, disables strict host-key checks, or enrolls new trust merely because discovery failed,
180
- - repository configuration does not contain private keys, passphrases, copied trust databases, or secret credentials.
181
-
182
- If the project uses a portable trusted-LAN target, a stable discovery name such as mDNS may be appropriate, but discovery technology is project/profile-specific. The reusable invariant is stable logical target identity plus independently verified host identity.
183
-
184
- When changing SSH authentication policy, verify intended key access before disabling alternative authentication and preserve an approved recovery path while making the bounded change.
185
-
186
- ## 8. Network, security, DNS, TLS
187
-
188
- Ask/verify as relevant:
189
-
190
- - inbound ports,
191
- - outbound registry/source-hosting/DNS/NTP dependencies,
192
- - firewall/security approvals,
193
- - DNS/server name,
194
- - HTTP vs HTTPS,
195
- - TLS/certificate source,
196
- - termination point,
197
- - trust chain,
198
- - renewal owner/process.
199
-
200
- Certificates may legitimately be N/A for an approved private HTTP design. Public exposure/HTTPS changes that contradict approved design are material security/architecture decisions.
201
-
202
- Record external blockers and continue unrelated discovery. Never propose bypassing organizational controls.
203
-
204
- ## 9. Developer-system read-only checks
205
-
206
- Offer a bounded read-only check before changing anything.
207
-
208
- Use repository-provided helpers when present; otherwise show platform-appropriate commands for inspection. Common checks include Git, source-hosting CLI/auth, build tooling, approved container runtime, SSH, HTTP tooling, and TLS inspection capability.
209
-
210
- Determine the developer workstation OS independently of the deployment target OS. A repository may use different local launchers (for example PowerShell on Windows and shell on macOS/Linux) that invoke the same target-side deployment contract.
211
-
212
- State what was actually checked and what was not.
213
-
214
- ## 10. Source-hosting / CI read-only checks
215
-
216
- Where GitHub is used, inspect only non-secret metadata needed for readiness, such as:
217
-
218
- - repository/default branch,
219
- - workflows/recent required CI,
220
- - environment names,
221
- - variable names,
222
- - secret names (never values),
223
- - release metadata.
224
-
225
- For other source/CI systems, use their repository-approved equivalent.
226
-
227
- ## 11. Remote selected-environment check
228
-
229
- After the selected environment's target/user/port are known, explicitly ask:
230
-
231
- ```text
232
- Run read-only check against <environment>? [REMOTE READ ONLY]
233
- ```
234
-
235
- Only after authorization may remote inspection occur.
236
-
237
- Allowed examples:
238
-
239
- - host identity/fingerprint evidence when the approved process permits it,
240
- - OS/version and architecture,
241
- - current identity/groups,
242
- - approved runtime version/state,
243
- - disk/memory,
244
- - listening ports,
245
- - basic system state,
246
- - existence/ownership of approved data/backup paths.
247
-
248
- Read-only authorization does not permit:
249
-
250
- - package installation,
251
- - user/group or directory creation,
252
- - firewall changes,
253
- - registry login,
254
- - image pulls,
255
- - migrations,
256
- - deployment,
257
- - data changes.
258
-
259
- If automated remote access is prohibited, provide exact read-only commands for an authorized human/admin to run and return non-secret output.
260
-
261
- ## 12. TLS/certificate check
262
-
263
- Only when TLS is part of the selected environment's approved design.
264
-
265
- A read-only endpoint certificate check may inspect:
266
-
267
- - subject/SAN,
268
- - issuer,
269
- - validity dates,
270
- - trust/policy result,
271
- - expected server name/port.
272
-
273
- Never inspect/copy private keys.
274
-
275
- ## 13. Bounded provisioning/configuration writes
276
-
277
- After discovery, present missing prerequisites as small explicit write actions, for example:
278
-
279
- ```text
280
- Create service/deployment account [REMOTE WRITE]
281
- Install/upgrade runtime [REMOTE WRITE]
282
- Create data/backup directories [REMOTE WRITE]
283
- Configure SSH access [SECURITY / REMOTE WRITE]
284
- Configure firewall [SECURITY / REMOTE WRITE]
285
- Configure registry credential [SECRET / REMOTE WRITE]
286
- Create source-hosting environment [SOURCE-HOSTING WRITE]
287
- Set secret/variable [SOURCE-HOSTING WRITE]
288
- Install/configure certificate [SECURITY / REMOTE WRITE]
289
- ```
290
-
291
- Do not execute a write merely because it is needed. Each bounded write requires explicit human authorization.
292
-
293
- Changing an environment's target binding or enrolling a replacement host identity is readiness/configuration work and requires explicit authorization. Do not perform it implicitly from `/deploy`.
294
-
295
- Keep secret values out of tracked files and logs.
296
-
297
- ## 14. Environment deployment readiness
298
-
299
- Before declaring the selected environment ready for `/deploy`, verify the evidence required by its approved role/policy.
300
-
301
- Common evidence includes:
302
-
303
- - selected environment and independently verified target binding,
304
- - supported developer workstation launcher,
305
- - expected target OS matches actual target OS,
306
- - approved release/artifact policy,
307
- - immutable artifact/image digest when applicable,
308
- - artifact/registry access,
309
- - independent environment data/backup paths,
310
- - migration path,
311
- - deployment lock behavior,
312
- - readiness checks,
313
- - smoke tests,
314
- - application rollback,
315
- - explicit database-restore/recovery boundary,
316
- - unresolved security blockers = none.
317
-
318
- A non-production environment may use a less restrictive release policy only when the project's approved requirements say so. Do not infer that staging may deploy arbitrary mutable artifacts.
319
-
320
- ## 15. Production readiness handoff
321
-
322
- For a production-role environment, when readiness prerequisites are satisfied present a summary such as:
323
-
324
- ```text
325
- PRODUCTION ENVIRONMENT READY FOR DEPLOYMENT WORKFLOW
326
-
327
- Environment: <name>
328
- Target: <verified target>
329
- OS/architecture: <verified>
330
- Release/artifact policy: <verified>
331
- Exposure/TLS: <verified mode>
332
- Security blockers: NONE
333
- Backup: READY
334
- Migration: READY
335
- Readiness/Smoke: READY
336
- Rollback: READY
337
-
338
- NEXT
339
- /deploy <environment>
340
- ```
341
-
342
- This is readiness evidence, not deployment authorization.
343
-
344
- The actual production write gate belongs to `/deploy`, where the exact environment, verified target, release/artifact, and current evidence are shown together immediately before execution.
345
-
346
- Requirements approval, code review, PR merge, CI success, environment readiness, or a previous deployment never imply the next deployment authorization.
347
-
348
- ## 16. Post-readiness
349
-
350
- Once an environment is ready:
351
-
352
- - record non-secret readiness evidence in the repository-approved place,
353
- - keep environment readiness independent from other environments,
354
- - use `/deploy [environment]` for the repeatable deployment workflow,
355
- - return to readiness when the target binding, expected OS/runtime, security posture, credentials, or other material prerequisites change.
356
-
357
- Deployment outcome evidence may update the repository's operational record after an authorized `/deploy`, but application rollback and database restore/destructive recovery remain separate decisions when data safety warrants it.