@mriekki/lean 0.3.2 → 0.4.0
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.
- package/assets/components.json +3 -3
- package/assets/generated/ASSEMBLY.json +10 -10
- package/assets/generated/core/core/agents/reviewer.agent.md +1 -1
- package/assets/generated/core/core/process/DEPLOYMENT_ENABLEMENT.md +50 -15
- package/assets/generated/core/core/skills/deliver/SKILL.md +4 -2
- package/assets/generated/core/core/skills/deploy/SKILL.md +73 -15
- package/assets/generated/core/core/skills/deployment-readiness/SKILL.md +121 -90
- package/assets/generated/core/core/skills/next-step/SKILL.md +11 -8
- package/assets/generated/core/core/skills/start-work/SKILL.md +7 -5
- package/package.json +1 -1
- package/src/cli.mjs +23 -4
package/assets/components.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "@mriekki/lean",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"defaultProfile": "greenfield-poc",
|
|
6
6
|
"profiles": {
|
|
7
7
|
"greenfield-poc": {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"components": {
|
|
15
15
|
"core": {
|
|
16
16
|
"repository": "mriekki/lean-agentic-core",
|
|
17
|
-
"commit": "
|
|
18
|
-
"version": "1.
|
|
17
|
+
"commit": "7d6b6ce00d83063775d7491626fe6b253b9c51c8",
|
|
18
|
+
"version": "1.13.0",
|
|
19
19
|
"distribution": "greenfield-workspace",
|
|
20
20
|
"descriptor": "assets/core/distribution.json",
|
|
21
21
|
"sourceRoot": "assets/generated/core",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "@mriekki/lean",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"components": {
|
|
6
6
|
"core": {
|
|
7
7
|
"repository": "mriekki/lean-agentic-core",
|
|
8
|
-
"commit": "
|
|
9
|
-
"version": "1.
|
|
8
|
+
"commit": "7d6b6ce00d83063775d7491626fe6b253b9c51c8",
|
|
9
|
+
"version": "1.13.0",
|
|
10
10
|
"distribution": "greenfield-workspace",
|
|
11
11
|
"files": [
|
|
12
12
|
{
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
{
|
|
18
18
|
"source": "core/agents/reviewer.agent.md",
|
|
19
19
|
"destination": ".github/agents/reviewer.agent.md",
|
|
20
|
-
"sha256": "
|
|
20
|
+
"sha256": "2534ef7f1001da725a503874859c84945586c4f2aed9aec0fe3e04bc24de14c3"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"source": "core/agents/coach.agent.md",
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
{
|
|
58
58
|
"source": "core/skills/start-work/SKILL.md",
|
|
59
59
|
"destination": ".github/skills/start-work/SKILL.md",
|
|
60
|
-
"sha256": "
|
|
60
|
+
"sha256": "4d2805305424942c8aa7184d82578e59af1785cfd5b89c9d7314f3a1ffef4027"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"source": "core/skills/next-step/SKILL.md",
|
|
64
64
|
"destination": ".github/skills/next-step/SKILL.md",
|
|
65
|
-
"sha256": "
|
|
65
|
+
"sha256": "6fb5275cc098f3124c85bb20ccf713affac23ebd5b96962558504936f2b891d4"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"source": "core/skills/deliver/SKILL.md",
|
|
69
69
|
"destination": ".github/skills/deliver/SKILL.md",
|
|
70
|
-
"sha256": "
|
|
70
|
+
"sha256": "2c97f86bedf4baf1fb287cdc7b509975bd556861e9739713db85f1c5ee87c6eb"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"source": "core/skills/cleanup-branches/SKILL.md",
|
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
{
|
|
103
103
|
"source": "core/skills/deployment-readiness/SKILL.md",
|
|
104
104
|
"destination": ".github/skills/deployment-readiness/SKILL.md",
|
|
105
|
-
"sha256": "
|
|
105
|
+
"sha256": "02a58ae52cab8b6b11734a8d4217bf7f7c9b11bcd7b35e4a2e16dfb8af8bce34"
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
"source": "core/skills/deploy/SKILL.md",
|
|
109
109
|
"destination": ".github/skills/deploy/SKILL.md",
|
|
110
|
-
"sha256": "
|
|
110
|
+
"sha256": "259c0091672d79b7bc799f92cb21a4143af2951a4f2556794263237dfb7e7d7b"
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
"source": "core/skills/tear-down/SKILL.md",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
{
|
|
143
143
|
"source": "core/process/DEPLOYMENT_ENABLEMENT.md",
|
|
144
144
|
"destination": "docs/process/DEPLOYMENT_ENABLEMENT.md",
|
|
145
|
-
"sha256": "
|
|
145
|
+
"sha256": "3b59c5984ecb51ac48efb40e7e2e24c1971db947d6eefa5dc3671254ca984af7"
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
"source": "core/process/HUMAN_GATES.md",
|
|
@@ -82,4 +82,4 @@ When implementation is READY and the human accepts the meaningful local diff, ex
|
|
|
82
82
|
|
|
83
83
|
Do not vaguely say `merge when ready`.
|
|
84
84
|
|
|
85
|
-
If the delivered work item owns deployment engineering, successful engineering delivery may later hand off to `/deployment-readiness <
|
|
85
|
+
If the delivered work item owns deployment engineering, successful engineering delivery may later hand off to `/deployment-readiness <environment>` for state-driven environment preparation; Reviewer readiness never authorizes remote or production deployment.
|
|
@@ -4,28 +4,24 @@ Deployment enablement is the guided operational lane between delivered deploymen
|
|
|
4
4
|
|
|
5
5
|
A repository may have multiple named deployment environments, such as Staging and Production. Each environment owns its own confirmed machine/target binding, readiness evidence, data/backup state, credentials, and deployment policy.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The normal human-facing entry point is state-driven:
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
|
-
/deployment-readiness
|
|
10
|
+
/deployment-readiness <environment>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
to
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
/deployment-readiness [deployment-enabler-ID] enable [environment]
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
after deployment engineering is reviewed, delivered, merged, and applicable default-branch CI/policy evidence is satisfactory.
|
|
13
|
+
The workflow discovers current state and continues from the furthest safe point. The human does not need to choose separate `discovery`, `enable`, or `resume` modes.
|
|
20
14
|
|
|
21
15
|
For a read-only local overview use:
|
|
22
16
|
|
|
23
17
|
```text
|
|
24
|
-
/deployment-readiness
|
|
18
|
+
/deployment-readiness status [environment]
|
|
25
19
|
```
|
|
26
20
|
|
|
27
21
|
Omit the environment from `status` to summarize all configured named environments without automatically probing every remote machine.
|
|
28
22
|
|
|
23
|
+
Older invocations that include a deployment-enabler ID and/or `discovery`, `enable`, or `resume` may be normalized for compatibility, but they are not the normal interface.
|
|
24
|
+
|
|
29
25
|
## Human-facing readiness model
|
|
30
26
|
|
|
31
27
|
The workflow should ask about simple environment-machine facts before exposing deployment-tool internals.
|
|
@@ -46,7 +42,7 @@ If setup is partial, show what is known and ask only for the smallest missing fa
|
|
|
46
42
|
|
|
47
43
|
If setup is absent, start with the selected machine's hostname or IP address, then ask one additional simple fact at a time only when required.
|
|
48
44
|
|
|
49
|
-
## Discover, confirm, verify
|
|
45
|
+
## Discover, confirm, verify, continue
|
|
50
46
|
|
|
51
47
|
Normal readiness cadence is:
|
|
52
48
|
|
|
@@ -58,15 +54,54 @@ select environment
|
|
|
58
54
|
→ authorize read-only connectivity/identity verification
|
|
59
55
|
→ run repository/Deployment-Kit doctor/verify checks
|
|
60
56
|
→ reuse working access OR repair only missing setup OR onboard a new workstation
|
|
61
|
-
→ verify
|
|
62
|
-
→
|
|
57
|
+
→ verify target/platform/security/artifact/registry/data prerequisites
|
|
58
|
+
→ ENVIRONMENT READY TO DEPLOY
|
|
63
59
|
→ /deploy <environment>
|
|
64
60
|
```
|
|
65
61
|
|
|
62
|
+
The next readiness invocation re-discovers current state and resumes automatically. It does not require a new mode word after discovery or repair.
|
|
63
|
+
|
|
66
64
|
Remote probing does not occur merely to build the initial local summary.
|
|
67
65
|
|
|
68
66
|
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.
|
|
69
67
|
|
|
68
|
+
## Readiness writes versus deployment writes
|
|
69
|
+
|
|
70
|
+
Readiness may perform bounded prerequisite/setup writes when separately authorized and supported by repository tooling, such as:
|
|
71
|
+
|
|
72
|
+
- local environment binding;
|
|
73
|
+
- key/agent/trust setup;
|
|
74
|
+
- target-side access setup;
|
|
75
|
+
- runtime/platform prerequisite setup;
|
|
76
|
+
- data/backup directory preparation;
|
|
77
|
+
- firewall preparation;
|
|
78
|
+
- registry credential setup.
|
|
79
|
+
|
|
80
|
+
Readiness does **not** hide application deployment inside environment preparation.
|
|
81
|
+
|
|
82
|
+
Application container/process deployment, release-specific migration, application route registration, live application health/readiness, live smoke validation, and release-specific deployment/rollback evidence belong to `/deploy` when the repository's deployment contract includes them.
|
|
83
|
+
|
|
84
|
+
This distinction prevents a first-deploy deadlock: readiness proves that the environment can safely accept the selected artifact; `/deploy` creates and validates the live application state.
|
|
85
|
+
|
|
86
|
+
## Pre-deploy versus post-deploy evidence
|
|
87
|
+
|
|
88
|
+
Pre-deploy readiness may require:
|
|
89
|
+
|
|
90
|
+
- verified machine/target binding and host identity;
|
|
91
|
+
- actual target OS/architecture and supported runtime/platform;
|
|
92
|
+
- validated/available route names and collision checks;
|
|
93
|
+
- approved immutable artifact identity;
|
|
94
|
+
- registry/artifact access readiness;
|
|
95
|
+
- persistence/data/backup prerequisites;
|
|
96
|
+
- migration capability;
|
|
97
|
+
- deployment locking capability;
|
|
98
|
+
- rollback/recovery capability and boundaries;
|
|
99
|
+
- stronger Production backup/recovery prerequisites when applicable.
|
|
100
|
+
|
|
101
|
+
Do not require first-deploy evidence that can only exist after the selected artifact is deployed, such as live route resolution, live application health, smoke success, deployed release identity, or execution-backed rollback evidence for that release.
|
|
102
|
+
|
|
103
|
+
`/deploy` establishes those post-deploy facts and reports them from repository/tool evidence.
|
|
104
|
+
|
|
70
105
|
## Existing and new workstations
|
|
71
106
|
|
|
72
107
|
On an already-configured workstation, successful strict verification means onboarding/setup questions are skipped.
|
|
@@ -81,13 +116,13 @@ Readiness is environment-specific. Readiness of Staging does not prove Productio
|
|
|
81
116
|
|
|
82
117
|
Production remains a role with stronger deployment, artifact, backup, recovery, and Human-in-the-Loop policy where required. It does not use a separate readiness command.
|
|
83
118
|
|
|
84
|
-
Once the selected environment is ready, the repeatable deployment entry point is:
|
|
119
|
+
Once the selected environment is ready to deploy, the repeatable deployment entry point is:
|
|
85
120
|
|
|
86
121
|
```text
|
|
87
122
|
/deploy <environment>
|
|
88
123
|
```
|
|
89
124
|
|
|
90
|
-
`/deploy` verifies the selected environment/target/artifact evidence,
|
|
125
|
+
`/deploy` verifies the selected environment/target/artifact evidence, presents the applicable write gate immediately before execution, delegates deterministic deployment mechanics, and then verifies repository-defined live route/readiness/smoke/deployment evidence.
|
|
91
126
|
|
|
92
127
|
A Production deployment remains separately authorized and never becomes implicit because readiness passed. A non-production remote deployment still requires the repository/tool's bounded remote-write authorization.
|
|
93
128
|
|
|
@@ -304,12 +304,14 @@ and preserve the branch.
|
|
|
304
304
|
|
|
305
305
|
## 12. Deployment handoff
|
|
306
306
|
|
|
307
|
-
If the delivered work item owns release/deployment engineering, successful engineering delivery may hand off to:
|
|
307
|
+
If the delivered work item owns release/deployment engineering, successful engineering delivery may hand off to the selected environment's state-driven readiness workflow:
|
|
308
308
|
|
|
309
309
|
```text
|
|
310
|
-
/deployment-readiness <
|
|
310
|
+
/deployment-readiness <environment>
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
+
Readiness re-discovers current state and continues from the furthest safe point; do not ask the human to choose `discovery`, `enable`, or `resume` merely because engineering delivery just completed.
|
|
314
|
+
|
|
313
315
|
The readiness workflow is environment-generic. Production remains an environment role with stronger policy; merge approval never implies remote or production-deployment authorization.
|
|
314
316
|
|
|
315
317
|
## 13. Relationship to /start-work, /next-step, and /cleanup-branches
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deploy
|
|
3
|
-
description: "Guided deployment orchestration for a configured named environment. Verifies
|
|
3
|
+
description: "Guided deployment orchestration for a configured named environment. Verifies pre-deploy readiness, selects the exact target/artifact, preserves tool-specific authorization, delegates deterministic execution, and validates the resulting live deployment."
|
|
4
4
|
argument-hint: "[environment] [release-or-artifact]"
|
|
5
5
|
user-invocable: true
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -8,9 +8,9 @@ disable-model-invocation: true
|
|
|
8
8
|
|
|
9
9
|
# Deploy
|
|
10
10
|
|
|
11
|
-
`/deploy` is the normal human-facing deployment interface once deployment engineering and the selected environment
|
|
11
|
+
`/deploy` is the normal human-facing deployment interface once deployment engineering is delivered and the selected environment is **ready to deploy**.
|
|
12
12
|
|
|
13
|
-
Core owns interaction, validation, target safety,
|
|
13
|
+
Core owns interaction, validation, target safety, Human-in-the-Loop authorization, and evidence-oriented orchestration. Repository-provided deployment tooling owns deployment mechanics.
|
|
14
14
|
|
|
15
15
|
Do not implement Docker, SSH, route, migration, or application deployment logic directly in this skill when an approved repository command exists.
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ Read only the minimum repository context needed to identify:
|
|
|
24
24
|
- `DEPLOYMENT_BASELINE.json` when present;
|
|
25
25
|
- approved deployment/release requirements;
|
|
26
26
|
- configured named environments and checkout-local target bindings;
|
|
27
|
-
- selected environment readiness evidence;
|
|
27
|
+
- selected environment pre-deploy readiness evidence;
|
|
28
28
|
- approved release/artifact policy;
|
|
29
29
|
- repository-provided deployment entry point and its authorization contract;
|
|
30
30
|
- expected developer-workstation and target operating systems.
|
|
@@ -39,7 +39,9 @@ tools/lean-deployment/lean-poc-deploy.py
|
|
|
39
39
|
|
|
40
40
|
over reconstructing Deployment Kit commands by hand or requiring a separate Kit checkout.
|
|
41
41
|
|
|
42
|
-
If package/component baseline integrity is
|
|
42
|
+
If package/component baseline integrity is known to be drifted, deployment engineering is incomplete, or a selected environment has unresolved **pre-deploy** blockers, stop and route to `/lean-update`, `/upstream-fix`, the deployment work item, or `/deployment-readiness <environment>` as appropriate.
|
|
43
|
+
|
|
44
|
+
Do not block a first deployment merely because live route resolution, application health, smoke results, deployed-release identity, or release-specific rollback evidence do not exist yet. Those are produced by this deployment flow.
|
|
43
45
|
|
|
44
46
|
## 2. Select an environment explicitly
|
|
45
47
|
|
|
@@ -52,7 +54,7 @@ Rules:
|
|
|
52
54
|
- never silently default to `production`;
|
|
53
55
|
- never use a remembered prior selection as implicit production authorization;
|
|
54
56
|
- never fall back from one environment to another because discovery, access, readiness, or deployment failed;
|
|
55
|
-
- if a named environment is not configured, fail explicitly and route to `/deployment-readiness
|
|
57
|
+
- if a named environment is not configured, fail explicitly and route to `/deployment-readiness <environment>`;
|
|
56
58
|
- selecting an environment chooses scope but does not authorize the deployment write.
|
|
57
59
|
|
|
58
60
|
## 3. Resolve and verify the machine/target binding
|
|
@@ -105,7 +107,31 @@ For non-production, use only the broader artifact policy explicitly allowed by t
|
|
|
105
107
|
|
|
106
108
|
When promoting a tested artifact to production, prefer the exact same immutable artifact/digest rather than rebuilding it.
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
If readiness was completed before the final release/artifact existed, re-check the selected artifact and any artifact-specific pre-deploy prerequisites now. Do not force a separate readiness ceremony when the remaining check can be performed read-only and the environment facts have not materially changed.
|
|
111
|
+
|
|
112
|
+
## 6. Build the deterministic deployment plan
|
|
113
|
+
|
|
114
|
+
Use repository-provided tooling to construct or inspect the exact plan when supported.
|
|
115
|
+
|
|
116
|
+
The plan may include, according to the repository contract:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
pre-deploy backup or safety check
|
|
120
|
+
→ release-specific migration
|
|
121
|
+
→ application/container deployment
|
|
122
|
+
→ application route registration/update
|
|
123
|
+
→ health/readiness verification
|
|
124
|
+
→ smoke validation
|
|
125
|
+
→ deployment evidence capture
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Do not add operations the repository/tool does not define.
|
|
129
|
+
|
|
130
|
+
Route registration, migration, and other application/release-specific writes are deployment operations when they are part of the repository's deterministic deployment contract. They are not hidden `/deployment-readiness` side effects.
|
|
131
|
+
|
|
132
|
+
Application rollback execution, database restore/destructive recovery, target rebinding, unrelated host provisioning, and environment tear-down remain separate decisions unless the approved deployment contract explicitly defines a safe bounded automatic rollback for the failed deployment itself.
|
|
133
|
+
|
|
134
|
+
## 7. Preserve the deployment tool's exact authorization contract
|
|
109
135
|
|
|
110
136
|
Core may describe consequence classes using labels such as `[REMOTE WRITE]` and `[PRODUCTION WRITE]`, but those labels do not replace a stricter exact authorization phrase required by the repository-provided deployment tool.
|
|
111
137
|
|
|
@@ -122,7 +148,7 @@ Authorization applies only to the exact environment, verified target, artifact,
|
|
|
122
148
|
|
|
123
149
|
No requirements approval, code review, PR merge, CI pass, environment selection, prior deployment, or readiness result implicitly authorizes a deployment write.
|
|
124
150
|
|
|
125
|
-
##
|
|
151
|
+
## 8. Present the deployment preview and gate
|
|
126
152
|
|
|
127
153
|
Before the modifying command show the resolved non-secret facts:
|
|
128
154
|
|
|
@@ -136,8 +162,10 @@ Target OS: <verified>
|
|
|
136
162
|
Launcher: <repository-provided command>
|
|
137
163
|
Deployment baseline: <exact commit/distribution when present>
|
|
138
164
|
Release/artifact: <verified immutable identity>
|
|
165
|
+
Pre-deploy readiness blockers: NONE
|
|
166
|
+
Planned deployment operations: <repository/tool-defined summary>
|
|
139
167
|
Required authorization: <exact tool phrase or repository gate>
|
|
140
|
-
|
|
168
|
+
Post-deploy validation: route/health/smoke/evidence checks that will run after the write
|
|
141
169
|
```
|
|
142
170
|
|
|
143
171
|
Include an internal target/profile label only when it materially helps disambiguate the exact machine or tool plan. Do not make that identifier the primary human-facing identity.
|
|
@@ -152,7 +180,7 @@ For production require the project's explicit production deployment gate and the
|
|
|
152
180
|
|
|
153
181
|
Do not translate a generic `approve` into a broader tool-specific phrase unless the user clearly authorized the exact reviewed deployment operation represented by that phrase.
|
|
154
182
|
|
|
155
|
-
##
|
|
183
|
+
## 9. Execute only the approved script contract
|
|
156
184
|
|
|
157
185
|
After authorization invoke only the repository-provided launcher with the explicitly selected environment and approved artifact inputs.
|
|
158
186
|
|
|
@@ -160,9 +188,22 @@ Do not perform unrelated host provisioning, target rebinding, firewall changes,
|
|
|
160
188
|
|
|
161
189
|
If the script reports missing prerequisites, identity mismatch, unexpected target OS, lock contention, migration failure, readiness failure, stale plan/evidence, or another blocker, stop according to the repository contract. Never redirect to another environment or host.
|
|
162
190
|
|
|
163
|
-
|
|
191
|
+
If a failure occurs after a partial deployment, use only repository/tool-defined safe failure handling. Do not improvise destructive rollback or database recovery.
|
|
164
192
|
|
|
165
|
-
|
|
193
|
+
## 10. Verify live deployment and record outcome
|
|
194
|
+
|
|
195
|
+
After execution, use repository-provided inventory, route, readiness, health, smoke, and evidence commands when available.
|
|
196
|
+
|
|
197
|
+
For a first deployment, this is where evidence such as the following becomes meaningful:
|
|
198
|
+
|
|
199
|
+
- application route registration and client-resolvable route behavior when verifiable from the approved surface;
|
|
200
|
+
- exact deployed release/artifact identity;
|
|
201
|
+
- container/process running state;
|
|
202
|
+
- application readiness/health result;
|
|
203
|
+
- smoke-test result;
|
|
204
|
+
- release-specific migration outcome;
|
|
205
|
+
- deployment evidence/current-release identity;
|
|
206
|
+
- rollback/recovery compatibility evidence when the repository contract can establish it non-destructively.
|
|
166
207
|
|
|
167
208
|
Report only evidence-backed outcomes:
|
|
168
209
|
|
|
@@ -171,9 +212,26 @@ Report only evidence-backed outcomes:
|
|
|
171
212
|
- deployment baseline/tool identity when relevant;
|
|
172
213
|
- release/artifact identity;
|
|
173
214
|
- deployment result;
|
|
174
|
-
-
|
|
175
|
-
-
|
|
215
|
+
- route result when applicable;
|
|
216
|
+
- readiness/health/smoke result;
|
|
217
|
+
- migration result when applicable;
|
|
218
|
+
- rollback/recovery capability/evidence when applicable.
|
|
176
219
|
|
|
177
220
|
Do not report success merely because a command returned or a container/process started if stronger readiness evidence is required.
|
|
178
221
|
|
|
179
|
-
|
|
222
|
+
A successful deployment may be summarized as:
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
DEPLOYMENT VALIDATED
|
|
226
|
+
|
|
227
|
+
Environment: <name>
|
|
228
|
+
Artifact: <exact immutable identity>
|
|
229
|
+
Route: READY / NOT APPLICABLE
|
|
230
|
+
Application health: READY
|
|
231
|
+
Smoke: PASSED
|
|
232
|
+
Deployment evidence: RECORDED / VERIFIED
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
For a Staging-to-Production promotion flow, the repository may require a human Staging validation/attestation after this technical validation. That validation is evidence for later Production promotion; it does not itself authorize Production deployment.
|
|
236
|
+
|
|
237
|
+
Application rollback execution, database restore/destructive recovery, and environment tear-down remain separate decisions when the repository contract makes them separate.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deployment-readiness
|
|
3
|
-
description: Guided readiness for any named deployment environment. Discovers
|
|
4
|
-
argument-hint: "[
|
|
3
|
+
description: Guided readiness for any named deployment environment. Discovers current state, verifies access and pre-deploy prerequisites, repairs only missing setup, and hands environments that are ready to deploy to /deploy.
|
|
4
|
+
argument-hint: "[environment] | status [environment]"
|
|
5
5
|
user-invocable: true
|
|
6
6
|
disable-model-invocation: true
|
|
7
7
|
---
|
|
@@ -10,17 +10,24 @@ disable-model-invocation: true
|
|
|
10
10
|
|
|
11
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
12
|
|
|
13
|
-
It is not
|
|
13
|
+
It is not the application deployment executor and it is not production-only. Production is an environment role/policy with stronger gates, not a separate readiness mechanism.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The normal human-facing invocation is:
|
|
16
16
|
|
|
17
17
|
```text
|
|
18
|
-
|
|
19
|
-
discovery
|
|
20
|
-
enable
|
|
21
|
-
resume
|
|
18
|
+
/deployment-readiness <environment>
|
|
22
19
|
```
|
|
23
20
|
|
|
21
|
+
The workflow is state-driven and resumable. It discovers whether the environment is unconfigured, partially configured, access-ready, platform-ready, or ready to deploy, then continues from the furthest safe observed state. Do not require the human to choose `discovery`, `enable`, or `resume` modes.
|
|
22
|
+
|
|
23
|
+
For a read-only overview, support:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
/deployment-readiness status [environment]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For compatibility, if an older invocation includes a deployment-enabler ID and/or the legacy `discovery`, `enable`, or `resume` token, normalize it to the same state-driven workflow rather than forcing the human to restart. Do not advertise those legacy forms as the normal interface.
|
|
30
|
+
|
|
24
31
|
## 1. Resolve minimum context
|
|
25
32
|
|
|
26
33
|
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.
|
|
@@ -36,6 +43,8 @@ Do not assume:
|
|
|
36
43
|
- SSH alias or discovery mechanism;
|
|
37
44
|
- certificate model or hosting environment.
|
|
38
45
|
|
|
46
|
+
If the invocation does not name an environment and more than one configured environment exists, ask the human to select one. Never silently default to Production.
|
|
47
|
+
|
|
39
48
|
## 2. Human-facing information model
|
|
40
49
|
|
|
41
50
|
Keep the interaction centered on facts a person normally knows about the selected environment's machine:
|
|
@@ -56,6 +65,40 @@ Do not lead with questions such as `What is the logical target name?`. If an int
|
|
|
56
65
|
|
|
57
66
|
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
67
|
|
|
68
|
+
### Application route/address defaults
|
|
69
|
+
|
|
70
|
+
Keep the machine's hostname/address separate from the application's route hostname. A target such as `server.local` may host many POCs, while each application owns its own route aliases.
|
|
71
|
+
|
|
72
|
+
When the repository or installed deployment tooling defines a deterministic application-route convention from stable inputs such as `appSlug + environment`, derive and present that exact conventional set before asking for a free-form hostname. Treat the derived values as recommended defaults for confirmation, not as permission to register or change a route.
|
|
73
|
+
|
|
74
|
+
For example, if the installed trusted-LAN deployment contract defines environment-scoped aliases such as:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
<app-slug>-<environment>.local
|
|
78
|
+
<app-slug>.<environment>.local
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
present the concrete derived values in plain language:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
STAGING APPLICATION ADDRESS
|
|
85
|
+
|
|
86
|
+
Recommended defaults:
|
|
87
|
+
<derived alias 1>
|
|
88
|
+
<derived alias 2>
|
|
89
|
+
|
|
90
|
+
1. Use these defaults — recommended
|
|
91
|
+
2. Choose different hostnames
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Do not ask `What route hostname(s) should this environment use?` while a repository/tool-owned deterministic default is available and no collision or policy conflict has been observed.
|
|
95
|
+
|
|
96
|
+
If the installed convention requires multiple compatibility aliases, preserve the complete default set. Do not silently drop one alias. If the convention defines an optional short alias with a larger collision surface, do not infer or add it; present it only when the repository/tool contract calls for an explicit opt-in.
|
|
97
|
+
|
|
98
|
+
If the user rejects the defaults, or a read-only collision/policy check shows they cannot be used, ask for the smallest unresolved custom value and validate it through the installed tool's hostname contract.
|
|
99
|
+
|
|
100
|
+
Selecting or confirming application route hostnames is configuration/readiness work only. It never authorizes DNS changes, route registration, Caddy changes, or another remote write; those retain their repository/tool-specific write gate.
|
|
101
|
+
|
|
59
102
|
## 3. Discover first, then ask only for missing facts
|
|
60
103
|
|
|
61
104
|
Invocation begins read-only.
|
|
@@ -141,54 +184,45 @@ Then ask one material fact at a time, such as the SSH/deployment user, only when
|
|
|
141
184
|
|
|
142
185
|
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
186
|
|
|
144
|
-
## 4.
|
|
187
|
+
## 4. State-driven progression
|
|
145
188
|
|
|
146
|
-
|
|
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:
|
|
189
|
+
Normal readiness cadence is:
|
|
153
190
|
|
|
154
191
|
```text
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
192
|
+
select environment
|
|
193
|
+
→ rediscover current local state
|
|
194
|
+
→ show/confirm known simple facts
|
|
195
|
+
→ verify/reuse access
|
|
196
|
+
→ repair only missing setup when authorized
|
|
197
|
+
→ verify target OS/platform/security prerequisites
|
|
198
|
+
→ verify artifact/registry/data/migration/rollback capability prerequisites
|
|
199
|
+
→ ENVIRONMENT READY TO DEPLOY
|
|
200
|
+
→ /deploy <environment>
|
|
158
201
|
```
|
|
159
202
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
### discovery
|
|
203
|
+
Each invocation resumes from observed evidence. Do not make the human rerun the command with a different mode merely because discovery completed or a prerequisite was repaired.
|
|
163
204
|
|
|
164
|
-
|
|
205
|
+
Readiness may perform bounded environment-enablement writes when they are necessary and separately authorized, such as local profile/key/trust setup, target-side access setup, runtime/platform prerequisite setup, data/backup directory preparation, firewall preparation, or registry credential setup. These are readiness/setup operations, not application deployment.
|
|
165
206
|
|
|
166
|
-
|
|
207
|
+
Application deployment remains owned by `/deploy`.
|
|
167
208
|
|
|
168
|
-
-
|
|
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.
|
|
209
|
+
### Read-only status
|
|
176
210
|
|
|
177
|
-
|
|
211
|
+
`/deployment-readiness status [environment]` is a read-only overview.
|
|
178
212
|
|
|
179
|
-
|
|
213
|
+
With an environment, summarize that environment's local configuration/readiness state. Without an environment, summarize all configured named deployment environments without remotely probing every machine:
|
|
180
214
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
215
|
+
```text
|
|
216
|
+
Environment Role Local setup Last readiness
|
|
217
|
+
Staging non-production CONFIGURED READY TO DEPLOY / STALE / UNKNOWN
|
|
218
|
+
Production production PARTIAL NOT READY
|
|
219
|
+
```
|
|
186
220
|
|
|
187
|
-
|
|
221
|
+
Use only evidence that actually exists. `status` does not authorize remote checks or writes.
|
|
188
222
|
|
|
189
223
|
## 5. Select the environment before environment-specific readiness
|
|
190
224
|
|
|
191
|
-
When more than one configured deployment environment exists, select the environment
|
|
225
|
+
When more than one configured deployment environment exists, select the environment before environment-specific questions or remote checks.
|
|
192
226
|
|
|
193
227
|
Keep these concepts separate internally even when the human-facing interaction stays simple:
|
|
194
228
|
|
|
@@ -218,7 +252,7 @@ discover existing state
|
|
|
218
252
|
→ ask one missing material fact
|
|
219
253
|
→ record permitted non-secret fact
|
|
220
254
|
→ explain impact/blocker
|
|
221
|
-
→ continue
|
|
255
|
+
→ continue from the resulting state
|
|
222
256
|
```
|
|
223
257
|
|
|
224
258
|
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.
|
|
@@ -272,27 +306,39 @@ Possible missing state includes profile/binding, key, SSH-agent membership, inde
|
|
|
272
306
|
|
|
273
307
|
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
308
|
|
|
275
|
-
## 9.
|
|
309
|
+
## 9. Pre-deploy readiness versus post-deploy validation
|
|
310
|
+
|
|
311
|
+
Readiness answers: **can `/deploy` safely perform the selected environment's deployment now?**
|
|
276
312
|
|
|
277
|
-
|
|
313
|
+
Before declaring the selected environment ready to deploy, verify only evidence that can exist before the deployment of the selected artifact, such as:
|
|
314
|
+
|
|
315
|
+
- selected environment and confirmed machine/target binding;
|
|
316
|
+
- strict connectivity/host-identity verification;
|
|
317
|
+
- supported developer-workstation launcher;
|
|
318
|
+
- expected target OS matches actual target OS;
|
|
319
|
+
- shared runtime/platform prerequisites;
|
|
320
|
+
- approved release/artifact policy;
|
|
321
|
+
- immutable artifact/image digest when applicable;
|
|
322
|
+
- artifact/registry accessibility or credential readiness;
|
|
323
|
+
- route names validated and collision-free when the installed routing contract supports read-only inventory/plan checks;
|
|
324
|
+
- independent environment data/backup paths or the approved ability to create/use them;
|
|
325
|
+
- migration capability and prerequisites;
|
|
326
|
+
- deployment lock capability;
|
|
327
|
+
- rollback/recovery capability and required boundaries;
|
|
328
|
+
- production-specific backup/recovery prerequisites when applicable;
|
|
329
|
+
- unresolved security blockers = none.
|
|
278
330
|
|
|
279
|
-
-
|
|
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.
|
|
331
|
+
Do **not** require evidence that can only be produced by deploying the exact selected artifact. On a first deployment, live application route resolution, application health/readiness, smoke results, deployed-release identity, and execution-backed rollback evidence are post-deploy validation, not pre-deploy blockers.
|
|
288
332
|
|
|
289
|
-
|
|
333
|
+
A previously deployed environment may have historical live evidence, but stale evidence for an older artifact does not prove the new artifact's post-deploy behavior.
|
|
334
|
+
|
|
335
|
+
A non-production environment may use a less restrictive artifact policy only when approved requirements say so. Do not infer relaxed Staging behavior.
|
|
290
336
|
|
|
291
337
|
## 10. Bounded setup/provisioning writes
|
|
292
338
|
|
|
293
339
|
A missing prerequisite is not authorization to change it.
|
|
294
340
|
|
|
295
|
-
Examples of bounded actions include:
|
|
341
|
+
Examples of bounded readiness actions include:
|
|
296
342
|
|
|
297
343
|
```text
|
|
298
344
|
Create/update local environment binding [LOCAL CONFIG WRITE]
|
|
@@ -309,45 +355,30 @@ Set source-hosting environment variable/secret [SOURCE-HOSTING WRITE]
|
|
|
309
355
|
|
|
310
356
|
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
357
|
|
|
312
|
-
|
|
358
|
+
Do not register the application route, deploy the application container/process, migrate the selected release, or run release-specific live smoke validation as a hidden readiness side effect. Those belong to `/deploy` when the repository deployment contract includes them.
|
|
313
359
|
|
|
314
|
-
|
|
360
|
+
## 11. Readiness handoff
|
|
315
361
|
|
|
316
|
-
|
|
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:
|
|
362
|
+
For any selected environment that has satisfied its pre-deploy requirements:
|
|
338
363
|
|
|
339
364
|
```text
|
|
340
|
-
ENVIRONMENT READY
|
|
365
|
+
ENVIRONMENT READY TO DEPLOY
|
|
341
366
|
|
|
342
367
|
Environment: <name>
|
|
343
368
|
Role: <role>
|
|
344
369
|
Hostname/address: <confirmed non-secret value when appropriate>
|
|
345
370
|
Target OS/architecture: <verified>
|
|
346
371
|
Access/host identity: VERIFIED
|
|
347
|
-
|
|
372
|
+
Platform prerequisites: READY
|
|
373
|
+
Route identity/plan: VALID / AVAILABLE when applicable
|
|
374
|
+
Release/artifact: <verified immutable identity when required>
|
|
375
|
+
Registry/artifact access: READY when applicable
|
|
376
|
+
Persistence/migration capability: READY
|
|
377
|
+
Rollback/recovery capability: READY
|
|
348
378
|
Security blockers: NONE
|
|
349
|
-
|
|
350
|
-
|
|
379
|
+
|
|
380
|
+
POST-DEPLOY VALIDATION PENDING
|
|
381
|
+
Live route/health/smoke/release-specific rollback evidence is established by /deploy.
|
|
351
382
|
|
|
352
383
|
NEXT
|
|
353
384
|
/deploy <environment>
|
|
@@ -355,15 +386,15 @@ NEXT
|
|
|
355
386
|
|
|
356
387
|
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
388
|
|
|
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.
|
|
389
|
+
This is pre-deploy readiness evidence, not deployment authorization. `/deploy` owns the actual deployment write gate for the exact environment, verified target, artifact, and current evidence.
|
|
359
390
|
|
|
360
|
-
##
|
|
391
|
+
## 12. Post-readiness
|
|
361
392
|
|
|
362
|
-
Once an environment is ready:
|
|
393
|
+
Once an environment is ready to deploy:
|
|
363
394
|
|
|
364
|
-
- record non-secret readiness evidence in the repository-approved place;
|
|
395
|
+
- record non-secret readiness evidence in the repository-approved place when useful;
|
|
365
396
|
- keep readiness independent from other environments;
|
|
366
|
-
- use `/deploy
|
|
367
|
-
- return to `/deployment-readiness
|
|
397
|
+
- use `/deploy <environment>` for the application deployment and release-specific live validation;
|
|
398
|
+
- return to `/deployment-readiness <environment>` when machine binding, address, expected OS/runtime, security posture, credentials, registry access, data prerequisites, or another material pre-deploy prerequisite changes.
|
|
368
399
|
|
|
369
|
-
Application rollback, database restore/destructive recovery, and environment tear-down remain separately governed when data safety warrants it.
|
|
400
|
+
Application rollback execution, database restore/destructive recovery, and environment tear-down remain separately governed when data safety warrants it.
|
|
@@ -60,7 +60,8 @@ MERGED_DEFAULT_BRANCH_CI_PENDING
|
|
|
60
60
|
MERGED_DEFAULT_BRANCH_CI_FAILED
|
|
61
61
|
DELIVERY_COMPLETE
|
|
62
62
|
ENVIRONMENT_READINESS_PENDING
|
|
63
|
-
|
|
63
|
+
ENVIRONMENT_READY_TO_DEPLOY
|
|
64
|
+
DEPLOYMENT_VALIDATION_PENDING
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
Use only states supported by observed evidence.
|
|
@@ -143,26 +144,28 @@ After merge:
|
|
|
143
144
|
|
|
144
145
|
## 6. Deployment handoff
|
|
145
146
|
|
|
146
|
-
For
|
|
147
|
+
For release/deployment engineering after engineering delivery is complete, recommend the selected environment's state-driven readiness workflow:
|
|
147
148
|
|
|
148
149
|
```text
|
|
149
|
-
/deployment-readiness <
|
|
150
|
+
/deployment-readiness <environment>
|
|
150
151
|
```
|
|
151
152
|
|
|
152
|
-
|
|
153
|
+
Use the same command whether the environment still needs initial discovery, prerequisite setup, repair, or final pre-deploy verification. Readiness re-discovers current state and resumes automatically; do not tell the human to choose `discovery`, `enable`, or `resume` modes.
|
|
153
154
|
|
|
154
|
-
When evidence shows a configured named environment is ready
|
|
155
|
+
When evidence shows a configured named environment is ready to deploy, recommend:
|
|
155
156
|
|
|
156
157
|
```text
|
|
157
|
-
/deploy
|
|
158
|
+
/deploy <environment>
|
|
158
159
|
```
|
|
159
160
|
|
|
160
|
-
|
|
161
|
+
`ENVIRONMENT_READY_TO_DEPLOY` means pre-deploy prerequisites are satisfied. It does not require live application health, smoke, route resolution, or release-specific rollback evidence that can only be established by deploying the selected artifact.
|
|
162
|
+
|
|
163
|
+
After `/deploy`, use repository/tool evidence to distinguish a successfully validated deployment from `DEPLOYMENT_VALIDATION_PENDING` or a deployment failure.
|
|
161
164
|
|
|
162
165
|
When the user asks for readiness across configured environments, recommend the read-only overview:
|
|
163
166
|
|
|
164
167
|
```text
|
|
165
|
-
/deployment-readiness
|
|
168
|
+
/deployment-readiness status
|
|
166
169
|
```
|
|
167
170
|
|
|
168
171
|
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`.
|
|
@@ -159,20 +159,22 @@ For LIGHT work, branch setup is part of the human-selected implementation action
|
|
|
159
159
|
|
|
160
160
|
When a work item owns release/deployment engineering or environment enablement, classify it ELEVATED when the change materially affects deployment/recovery/security behavior.
|
|
161
161
|
|
|
162
|
-
Environment
|
|
162
|
+
Environment readiness may begin early with the normal state-driven interface:
|
|
163
163
|
|
|
164
164
|
```text
|
|
165
|
-
/deployment-readiness <
|
|
165
|
+
/deployment-readiness <environment>
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
It begins with existing local/repository configuration, shows simple known machine facts for confirmation, and continues only as far as current engineering/evidence safely allows. It does not authorize application deployment.
|
|
169
169
|
|
|
170
|
-
After implementation review/local acceptance, use `/deliver`. After `/deliver` reports the merge, default-branch CI, and applicable repository-policy evidence satisfied,
|
|
170
|
+
After implementation review/local acceptance, use `/deliver`. After `/deliver` reports the merge, default-branch CI, and applicable repository-policy evidence satisfied, return to the same state-driven readiness command for the selected environment:
|
|
171
171
|
|
|
172
172
|
```text
|
|
173
|
-
/deployment-readiness <
|
|
173
|
+
/deployment-readiness <environment>
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
+
The workflow re-discovers state and continues from the furthest safe point; do not require the human to switch from a discovery mode to an enable mode.
|
|
177
|
+
|
|
176
178
|
Production remains a role with stronger policy and deployment authorization; it does not use a separate readiness workflow.
|
|
177
179
|
|
|
178
180
|
## 8. Guided ending
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -11,7 +11,8 @@ function parseArgs(argv) {
|
|
|
11
11
|
const positional = [];
|
|
12
12
|
for (let i = 0; i < argv.length; i += 1) {
|
|
13
13
|
const arg = argv[i];
|
|
14
|
-
if (arg === '--
|
|
14
|
+
if (arg === '--help' || arg === '-h') options.help = true;
|
|
15
|
+
else if (arg === '--apply' || arg === '--yes') options.apply = true;
|
|
15
16
|
else if (arg === '--root') options.root = argv[++i];
|
|
16
17
|
else if (arg === '--profile') options.profile = argv[++i];
|
|
17
18
|
else if (arg === '--consumer') options.consumer = argv[++i];
|
|
@@ -65,13 +66,31 @@ async function shouldApply(options) {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
function usage() {
|
|
69
|
-
|
|
69
|
+
function usage(command) {
|
|
70
|
+
const commandUsage = {
|
|
71
|
+
install: 'lean install [--root PATH] [--profile NAME] [--apply|--yes] [--consumer NAME] [--consumer-baseline LABEL] [--accept-retired component:path]',
|
|
72
|
+
update: 'lean update [--root PATH] [--profile NAME] [--apply|--yes] [--accept-retired component:path]',
|
|
73
|
+
status: 'lean status [--root PATH] [--profile NAME]',
|
|
74
|
+
check: 'lean check [--root PATH] [--profile NAME]',
|
|
75
|
+
version: 'lean version'
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
if (commandUsage[command]) {
|
|
79
|
+
console.log(`@mriekki/lean\n\nUsage:\n ${commandUsage[command]}\n`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
console.log(`@mriekki/lean\n\nCommands:\n install Preview/install bundled Lean assets\n update Preview/update to this package's bundled Lean assets\n status Show installed umbrella/component provenance\n check Verify managed files and baselines exactly match this package\n version Show package version\n\nCommon options:\n --root PATH\n --profile greenfield-poc\n --apply | --yes\n --consumer NAME\n --consumer-baseline LABEL\n --accept-retired core:path\n -h, --help\n`);
|
|
70
84
|
}
|
|
71
85
|
|
|
72
86
|
export async function run(argv = process.argv.slice(2), packageData = loadPackageData()) {
|
|
73
87
|
const { command, options } = parseArgs(argv);
|
|
74
|
-
if (command === 'help'
|
|
88
|
+
if (command === 'help') { usage(); return 0; }
|
|
89
|
+
if (options.help) {
|
|
90
|
+
if (!['install', 'update', 'status', 'check', 'version'].includes(command)) throw new Error(`Unknown command: ${command}`);
|
|
91
|
+
usage(command);
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
75
94
|
if (command === 'version') { console.log(`${packageData.pkg.name} ${packageData.pkg.version}`); return 0; }
|
|
76
95
|
const root = path.resolve(options.root ?? process.cwd());
|
|
77
96
|
if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) throw new Error(`Repository root not found: ${root}`);
|