@mriekki/lean 0.2.1 → 0.3.1

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.
@@ -0,0 +1,369 @@
1
+ ---
2
+ name: deployment-readiness
3
+ description: Guided readiness for any named deployment environment. Discovers and confirms simple machine facts first, verifies access/trust safely, repairs only missing setup, and hands ready environments to /deploy.
4
+ argument-hint: "[deployment-enabler-ID] [status|discovery|enable|resume] [environment]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Deployment Readiness
10
+
11
+ `/deployment-readiness` is the reusable operational workflow for preparing named deployment environments such as Staging, Production, test, demo, or another repository-approved environment.
12
+
13
+ It is not a deployment executor and it is not a production-only workflow. Production is an environment role/policy with stronger gates, not a separate readiness mechanism.
14
+
15
+ Modes:
16
+
17
+ ```text
18
+ status
19
+ discovery
20
+ enable
21
+ resume
22
+ ```
23
+
24
+ ## 1. Resolve minimum context
25
+
26
+ Read `.github/lean-workspace.json` when present plus only the relevant deployment enabler requirements/decisions/readiness record, release/deployment guidance, environment configuration contract, current package/deployment baselines, and repository-provided deployment tooling.
27
+
28
+ A deployment-enabler ID may be inferred from current repository/work-item context when it is unambiguous. Do not force the human to restate an already-known ID.
29
+
30
+ Do not assume:
31
+
32
+ - there is only one deployment environment;
33
+ - an environment named `production` exists;
34
+ - a particular local configuration filename;
35
+ - target OS/runtime/hostname/IP;
36
+ - SSH alias or discovery mechanism;
37
+ - certificate model or hosting environment.
38
+
39
+ ## 2. Human-facing information model
40
+
41
+ Keep the interaction centered on facts a person normally knows about the selected environment's machine:
42
+
43
+ ```text
44
+ environment name / role
45
+ hostname or IP address
46
+ SSH/deployment user when applicable
47
+ SSH port when non-default or already configured
48
+ target OS when known
49
+ ```
50
+
51
+ Deployment tooling may internally require identifiers and files such as a logical target name, `targetName`, SSH alias, profile path, identity-file path, known-hosts path, address override, or trust record. Those are implementation details.
52
+
53
+ **Do not ask the human to invent or transcribe `targetName`, an SSH alias, profile filename/path, known-hosts filename/path, or similar deployment-tool plumbing when the workflow can discover, reuse, or derive it.**
54
+
55
+ Do not lead with questions such as `What is the logical target name?`. If an internal saved-machine/profile identifier must eventually be chosen and cannot be derived safely from existing state or confirmed machine facts, explain it in plain language, recommend a sensible stable value, and ask only at that point.
56
+
57
+ Never use an application-specific example to imply that a reusable machine identity belongs to one POC. A machine/profile may legitimately be reused by multiple POCs while each POC keeps independent environment bindings, application state, data, routes, and deployment evidence.
58
+
59
+ ## 3. Discover first, then ask only for missing facts
60
+
61
+ Invocation begins read-only.
62
+
63
+ Before asking environment-specific setup questions, inspect available non-secret local/repository state to determine whether the selected environment is already configured on this workstation. Use repository-provided readiness helpers and installed deployment tooling when available.
64
+
65
+ Local discovery may inspect, as applicable:
66
+
67
+ - configured named environments and their roles;
68
+ - existing environment-to-machine/target binding;
69
+ - user-scoped deployment target/profile metadata;
70
+ - hostname/address/discovery data already recorded;
71
+ - SSH/deployment user and port metadata;
72
+ - expected target OS;
73
+ - existing readiness evidence;
74
+ - whether required key/trust/profile files exist, without exposing secret contents.
75
+
76
+ Do not probe the remote machine merely to fill in this summary. Remote checks have their own authorization below.
77
+
78
+ Classify the selected environment locally as one of:
79
+
80
+ ```text
81
+ CONFIGURED — enough local state exists to attempt verification
82
+ PARTIAL — some setup exists but required local state is missing/inconsistent
83
+ NOT CONFIGURED — no usable workstation setup exists for this environment
84
+ ```
85
+
86
+ ### Existing configuration
87
+
88
+ When usable configuration already exists, show the simple known facts and ask for confirmation instead of asking the human to reconstruct them:
89
+
90
+ ```text
91
+ STAGING SETUP FOUND
92
+
93
+ Hostname/address: <known value>
94
+ SSH user: <known value or not applicable>
95
+ SSH port: <known/non-default value when useful>
96
+ Target OS: <known/expected value when useful>
97
+ Local setup: CONFIGURED
98
+
99
+ 1. Yes — verify connectivity and identity [REMOTE READ ONLY]
100
+ 2. Something changed — update the facts
101
+ 3. Reconfigure/repair this PC
102
+ 4. Stop
103
+ ```
104
+
105
+ Use the actual selected environment name rather than hardcoding `Staging`.
106
+
107
+ If a hostname and a currently observed/cached IP are both available, they may both be shown. Make clear that an address is connectivity information, not trusted host identity.
108
+
109
+ ### Partial configuration
110
+
111
+ Show what is already known and identify the smallest missing piece. Do not restart onboarding or ask for values that are already present and internally consistent.
112
+
113
+ Examples:
114
+
115
+ ```text
116
+ Hostname/address: server.example.local
117
+ SSH user: deploy
118
+ Missing: trusted host identity
119
+ ```
120
+
121
+ or:
122
+
123
+ ```text
124
+ Hostname/address: NOT SET
125
+ SSH user: deploy
126
+ ```
127
+
128
+ Ask only for the next unresolved simple fact or authorization needed to repair that state.
129
+
130
+ ### No configuration
131
+
132
+ Do not ask for a logical target/profile identifier first. Start with the machine:
133
+
134
+ ```text
135
+ STAGING IS NOT CONFIGURED ON THIS PC
136
+
137
+ What hostname or IP address should Staging use?
138
+ ```
139
+
140
+ Then ask one material fact at a time, such as the SSH/deployment user, only when it is not already defined by repository policy or reusable workstation configuration.
141
+
142
+ Once the human-facing machine facts are known, use repository/Deployment-Kit tooling to create the required internal profile/binding. Prefer deriving/reusing a stable internal identifier from confirmed state when the installed tooling supports it. Surface that identifier only when ambiguity or troubleshooting makes it useful.
143
+
144
+ ## 4. Mode boundaries
145
+
146
+ ### status
147
+
148
+ Read-only overview.
149
+
150
+ With an environment, summarize that environment's local configuration/readiness state.
151
+
152
+ Without an environment, summarize all configured named deployment environments without remotely probing every machine:
153
+
154
+ ```text
155
+ Environment Role Local setup Last readiness
156
+ Staging non-production CONFIGURED READY / STALE / UNKNOWN
157
+ Production production PARTIAL NOT READY
158
+ ```
159
+
160
+ Use only evidence that actually exists. `status` does not authorize remote checks or writes.
161
+
162
+ ### discovery
163
+
164
+ May begin early after the application's foundation/walking skeleton is proven.
165
+
166
+ Purpose:
167
+
168
+ - identify intended named deployment environments and their roles;
169
+ - discover/reuse existing workstation setup before asking questions;
170
+ - confirm simple machine facts with the human;
171
+ - discover each selected environment's real target and expected target OS;
172
+ - identify access/security/network/TLS/certificate dependencies;
173
+ - establish the environment-to-target readiness contract without embedding secrets in reusable source;
174
+ - record non-secret facts in the repository-approved place;
175
+ - surface blockers early.
176
+
177
+ Discovery does not authorize remote writes or application deployment.
178
+
179
+ ### enable
180
+
181
+ Require evidence that deployment engineering completed the normal delivery path, including applicable requirements/review/merge/default-branch CI and repository-policy evidence.
182
+
183
+ Enablement prepares the selected environment so `/deploy` can safely use it. It does not itself authorize application deployment.
184
+
185
+ ### resume
186
+
187
+ Continue from existing environment-specific readiness evidence. Re-discover current local state first and do not re-ask facts that remain valid.
188
+
189
+ ## 5. Select the environment before environment-specific readiness
190
+
191
+ When more than one configured deployment environment exists, select the environment being discovered or enabled before environment-specific questions or remote checks.
192
+
193
+ Keep these concepts separate internally even when the human-facing interaction stays simple:
194
+
195
+ ```text
196
+ named environment
197
+ → environment role/policy
198
+ → configured machine/target binding
199
+ → current hostname/address discovery
200
+ → independently verified host identity
201
+ ```
202
+
203
+ A non-production Staging target and a Production target may use the same deployment implementation while retaining independent target bindings, data, credentials, readiness evidence, and deployment policy.
204
+
205
+ Never let one environment silently fall back to another because discovery/access/readiness fails.
206
+
207
+ ## 6. Session authorization and cadence
208
+
209
+ Local read-only discovery is automatic.
210
+
211
+ When focused readiness-document updates are useful, present one bounded session choice rather than asking after every answer. Never record secret values.
212
+
213
+ Once a modifying readiness session is authorized:
214
+
215
+ ```text
216
+ discover existing state
217
+ → show/confirm known simple facts
218
+ → ask one missing material fact
219
+ → record permitted non-secret fact
220
+ → explain impact/blocker
221
+ → continue
222
+ ```
223
+
224
+ Use concise choices for bounded decisions. Ask factual values such as hostname/IP, username, port, OS/version, path, or observed system state as direct free-form/confirmation questions.
225
+
226
+ ## 7. Verify connectivity and host identity
227
+
228
+ After the human confirms the selected machine, ask or use the explicit choice:
229
+
230
+ ```text
231
+ Verify connectivity and identity for <environment>? [REMOTE READ ONLY]
232
+ ```
233
+
234
+ Only after authorization may remote inspection occur.
235
+
236
+ Prefer repository-provided/Deployment-Kit doctor and verify commands over reconstructing SSH commands by hand.
237
+
238
+ When SSH is the approved transport:
239
+
240
+ - current hostname/IP is an address, not host identity;
241
+ - preserve strict host-key verification;
242
+ - independently verified host identity/trust is required before readiness;
243
+ - an unknown or changed host key fails closed;
244
+ - DHCP/mDNS/address changes must not cause trust weakening;
245
+ - do not scan the LAN, silently choose another host, disable strict checking, or autoaccept a replacement host key.
246
+
247
+ Allowed read-only verification may include OS/version, architecture, current identity/groups, approved runtime state, disk/memory, listening ports, and existence/ownership of approved paths when relevant.
248
+
249
+ ## 8. Existing PC, partial setup, and new PC
250
+
251
+ Follow this decision model:
252
+
253
+ ```text
254
+ local discovery
255
+ │
256
+ ├─ configured + strict verify succeeds
257
+ │ → reuse existing access
258
+ │ → skip onboarding/setup questions
259
+ │
260
+ ├─ partial/broken
261
+ │ → diagnose exact missing state
262
+ │ → repair only that state after the applicable bounded authorization
263
+ │ → strict verify again
264
+ │
265
+ └─ not configured
266
+ → ask simple machine facts
267
+ → create required local profile/key/agent/trust/binding through approved tooling
268
+ → strict verify
269
+ ```
270
+
271
+ Possible missing state includes profile/binding, key, SSH-agent membership, independently verified trust, target-side public-key authorization, address discovery, or another repository/tool prerequisite.
272
+
273
+ Do not create duplicate credentials merely because another POC uses the same machine. Reuse an already-valid developer-to-machine relationship when the installed tooling and policy allow it.
274
+
275
+ ## 9. Network, security, DNS, TLS, runtime, and storage
276
+
277
+ After basic machine/access facts are established, discover/verify only what the selected environment's approved role requires, such as:
278
+
279
+ - actual target OS/version/architecture;
280
+ - runtime/container support;
281
+ - storage/data/backup paths;
282
+ - inbound/outbound network dependencies;
283
+ - firewall/security approvals;
284
+ - DNS/server name;
285
+ - HTTP/HTTPS and TLS/certificate model;
286
+ - registry/artifact access;
287
+ - migration/readiness/smoke/rollback/recovery prerequisites.
288
+
289
+ Do not front-load these questions before basic environment/machine identity is understood.
290
+
291
+ ## 10. Bounded setup/provisioning writes
292
+
293
+ A missing prerequisite is not authorization to change it.
294
+
295
+ Examples of bounded actions include:
296
+
297
+ ```text
298
+ Create/update local environment binding [LOCAL CONFIG WRITE]
299
+ Create local deployment key [LOCAL KEY WRITE]
300
+ Add key to SSH agent [SSH AGENT WRITE]
301
+ Enroll independently verified host trust [LOCAL TRUST WRITE]
302
+ Authorize public key on target [SECURITY / REMOTE WRITE]
303
+ Install/upgrade runtime [REMOTE WRITE]
304
+ Create data/backup directories [REMOTE WRITE]
305
+ Configure firewall [SECURITY / REMOTE WRITE]
306
+ Configure registry credential [SECRET / REMOTE WRITE]
307
+ Set source-hosting environment variable/secret [SOURCE-HOSTING WRITE]
308
+ ```
309
+
310
+ Use the installed repository/tool's exact authorization phrase when it defines one. Do not weaken or replace that contract with a generic label.
311
+
312
+ ## 11. Environment deployment readiness
313
+
314
+ Before declaring the selected environment ready for `/deploy`, verify the evidence required by its approved role/policy.
315
+
316
+ Common evidence includes:
317
+
318
+ - selected environment and confirmed machine/target binding;
319
+ - strict connectivity/host-identity verification;
320
+ - supported developer-workstation launcher;
321
+ - expected target OS matches actual target OS;
322
+ - approved release/artifact policy;
323
+ - immutable artifact/image digest when applicable;
324
+ - artifact/registry access;
325
+ - independent environment data/backup paths;
326
+ - migration path;
327
+ - deployment lock behavior;
328
+ - readiness and smoke checks;
329
+ - application rollback;
330
+ - explicit database-restore/recovery boundary;
331
+ - unresolved security blockers = none.
332
+
333
+ A non-production environment may use a less restrictive artifact policy only when approved requirements say so. Do not infer relaxed Staging behavior.
334
+
335
+ ## 12. Readiness handoff
336
+
337
+ For any selected environment that is ready:
338
+
339
+ ```text
340
+ ENVIRONMENT READY FOR DEPLOYMENT WORKFLOW
341
+
342
+ Environment: <name>
343
+ Role: <role>
344
+ Hostname/address: <confirmed non-secret value when appropriate>
345
+ Target OS/architecture: <verified>
346
+ Access/host identity: VERIFIED
347
+ Release/artifact policy: <verified>
348
+ Security blockers: NONE
349
+ Readiness/Smoke: READY
350
+ Rollback: READY
351
+
352
+ NEXT
353
+ /deploy <environment>
354
+ ```
355
+
356
+ For a production-role environment, include the additional production policy/backup/recovery evidence required by the project, but do not change the readiness mechanism or command name.
357
+
358
+ This is readiness evidence, not deployment authorization. `/deploy` owns the actual deployment write gate for the exact environment, verified target, artifact, and current evidence.
359
+
360
+ ## 13. Post-readiness
361
+
362
+ Once an environment is ready:
363
+
364
+ - record non-secret readiness evidence in the repository-approved place;
365
+ - keep readiness independent from other environments;
366
+ - use `/deploy [environment]` for repeatable deployment;
367
+ - return to `/deployment-readiness` when machine binding, address, expected OS/runtime, security posture, credentials, or another material prerequisite changes.
368
+
369
+ Application rollback, database restore/destructive recovery, and environment tear-down remain separately governed when data safety warrants it.
@@ -146,7 +146,7 @@ After merge:
146
146
  For a release/deployment engineering enabler after engineering delivery is complete, recommend:
147
147
 
148
148
  ```text
149
- /production-readiness <deployment-enabler-ID> enable [environment]
149
+ /deployment-readiness <deployment-enabler-ID> enable [environment]
150
150
  ```
151
151
 
152
152
  when the selected environment still needs operational discovery/enablement.
@@ -157,7 +157,13 @@ When evidence shows a configured named environment is ready for deployment, reco
157
157
  /deploy [environment]
158
158
  ```
159
159
 
160
- rather than treating `/production-readiness` as the normal application-deployment executor.
160
+ rather than treating `/deployment-readiness` as the application-deployment executor.
161
+
162
+ When the user asks for readiness across configured environments, recommend the read-only overview:
163
+
164
+ ```text
165
+ /deployment-readiness <deployment-enabler-ID> status
166
+ ```
161
167
 
162
168
  Do not infer readiness of one environment from another. Production is never an implicit/default environment, and `/next-step` never authorizes a remote or production deployment merely by recommending `/deploy`.
163
169
 
@@ -47,6 +47,14 @@ If local requirements are DRAFT and carry material behavior, human approval is t
47
47
 
48
48
  If requirements are already sufficient/approved under the configured model, do not force another refinement cycle.
49
49
 
50
+ ### CI/policy evidence is not a start-work gate
51
+
52
+ When requirements say CI/checks must pass before a later merge, release, or deployment action, use repository-configured workflows/checks plus observable repository policy/mergeability as the planning evidence available now.
53
+
54
+ Do not interpret words such as `required CI` or `required checks` as a mandate to discover GitHub branch-protection/ruleset admin settings before implementation can begin. Those settings may provide additional evidence later when they are observable, but inability to read them is not by itself a blocker.
55
+
56
+ Do not ask the human to open GitHub Settings and transcribe required-check names merely to proceed with `/start-work`. Stop and ask only when actual evidence conflicts or missing policy information creates a concrete unresolved decision that materially affects implementation or the later consequential action.
57
+
50
58
  ## 3. Classify risk
51
59
 
52
60
  ### LIGHT
@@ -147,24 +155,26 @@ Stop and ask only when branch policy/naming is materially ambiguous, the intende
147
155
 
148
156
  For LIGHT work, branch setup is part of the human-selected implementation action. For STANDARD/ELEVATED work, it is part of the approved implementation start after plan approval. Merely inspecting `/start-work` does not authorize implementation before its required gate.
149
157
 
150
- ## 7. Production deployment enabler
158
+ ## 7. Deployment enabler
151
159
 
152
- When a work item owns production release/deployment, classify it ELEVATED.
160
+ When a work item owns release/deployment engineering or environment enablement, classify it ELEVATED when the change materially affects deployment/recovery/security behavior.
153
161
 
154
- Production target discovery may begin early with:
162
+ Environment discovery may begin early with:
155
163
 
156
164
  ```text
157
- /production-readiness <deployment-enabler-ID> discovery
165
+ /deployment-readiness <deployment-enabler-ID> discovery [environment]
158
166
  ```
159
167
 
160
- Discovery is non-destructive and does not authorize production writes.
168
+ Discovery begins with existing local/repository configuration, shows simple known machine facts for confirmation, and does not authorize remote writes or deployment.
161
169
 
162
- After implementation review/local acceptance, use `/deliver`. After merge and required post-merge default-branch CI is green, hand off to:
170
+ After implementation review/local acceptance, use `/deliver`. After `/deliver` reports the merge, default-branch CI, and applicable repository-policy evidence satisfied, hand off to:
163
171
 
164
172
  ```text
165
- /production-readiness <deployment-enabler-ID> enable
173
+ /deployment-readiness <deployment-enabler-ID> enable [environment]
166
174
  ```
167
175
 
176
+ Production remains a role with stronger policy and deployment authorization; it does not use a separate readiness workflow.
177
+
168
178
  ## 8. Guided ending
169
179
 
170
180
  Return:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mriekki/lean",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Public consumer distribution and updater for Lean engineering assets.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,59 +0,0 @@
1
- # Production Enablement
2
-
3
- Production enablement is a guided operational lane separate from ordinary engineering delivery.
4
-
5
- A repository may have multiple named deployment environments, for example a non-production staging/portable environment and a true production environment. Each environment owns its own verified target binding, readiness evidence, data/backup state, credentials, and deployment policy.
6
-
7
- Use:
8
-
9
- ```text
10
- /production-readiness <deployment-enabler-ID> discovery [environment]
11
- ```
12
-
13
- early enough to discover real target dependencies.
14
-
15
- After deployment engineering is reviewed, delivered, merged, and required post-merge default-branch CI is green, use:
16
-
17
- ```text
18
- /production-readiness <deployment-enabler-ID> enable [environment]
19
- ```
20
-
21
- The readiness workflow covers:
22
-
23
- - named environment role/policy,
24
- - actual target OS/version/architecture/host discovery,
25
- - stable environment-to-target binding,
26
- - deployment identity/access,
27
- - SSH host-trust and portable-addressing safety when SSH is used,
28
- - developer-machine and source-hosting/CI read-only checks,
29
- - optionally authorized read-only remote target checks,
30
- - runtime/storage/data/backup readiness,
31
- - network/firewall/security/DNS/TLS/certificate readiness,
32
- - external blockers,
33
- - separately authorized bounded provisioning/configuration,
34
- - approved release/artifact policy,
35
- - migration/readiness/smoke/rollback evidence.
36
-
37
- Address discovery is not host trust. When SSH is used, unknown or changed host identity stops access; readiness must not recover by disabling host-key verification, silently enrolling new trust, scanning/selecting another host, weakening network controls, or redirecting to another environment.
38
-
39
- Readiness is environment-specific. Readiness of staging does not prove production is ready, and failure of one environment must never cause fallback to another environment or target.
40
-
41
- Once the selected environment is ready, the repeatable deployment entry point is:
42
-
43
- ```text
44
- /deploy [environment]
45
- ```
46
-
47
- `/deploy` requires explicit environment selection when omitted, verifies the environment/target/artifact evidence, dispatches to the repository-provided platform-appropriate deployment launcher, and presents the applicable write gate immediately before execution.
48
-
49
- Production is never an implicit/default deployment target. A production-role deployment requires a distinct `[PRODUCTION WRITE]` authorization for the exact environment, verified target, release/artifact, and current evidence shown by `/deploy`.
50
-
51
- A non-production remote deployment still requires bounded `[REMOTE WRITE]` authorization.
52
-
53
- Developer workstation OS and deployment target OS are separate dimensions. A repository may provide PowerShell on Windows and shell on macOS/Linux while both invoke equivalent deployment behavior against an approved Ubuntu target. Future Windows/macOS target support requires target-specific implementation/readiness; common SSH transport alone does not establish runtime/deployment parity.
54
-
55
- Remote read-only authorization never implies permission for writes.
56
-
57
- No requirements approval, Reviewer verdict, PR merge, CI result, environment selection, readiness result, or previous deployment implies production-deployment authorization.
58
-
59
- Secret values stay out of tracked documentation and logs. Database restore/destructive recovery remains a separate decision when data safety warrants it.