@mriekki/lean 0.1.1 → 0.2.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.
- package/README.md +9 -5
- package/assets/components.json +3 -3
- package/assets/core/distribution.json +1 -0
- package/assets/generated/ASSEMBLY.json +11 -6
- package/assets/generated/core/core/skills/core-sync/SKILL.md +78 -120
- package/assets/generated/core/core/skills/deploy/SKILL.md +74 -91
- package/assets/generated/core/core/skills/lean-update/SKILL.md +224 -0
- package/assets/generated/core/core/skills/upstream-fix/SKILL.md +91 -76
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
Canonical engineering remains in the private platform repositories. Before publication, a deterministic assembly step verifies exact pinned source commits and distribution descriptors, then copies only those approved consumer mappings into the npm payload. Each published npm release is therefore self-contained; consumers do not need access to the canonical repositories to install or update Lean assets.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Current `greenfield-poc` profile
|
|
8
8
|
|
|
9
|
-
The
|
|
9
|
+
The current profile bundles:
|
|
10
10
|
|
|
11
|
-
- Lean Agentic Core `1.
|
|
11
|
+
- Lean Agentic Core `1.11.1` from commit `e3a8a994d1e95923d629af7640d3b3a0a4f098d4`, distribution `greenfield-workspace`;
|
|
12
12
|
- Lean POC Deployment Kit commit `4c23140576b39608a3ef285cad4abe53dccb9c47`, distribution `greenfield-poc`.
|
|
13
13
|
|
|
14
|
+
Core `1.11.1` tightens `/lean-update` for Bootstrap-generated package-managed consumers: it keeps `POC_BOOTSTRAP.json`, umbrella/component baselines, exact registry integrity, and generated package-verification surfaces coherent while retaining `/core-sync` as the compatibility/router path for component-only Core consumers.
|
|
15
|
+
|
|
14
16
|
## Developer experience
|
|
15
17
|
|
|
16
18
|
Preview/install:
|
|
@@ -27,6 +29,8 @@ Update using the newest published package:
|
|
|
27
29
|
npx @mriekki/lean@latest update
|
|
28
30
|
```
|
|
29
31
|
|
|
32
|
+
For reviewed maintenance operations, prefer resolving and using one exact package version for preview, apply, and final check rather than allowing a moving `@latest` reference to change between those steps.
|
|
33
|
+
|
|
30
34
|
Inspect or verify:
|
|
31
35
|
|
|
32
36
|
```powershell
|
|
@@ -47,7 +51,7 @@ The umbrella package writes `LEAN_BASELINE.json` while preserving component-nati
|
|
|
47
51
|
|
|
48
52
|
## Current scope
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
The package currently starts with the `greenfield-poc` consumer profile. Existing-repository Adoption Kit packaging can be added as another profile without changing the one-package developer experience.
|
|
51
55
|
|
|
52
56
|
## Package assembly and release
|
|
53
57
|
|
|
@@ -62,6 +66,6 @@ node .\scripts\prepare-release.mjs `
|
|
|
62
66
|
|
|
63
67
|
Release preparation verifies exact `origin/main`, runs the complete test suite, refuses dirty canonical source checkouts, assembles and verifies the pinned assets, compares two independent `npm pack` SHA-256 values, and smoke-tests the packed CLI from a clean temporary install. The resulting tarball and `RELEASE_MANIFEST.json` are written under `dist/release/`.
|
|
64
68
|
|
|
65
|
-
The first npm version
|
|
69
|
+
The first npm version was staged manually and required explicit 2FA approval before becoming public. Current releases use `.github/workflows/npm-stage.yml` with npm Trusted Publishing (OIDC) to stage future versions without a long-lived npm publish token; human 2FA approval remains the final publication gate.
|
|
66
70
|
|
|
67
71
|
See `docs/RELEASE_PROCESS.md` for the full release contract.
|
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.2.1",
|
|
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": "e3a8a994d1e95923d629af7640d3b3a0a4f098d4",
|
|
18
|
+
"version": "1.11.1",
|
|
19
19
|
"distribution": "greenfield-workspace",
|
|
20
20
|
"descriptor": "assets/core/distribution.json",
|
|
21
21
|
"sourceRoot": "assets/generated/core",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
{"source":"core/skills/deliver/SKILL.md","destination":".github/skills/deliver/SKILL.md"},
|
|
17
17
|
{"source":"core/skills/cleanup-branches/SKILL.md","destination":".github/skills/cleanup-branches/SKILL.md"},
|
|
18
18
|
{"source":"core/skills/pull-latest/SKILL.md","destination":".github/skills/pull-latest/SKILL.md"},
|
|
19
|
+
{"source":"core/skills/lean-update/SKILL.md","destination":".github/skills/lean-update/SKILL.md"},
|
|
19
20
|
{"source":"core/skills/core-sync/SKILL.md","destination":".github/skills/core-sync/SKILL.md"},
|
|
20
21
|
{"source":"core/skills/upstream-fix/SKILL.md","destination":".github/skills/upstream-fix/SKILL.md"},
|
|
21
22
|
{"source":"core/skills/wait-what/SKILL.md","destination":".github/skills/wait-what/SKILL.md"},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": "@mriekki/lean",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"components": {
|
|
6
6
|
"core": {
|
|
7
7
|
"repository": "mriekki/lean-agentic-core",
|
|
8
|
-
"commit": "
|
|
9
|
-
"version": "1.
|
|
8
|
+
"commit": "e3a8a994d1e95923d629af7640d3b3a0a4f098d4",
|
|
9
|
+
"version": "1.11.1",
|
|
10
10
|
"distribution": "greenfield-workspace",
|
|
11
11
|
"files": [
|
|
12
12
|
{
|
|
@@ -79,15 +79,20 @@
|
|
|
79
79
|
"destination": ".github/skills/pull-latest/SKILL.md",
|
|
80
80
|
"sha256": "d49321859fe37afeb5d9e0b39ceac3d8a6709f6e02efd19b6cac37842fe3aa37"
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
"source": "core/skills/lean-update/SKILL.md",
|
|
84
|
+
"destination": ".github/skills/lean-update/SKILL.md",
|
|
85
|
+
"sha256": "8b4bce53b109a5959e862924b0a4afd931233a5094a1aef43c2f3672199108bb"
|
|
86
|
+
},
|
|
82
87
|
{
|
|
83
88
|
"source": "core/skills/core-sync/SKILL.md",
|
|
84
89
|
"destination": ".github/skills/core-sync/SKILL.md",
|
|
85
|
-
"sha256": "
|
|
90
|
+
"sha256": "0c1bfbc7678f5ae3239dd2900a12e75584035a5338474181dbd81cb1a0813531"
|
|
86
91
|
},
|
|
87
92
|
{
|
|
88
93
|
"source": "core/skills/upstream-fix/SKILL.md",
|
|
89
94
|
"destination": ".github/skills/upstream-fix/SKILL.md",
|
|
90
|
-
"sha256": "
|
|
95
|
+
"sha256": "d6b77eee298bf387e20156c6ff7b3904e3f925873699f7e1071515d9d69c2f03"
|
|
91
96
|
},
|
|
92
97
|
{
|
|
93
98
|
"source": "core/skills/wait-what/SKILL.md",
|
|
@@ -102,7 +107,7 @@
|
|
|
102
107
|
{
|
|
103
108
|
"source": "core/skills/deploy/SKILL.md",
|
|
104
109
|
"destination": ".github/skills/deploy/SKILL.md",
|
|
105
|
-
"sha256": "
|
|
110
|
+
"sha256": "e9dcf7232505d684c1d8f39b0937c5026223e745df023c84295457e22da1b52a"
|
|
106
111
|
},
|
|
107
112
|
{
|
|
108
113
|
"source": "core/skills/tear-down/SKILL.md",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: core-sync
|
|
3
|
-
description:
|
|
3
|
+
description: Compatibility Core-to-consumer synchronization for component-only consumers; package-managed consumers are routed to /lean-update so umbrella and component baselines remain coherent.
|
|
4
4
|
argument-hint: "[optional local Core path]"
|
|
5
5
|
user-invocable: true
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -8,55 +8,74 @@ disable-model-invocation: true
|
|
|
8
8
|
|
|
9
9
|
# Core Sync
|
|
10
10
|
|
|
11
|
-
`/core-sync`
|
|
11
|
+
`/core-sync` is the compatibility synchronization path for consumers that are managed directly by `CORE_BASELINE.json` **without** an umbrella `LEAN_BASELINE.json`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
For package-managed consumers, `/lean-update` is authoritative.
|
|
14
14
|
|
|
15
|
-
Invocation starts read-only.
|
|
15
|
+
Invocation starts read-only. Direct component synchronization must never make a package-managed consumer disagree with its recorded Lean package provenance.
|
|
16
16
|
|
|
17
|
-
## 1.
|
|
17
|
+
## 1. Classify the consumer before doing anything else
|
|
18
18
|
|
|
19
|
-
From the consumer repository,
|
|
19
|
+
From the consumer repository read, when present:
|
|
20
20
|
|
|
21
|
-
- `
|
|
22
|
-
-
|
|
23
|
-
- `.github/lean-
|
|
21
|
+
- `LEAN_BASELINE.json`;
|
|
22
|
+
- `CORE_BASELINE.json`;
|
|
23
|
+
- `.github/lean-workspace.json`;
|
|
24
|
+
- `.github/lean-core-sync.json`;
|
|
24
25
|
- current Git status, branch, remotes, and default branch when observable.
|
|
25
26
|
|
|
27
|
+
### Package-managed consumer
|
|
28
|
+
|
|
29
|
+
If `LEAN_BASELINE.json` exists:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
PACKAGE-MANAGED LEAN CONSUMER
|
|
33
|
+
Direct Core sync: NOT PERMITTED
|
|
34
|
+
Next: /lean-update
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Stop before refreshing a Core checkout, running `tools/package/sync.py`, creating a sync branch, or sending a remote `[sync-core]` request.
|
|
38
|
+
|
|
39
|
+
The umbrella package updates Core and Deployment components together and refreshes `LEAN_BASELINE.json`, `CORE_BASELINE.json`, and `DEPLOYMENT_BASELINE.json` coherently. A Core-only sync would bypass that contract.
|
|
40
|
+
|
|
41
|
+
### Component-only Core consumer
|
|
42
|
+
|
|
43
|
+
If `LEAN_BASELINE.json` is absent and a valid `CORE_BASELINE.json` exists, continue with the compatibility path below.
|
|
44
|
+
|
|
45
|
+
If neither baseline exists, report `CORE SYNC BLOCKED`; do not invent provenance or initialize a consumer implicitly.
|
|
46
|
+
|
|
47
|
+
## 2. Establish the component-only Core baseline
|
|
48
|
+
|
|
26
49
|
Run the repository-local integrity check before planning an update:
|
|
27
50
|
|
|
28
51
|
```text
|
|
29
52
|
python tools/lean-core/check-core-baseline.py --root .
|
|
30
53
|
```
|
|
31
54
|
|
|
32
|
-
Stop if the
|
|
55
|
+
Stop if the managed overlay has unexplained local drift, missing managed files, or invalid baseline metadata.
|
|
33
56
|
|
|
34
57
|
Resolve from `CORE_BASELINE.json`:
|
|
35
58
|
|
|
36
|
-
- canonical Core repository
|
|
37
|
-
- currently accepted Core commit/version
|
|
38
|
-
- distribution name
|
|
59
|
+
- canonical Core repository;
|
|
60
|
+
- currently accepted Core commit/version;
|
|
61
|
+
- distribution name;
|
|
39
62
|
- managed-path ownership/hashes.
|
|
40
63
|
|
|
41
|
-
##
|
|
64
|
+
## 3. Resolve the Core source safely
|
|
42
65
|
|
|
43
66
|
Check local candidates in this order:
|
|
44
67
|
|
|
45
|
-
1. an explicit Core path supplied by the human
|
|
46
|
-
2. an already-open workspace folder that unambiguously resolves to the recorded Core repository
|
|
68
|
+
1. an explicit Core path supplied by the human;
|
|
69
|
+
2. an already-open workspace folder that unambiguously resolves to the recorded Core repository;
|
|
47
70
|
3. the sibling checkout derived from the Core repository name, normally `../lean-agentic-core`.
|
|
48
71
|
|
|
49
|
-
Do not broadly scan the
|
|
50
|
-
|
|
51
|
-
A local candidate is usable only when:
|
|
72
|
+
Do not broadly scan the filesystem. A local Core checkout is an optimization, not a prerequisite.
|
|
52
73
|
|
|
53
|
-
|
|
54
|
-
- its configured remote resolves to the Core repository recorded in `CORE_BASELINE.json`,
|
|
55
|
-
- its repository state can be inspected safely.
|
|
74
|
+
A local candidate is usable only when it is the recorded Git repository and its state can be inspected safely.
|
|
56
75
|
|
|
57
|
-
If no usable local Core checkout exists, use the configured remote provider from `.github/lean-core-sync.json` when available. Do not ask the developer to clone Core
|
|
76
|
+
If no usable local Core checkout exists, use the configured remote provider from `.github/lean-core-sync.json` when available. Do not ask the developer to clone Core merely to satisfy `/core-sync`.
|
|
58
77
|
|
|
59
|
-
##
|
|
78
|
+
## 4. Classify a local Core checkout
|
|
60
79
|
|
|
61
80
|
Before modifying a local Core checkout inspect:
|
|
62
81
|
|
|
@@ -67,49 +86,35 @@ git -C <core-path> remote -v
|
|
|
67
86
|
git -C <core-path> branch -vv
|
|
68
87
|
```
|
|
69
88
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- the worktree is clean,
|
|
73
|
-
- no merge/rebase/cherry-pick is in progress,
|
|
74
|
-
- the checkout is on its normal accepted/default branch,
|
|
75
|
-
- an unambiguous upstream exists,
|
|
76
|
-
- updating can be performed fast-forward-only.
|
|
89
|
+
It may be refreshed automatically only when clean, on its normal accepted/default branch, backed by an unambiguous upstream, and fast-forward-safe.
|
|
77
90
|
|
|
78
91
|
Never auto-stash, merge, rebase, reset, clean, force-update, or discard Core work.
|
|
79
92
|
|
|
80
|
-
If the
|
|
81
|
-
|
|
82
|
-
## 4. Present one bounded sync choice
|
|
93
|
+
If the checkout is dirty, ahead, diverged, intentionally pinned, or ambiguous, preserve it unchanged and prefer the configured remote provider when available.
|
|
83
94
|
|
|
84
|
-
|
|
95
|
+
## 5. Present one bounded compatibility-sync choice
|
|
85
96
|
|
|
86
|
-
|
|
97
|
+
For a safe local source:
|
|
87
98
|
|
|
88
99
|
```text
|
|
89
|
-
CORE SYNC READY
|
|
100
|
+
CORE COMPATIBILITY SYNC READY
|
|
90
101
|
|
|
91
102
|
Consumer baseline: <commit/version>
|
|
92
103
|
Source: LOCAL <core-path>
|
|
93
|
-
Local Core state: CURRENT | FAST-FORWARDABLE
|
|
94
104
|
Distribution: <distribution>
|
|
95
105
|
|
|
96
|
-
1. Sync
|
|
106
|
+
1. Sync the component-only Core baseline [GIT + FILE WRITE] — recommended
|
|
97
107
|
2. Keep inspecting only [READ ONLY]
|
|
98
108
|
3. Stop [NO ACTION]
|
|
99
109
|
```
|
|
100
110
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
### No safe local Core available, remote provider configured
|
|
104
|
-
|
|
105
|
-
Present:
|
|
111
|
+
For a configured remote source:
|
|
106
112
|
|
|
107
113
|
```text
|
|
108
|
-
CORE SYNC READY
|
|
114
|
+
CORE COMPATIBILITY SYNC READY
|
|
109
115
|
|
|
110
116
|
Consumer baseline: <commit/version>
|
|
111
117
|
Source: REMOTE PROVIDER
|
|
112
|
-
Local Core: NOT REQUIRED
|
|
113
118
|
Provider: <provider repository>
|
|
114
119
|
|
|
115
120
|
1. Request remote Core sync [REMOTE WRITE] — recommended
|
|
@@ -117,70 +122,35 @@ Provider: <provider repository>
|
|
|
117
122
|
3. Stop [NO ACTION]
|
|
118
123
|
```
|
|
119
124
|
|
|
120
|
-
|
|
125
|
+
The selected choice does not authorize merge, release publication, or deployment.
|
|
121
126
|
|
|
122
|
-
|
|
127
|
+
## 6. Local compatibility path
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
After local option 1 is selected:
|
|
125
130
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
After option 1 is selected:
|
|
129
|
-
|
|
130
|
-
1. Refresh the local Core remote state.
|
|
131
|
+
1. Refresh Core remote state.
|
|
131
132
|
2. Reclassify the accepted/default Core branch.
|
|
132
|
-
3.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
4. If Core is ahead, diverged, dirty, or otherwise unsafe after refresh, stop without changing the consumer and prefer the configured remote provider when available.
|
|
139
|
-
5. Run a Core sync preview from the refreshed checkout using the distribution recorded by the consumer baseline.
|
|
140
|
-
6. Stop without apply on any unsafe sync state, including `LOCAL_DRIFT`, `CONFLICT`, `LOCAL_MISSING`, `UNTRACKED_CONFLICT`, or an unaccepted `RETIRED_PATH`.
|
|
141
|
-
7. If the consumer is on its default branch, create/switch to a repository-appropriate short-lived chore branch such as `chore/sync-core-<version-or-short-sha>`. This branch setup is routine inside the selected bounded sync action.
|
|
142
|
-
8. Apply only the safe Core additions/updates and refresh `CORE_BASELINE.json` using Core's canonical `tools/package/sync.py` contract.
|
|
133
|
+
3. Fast-forward it only when safe.
|
|
134
|
+
4. Run canonical Core sync preview using the distribution recorded by the baseline.
|
|
135
|
+
5. Stop on `LOCAL_DRIFT`, `CONFLICT`, `LOCAL_MISSING`, `UNTRACKED_CONFLICT`, or an unaccepted `RETIRED_PATH`.
|
|
136
|
+
6. If the consumer is on its default branch, create/switch to a short-lived branch such as `chore/sync-core-<version-or-short-sha>`.
|
|
137
|
+
7. Apply only safe Core additions/updates and refresh `CORE_BASELINE.json` using canonical `tools/package/sync.py`.
|
|
143
138
|
|
|
144
|
-
Do not manually copy
|
|
139
|
+
Do not manually copy managed files as a substitute for the canonical tool.
|
|
145
140
|
|
|
146
|
-
##
|
|
141
|
+
## 7. Remote compatibility path
|
|
147
142
|
|
|
148
|
-
Remote orchestration is consumer configuration
|
|
149
|
-
|
|
150
|
-
```json
|
|
151
|
-
{
|
|
152
|
-
"schemaVersion": 1,
|
|
153
|
-
"remote": {
|
|
154
|
-
"type": "github-issue-control-plane",
|
|
155
|
-
"repository": "owner/control-plane-repo",
|
|
156
|
-
"titleTemplate": "[sync-core] {owner}/{repository}",
|
|
157
|
-
"requireEmptyBody": true
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
```
|
|
143
|
+
Remote orchestration is consumer configuration. Read `.github/lean-core-sync.json` and require its configured provider contract, for example `github-issue-control-plane` with an owner/repository title template and an empty body.
|
|
161
144
|
|
|
162
|
-
|
|
145
|
+
Create exactly the configured request. Do not put product requirements, baseline JSON, source code, secrets, or other private consumer details into a public request.
|
|
163
146
|
|
|
164
|
-
|
|
147
|
+
The provider is expected to validate target authorization, obtain its own short-lived credentials, run canonical Core sync, refuse unsafe drift/conflicts, publish a short-lived consumer branch/PR, and observe consumer CI.
|
|
165
148
|
|
|
166
|
-
|
|
149
|
+
If the provider cannot satisfy that contract, report `REMOTE SYNC UNAVAILABLE`; do not silently clone Core or invent another synchronization mechanism.
|
|
167
150
|
|
|
168
|
-
|
|
169
|
-
- obtain its own short-lived source/target credentials,
|
|
170
|
-
- resolve the accepted Core source,
|
|
171
|
-
- run the canonical Core sync contract against the target consumer,
|
|
172
|
-
- refuse unsafe consumer drift/conflicts,
|
|
173
|
-
- update exact Core provenance,
|
|
174
|
-
- publish the result on a short-lived consumer branch and PR,
|
|
175
|
-
- run/observe consumer CI.
|
|
151
|
+
## 8. Verification
|
|
176
152
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
## 7. Verification
|
|
180
|
-
|
|
181
|
-
### Local path
|
|
182
|
-
|
|
183
|
-
After apply, run:
|
|
153
|
+
For a local apply run:
|
|
184
154
|
|
|
185
155
|
```text
|
|
186
156
|
python tools/lean-core/check-core-baseline.py --root .
|
|
@@ -189,32 +159,20 @@ git diff --stat
|
|
|
189
159
|
git diff -- CORE_BASELINE.json
|
|
190
160
|
```
|
|
191
161
|
|
|
192
|
-
Confirm
|
|
193
|
-
|
|
194
|
-
- managed paths match the refreshed hashes,
|
|
195
|
-
- consumer-owned paths were not overwritten,
|
|
196
|
-
- the baseline records the exact Core commit actually applied,
|
|
197
|
-
- only the intended sync branch changed.
|
|
198
|
-
|
|
199
|
-
Present the meaningful diff for human review. After acceptance, recommend `/deliver` for normal commit/push/PR/CI mechanics.
|
|
200
|
-
|
|
201
|
-
### Remote path
|
|
202
|
-
|
|
203
|
-
Observe the provider result when available. Report the target branch/PR and exact Core commit applied. The human reviews the consumer PR and retains the normal explicit merge/finalize gate.
|
|
162
|
+
Confirm exact Core provenance, managed hashes, consumer-owned preservation, and intended branch scope. Present the meaningful diff and recommend `/deliver` after human acceptance.
|
|
204
163
|
|
|
205
|
-
|
|
164
|
+
For a remote path, report the resulting PR and exact Core commit when observed. Merge remains the normal explicit final gate.
|
|
206
165
|
|
|
207
|
-
##
|
|
166
|
+
## 9. Boundaries
|
|
208
167
|
|
|
209
168
|
`/core-sync` never:
|
|
210
169
|
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
- treats managed consumer drift as disposable
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
- merges the consumer sync PR without the normal explicit final gate,
|
|
170
|
+
- directly synchronizes Core when `LEAN_BASELINE.json` exists;
|
|
171
|
+
- uses direct Core sync as a substitute for `/lean-update`;
|
|
172
|
+
- modifies ambiguous local Core state;
|
|
173
|
+
- treats managed consumer drift as disposable;
|
|
174
|
+
- publishes Core or Lean package releases/tags;
|
|
175
|
+
- merges the consumer sync PR;
|
|
218
176
|
- deploys production.
|
|
219
177
|
|
|
220
|
-
If reusable Core
|
|
178
|
+
If reusable Core behavior itself is wrong, fix Core canonically through `/upstream-fix`; then adopt it through the update channel appropriate to the consumer's provenance model.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deploy
|
|
3
|
-
description: "Guided deployment orchestration for a configured named environment.
|
|
3
|
+
description: "Guided deployment orchestration for a configured named environment. Verifies package/deployment provenance, selects the exact target/artifact, preserves tool-specific authorization, and delegates deterministic execution to repository-provided deployment tooling."
|
|
4
4
|
argument-hint: "[environment] [release-or-artifact]"
|
|
5
5
|
user-invocable: true
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -10,59 +10,50 @@ disable-model-invocation: true
|
|
|
10
10
|
|
|
11
11
|
`/deploy` is the normal human-facing deployment interface once deployment engineering and the selected environment are ready.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Core owns interaction, validation, target safety, and Human-in-the-Loop authorization. Repository-provided deployment tooling owns deployment mechanics.
|
|
14
14
|
|
|
15
|
-
Do not implement application deployment logic directly in
|
|
15
|
+
Do not implement Docker, SSH, route, migration, or application deployment logic directly in this skill when an approved repository command exists.
|
|
16
16
|
|
|
17
|
-
## 1. Begin read-only
|
|
17
|
+
## 1. Begin read-only and establish provenance
|
|
18
18
|
|
|
19
19
|
Invocation starts read-only.
|
|
20
20
|
|
|
21
21
|
Read only the minimum repository context needed to identify:
|
|
22
22
|
|
|
23
|
-
- the
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
23
|
+
- `LEAN_BASELINE.json` when the repository is package-managed;
|
|
24
|
+
- `DEPLOYMENT_BASELINE.json` when present;
|
|
25
|
+
- approved deployment/release requirements;
|
|
26
|
+
- configured named environments and checkout-local target bindings;
|
|
27
|
+
- selected environment readiness evidence;
|
|
28
|
+
- approved release/artifact policy;
|
|
29
|
+
- repository-provided deployment entry point and its authorization contract;
|
|
29
30
|
- expected developer-workstation and target operating systems.
|
|
30
31
|
|
|
31
|
-
Do not assume configuration
|
|
32
|
+
Do not assume configuration filenames, target OS, SSH aliases, container runtime, or release format unless the repository establishes them.
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## 2. Select an environment explicitly
|
|
36
|
-
|
|
37
|
-
If the invocation did not name an environment, enumerate only environments configured for this checkout and ask the human to select one.
|
|
38
|
-
|
|
39
|
-
Show enough non-secret identity to distinguish them, for example:
|
|
34
|
+
When `DEPLOYMENT_BASELINE.json` identifies the standard Lean POC Deployment Kit and its generated entry point exists, prefer the repository-distributed interface such as:
|
|
40
35
|
|
|
41
36
|
```text
|
|
42
|
-
|
|
37
|
+
tools/lean-deployment/lean-poc-deploy.py
|
|
38
|
+
```
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
Role: non-production
|
|
46
|
-
Target: portable-ubuntu
|
|
47
|
-
[REMOTE WRITE]
|
|
40
|
+
over reconstructing Deployment Kit commands by hand or requiring a separate Kit checkout.
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
Role: production
|
|
51
|
-
Target: home-production
|
|
52
|
-
[PRODUCTION WRITE]
|
|
42
|
+
If package/component baseline integrity is already known to be drifted, or deployment engineering/readiness is incomplete, stop and route to `/lean-update`, `/upstream-fix`, the deployment work item, or `/production-readiness` as appropriate.
|
|
53
43
|
|
|
54
|
-
|
|
55
|
-
```
|
|
44
|
+
## 2. Select an environment explicitly
|
|
56
45
|
|
|
57
|
-
|
|
46
|
+
If the invocation did not name an environment, enumerate only environments configured for this checkout and ask the human to select one.
|
|
47
|
+
|
|
48
|
+
Show enough non-secret identity to distinguish them.
|
|
58
49
|
|
|
59
50
|
Rules:
|
|
60
51
|
|
|
61
52
|
- never silently default to `production`;
|
|
62
53
|
- never use a remembered prior selection as implicit production authorization;
|
|
63
54
|
- never fall back from one environment to another because discovery, access, readiness, or deployment failed;
|
|
64
|
-
- if
|
|
65
|
-
- selecting an environment chooses scope but does not
|
|
55
|
+
- if a named environment is not configured, fail explicitly;
|
|
56
|
+
- selecting an environment chooses scope but does not authorize the deployment write.
|
|
66
57
|
|
|
67
58
|
## 3. Resolve and verify the target binding
|
|
68
59
|
|
|
@@ -78,66 +69,61 @@ named environment
|
|
|
78
69
|
|
|
79
70
|
Address discovery is not host trust.
|
|
80
71
|
|
|
81
|
-
Before
|
|
72
|
+
Before remote deployment:
|
|
82
73
|
|
|
83
74
|
- verify the selected environment resolves to its configured target;
|
|
84
|
-
- use the repository-approved stable target
|
|
85
|
-
- preserve enrolled
|
|
86
|
-
- stop on
|
|
75
|
+
- use the repository-approved stable logical target rather than a guessed transient address;
|
|
76
|
+
- preserve enrolled host-key verification independently of current IP;
|
|
77
|
+
- stop on unknown/changed host identity;
|
|
87
78
|
- never bypass host-key checks, silently enroll new trust, scan/select another host, or weaken network controls as recovery;
|
|
88
|
-
- verify
|
|
79
|
+
- verify actual target OS compatibility before target-specific behavior.
|
|
89
80
|
|
|
90
|
-
Changing an environment's
|
|
81
|
+
Changing an environment's target is readiness/configuration work, not deployment fallback.
|
|
91
82
|
|
|
92
83
|
Keep private keys, passphrases, credentials, copied trust databases, and other secret values out of repository configuration and logs.
|
|
93
84
|
|
|
94
|
-
## 4.
|
|
85
|
+
## 4. Resolve the repository-provided launcher
|
|
95
86
|
|
|
96
|
-
|
|
87
|
+
Prefer the canonical repository-provided deployment interface established by the current deployment baseline.
|
|
97
88
|
|
|
98
|
-
|
|
89
|
+
For package-generated Deployment Kit consumers this normally means the generated Python entry point plus its distributed modules. Do not require a sibling Deployment Kit clone for normal deployment.
|
|
99
90
|
|
|
100
|
-
|
|
101
|
-
Windows developer workstation → approved PowerShell deployment entry point
|
|
102
|
-
macOS/Linux developer workstation → approved shell deployment entry point
|
|
103
|
-
```
|
|
91
|
+
A repository may additionally provide PowerShell/shell wrappers. Use them only when the repository defines them as the approved interface or when they intentionally wrap the same deterministic contract.
|
|
104
92
|
|
|
105
|
-
|
|
93
|
+
Launcher choice may depend on developer workstation OS; target behavior depends on selected target OS. Do not confuse those dimensions.
|
|
106
94
|
|
|
107
|
-
|
|
95
|
+
If the approved launcher is absent, locally drifted, or unsupported on the current workstation/target, stop rather than inventing deployment mechanics.
|
|
108
96
|
|
|
109
|
-
|
|
97
|
+
## 5. Resolve release/artifact identity
|
|
110
98
|
|
|
111
|
-
|
|
99
|
+
Use the repository's approved policy for the selected environment.
|
|
112
100
|
|
|
113
|
-
|
|
101
|
+
For production require the approved formal release/artifact evidence, including immutable identity when required.
|
|
114
102
|
|
|
115
|
-
|
|
103
|
+
For non-production, use only the broader artifact policy explicitly allowed by the repository. Do not invent relaxed staging semantics.
|
|
116
104
|
|
|
117
|
-
|
|
118
|
-
environment
|
|
119
|
-
release/version or artifact identity
|
|
120
|
-
immutable digest when required
|
|
121
|
-
dry-run/check mode when supported
|
|
122
|
-
```
|
|
105
|
+
When promoting a tested artifact to production, prefer the exact same immutable artifact/digest rather than rebuilding it.
|
|
123
106
|
|
|
124
|
-
|
|
107
|
+
## 6. Preserve the deployment tool's exact authorization contract
|
|
125
108
|
|
|
126
|
-
|
|
109
|
+
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.
|
|
127
110
|
|
|
128
|
-
|
|
111
|
+
For example, the standard Deployment Kit may require operation-specific phrases such as:
|
|
129
112
|
|
|
130
|
-
|
|
113
|
+
```text
|
|
114
|
+
[APP DEPLOY WRITE]
|
|
115
|
+
[PRODUCTION APP DEPLOY]
|
|
116
|
+
```
|
|
131
117
|
|
|
132
|
-
|
|
118
|
+
The exact phrase must be resolved from the installed repository/tool contract. Do not hardcode an example phrase when the installed version requires a different one.
|
|
133
119
|
|
|
134
|
-
|
|
120
|
+
Authorization applies only to the exact environment, verified target, artifact, plan/evidence, and operation shown. If any materially changes, stop and require renewed review/authorization.
|
|
135
121
|
|
|
136
|
-
|
|
122
|
+
No requirements approval, code review, PR merge, CI pass, environment selection, prior deployment, or readiness result implicitly authorizes a deployment write.
|
|
137
123
|
|
|
138
|
-
## 7. Present the deployment preview and
|
|
124
|
+
## 7. Present the deployment preview and gate
|
|
139
125
|
|
|
140
|
-
Before
|
|
126
|
+
Before the modifying command show the resolved non-secret facts:
|
|
141
127
|
|
|
142
128
|
```text
|
|
143
129
|
DEPLOYMENT READY
|
|
@@ -146,48 +132,45 @@ Environment: <name>
|
|
|
146
132
|
Role: <production|non-production>
|
|
147
133
|
Target: <verified logical target>
|
|
148
134
|
Target OS: <verified>
|
|
149
|
-
Launcher: <repository-provided
|
|
150
|
-
|
|
135
|
+
Launcher: <repository-provided command>
|
|
136
|
+
Deployment baseline: <exact commit/distribution when present>
|
|
137
|
+
Release/artifact: <verified immutable identity>
|
|
138
|
+
Required authorization: <exact tool phrase or repository gate>
|
|
151
139
|
Readiness blockers: NONE
|
|
152
140
|
```
|
|
153
141
|
|
|
154
|
-
For a non-production
|
|
142
|
+
For a non-production deployment ask for one bounded authorization covering the exact reviewed plan and required tool phrase.
|
|
155
143
|
|
|
156
|
-
|
|
157
|
-
Authorize deployment to <environment>? [REMOTE WRITE]
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
For a production-role environment require the project's explicit production deployment gate:
|
|
144
|
+
For production require the project's explicit production deployment gate and the exact installed tool phrase. Keep the consequence visible as:
|
|
161
145
|
|
|
162
146
|
```text
|
|
163
|
-
|
|
147
|
+
[PRODUCTION WRITE]
|
|
164
148
|
```
|
|
165
149
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
No requirements approval, code review, PR merge, CI pass, environment selection, prior deployment, or readiness result implicitly authorizes this deployment.
|
|
150
|
+
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.
|
|
169
151
|
|
|
170
152
|
## 8. Execute only the approved script contract
|
|
171
153
|
|
|
172
|
-
After authorization
|
|
154
|
+
After authorization invoke only the repository-provided launcher with the explicitly selected environment and approved artifact inputs.
|
|
173
155
|
|
|
174
|
-
Do not perform unrelated host provisioning, target rebinding, firewall changes, credential creation, destructive recovery, or other out-of-band
|
|
156
|
+
Do not perform unrelated host provisioning, target rebinding, firewall changes, credential creation, destructive recovery, database restore, or other out-of-band writes as part of `/deploy` unless they are explicitly inside the reviewed deterministic deployment contract.
|
|
175
157
|
|
|
176
|
-
If the script reports missing prerequisites, identity mismatch, unexpected target OS, lock contention, migration failure, readiness failure, or another blocker, stop according to the repository
|
|
158
|
+
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.
|
|
177
159
|
|
|
178
160
|
## 9. Verify and record outcome
|
|
179
161
|
|
|
180
|
-
After
|
|
162
|
+
After execution, use repository-provided readiness/smoke/evidence commands when available.
|
|
181
163
|
|
|
182
|
-
Report
|
|
164
|
+
Report only evidence-backed outcomes:
|
|
183
165
|
|
|
184
|
-
- selected environment
|
|
185
|
-
- verified target identity/label
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
166
|
+
- selected environment;
|
|
167
|
+
- verified target identity/label;
|
|
168
|
+
- deployment baseline/tool identity when relevant;
|
|
169
|
+
- release/artifact identity;
|
|
170
|
+
- deployment result;
|
|
171
|
+
- readiness/smoke result;
|
|
172
|
+
- rollback/recovery outcome when applicable.
|
|
190
173
|
|
|
191
|
-
Do not report success merely because a command returned or a container/process started if
|
|
174
|
+
Do not report success merely because a command returned or a container/process started if stronger readiness evidence is required.
|
|
192
175
|
|
|
193
|
-
Application rollback
|
|
176
|
+
Application rollback, database restore, destructive recovery, and environment tear-down remain separate decisions when the repository contract makes them separate.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lean-update
|
|
3
|
+
description: Guided whole-profile update for package-managed Lean consumers using the exact published @mriekki/lean artifact while preserving Core, Deployment, umbrella, and generated-consumer provenance integrity.
|
|
4
|
+
argument-hint: "[optional exact package version]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Lean Update
|
|
10
|
+
|
|
11
|
+
`/lean-update` is the normal update workflow for consumers that contain `LEAN_BASELINE.json` and were installed/generated from the public Lean package.
|
|
12
|
+
|
|
13
|
+
The governing rule is:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
package-managed consumer
|
|
17
|
+
→ update the whole Lean profile through the published package
|
|
18
|
+
→ keep LEAN_BASELINE.json + component baselines coherent
|
|
19
|
+
→ when the consumer is Bootstrap-generated, keep approved generation metadata and generated package-verification surfaces coherent too
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Do not replace this with direct Core-only or Deployment-Kit-only synchronization when `LEAN_BASELINE.json` is present.
|
|
23
|
+
|
|
24
|
+
Invocation starts read-only. One explicit update choice may authorize safe branch setup plus the exact package apply, generated-consumer companion metadata updates when applicable, and verification. `/deliver`, merge, release publication, and production deployment remain separate.
|
|
25
|
+
|
|
26
|
+
## 1. Establish package-managed provenance
|
|
27
|
+
|
|
28
|
+
From the consumer root read:
|
|
29
|
+
|
|
30
|
+
- `LEAN_BASELINE.json`;
|
|
31
|
+
- `CORE_BASELINE.json` when present;
|
|
32
|
+
- `DEPLOYMENT_BASELINE.json` when present;
|
|
33
|
+
- `POC_BOOTSTRAP.json` when present;
|
|
34
|
+
- current Git status, branch, remotes, and default branch when observable.
|
|
35
|
+
|
|
36
|
+
Require `LEAN_BASELINE.json` to identify:
|
|
37
|
+
|
|
38
|
+
- package name;
|
|
39
|
+
- installed package version;
|
|
40
|
+
- profile;
|
|
41
|
+
- recorded Core component commit/version/distribution;
|
|
42
|
+
- recorded Deployment component commit/distribution when that component is present.
|
|
43
|
+
|
|
44
|
+
If `LEAN_BASELINE.json` is absent, report `NOT A PACKAGE-MANAGED LEAN CONSUMER` and stop. A Core-only consumer may use `/core-sync`; another component-only consumer must use that component's canonical compatibility path.
|
|
45
|
+
|
|
46
|
+
Do not synthesize or repair missing umbrella provenance by hand.
|
|
47
|
+
|
|
48
|
+
### Bootstrap-generated consumers
|
|
49
|
+
|
|
50
|
+
If `POC_BOOTSTRAP.json` exists, treat it as approved generated-consumer provenance, not unrelated product data.
|
|
51
|
+
|
|
52
|
+
Before planning an update, require `generation.lean.package`, `generation.lean.version`, and `generation.lean.profile` to agree exactly with the installed `LEAN_BASELINE.json`. Require `generation.lean.integrity` to be a non-empty exact registry integrity value for that installed package/version. Verify that integrity read-only from the registry when registry access is available.
|
|
53
|
+
|
|
54
|
+
If those values disagree before the update, report `GENERATED LEAN METADATA DRIFT` and stop. Do not use `/lean-update` to silently reconcile an already-incoherent generated consumer.
|
|
55
|
+
|
|
56
|
+
Also inspect generated package-verification surfaces such as `.github/workflows/ci.yml` when present. If they duplicate the approved package version/integrity literally, record that current shape as companion generated metadata that must remain coherent with `POC_BOOTSTRAP.json` during the update. Do not rewrite locally customized or unrecognized generated surfaces by guesswork.
|
|
57
|
+
|
|
58
|
+
## 2. Verify the installed package baseline first
|
|
59
|
+
|
|
60
|
+
Before planning an update, verify that the current managed state still matches the exact installed package version recorded in `LEAN_BASELINE.json`.
|
|
61
|
+
|
|
62
|
+
For the standard package this is equivalent to:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
npx --yes @mriekki/lean@<installed-version> check
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use the package identity recorded by the baseline rather than silently substituting another package.
|
|
69
|
+
|
|
70
|
+
If the exact installed package cannot be obtained, or `check` reports stale/drifted Core, Deployment, or umbrella metadata, stop. Do not use an update as a way to overwrite unexplained managed drift.
|
|
71
|
+
|
|
72
|
+
Also inspect Git state. Preserve unrelated consumer work; never auto-stash, reset, clean, rebase, force-update, or discard it.
|
|
73
|
+
|
|
74
|
+
## 3. Resolve one exact target package
|
|
75
|
+
|
|
76
|
+
If the human supplied an exact version, use that exact version after confirming it exists.
|
|
77
|
+
|
|
78
|
+
Otherwise resolve the registry's current published version first, then pin that exact value for the remainder of the operation. For the standard package, typical read-only evidence is:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
npm view @mriekki/lean@latest version --json
|
|
82
|
+
npm view @mriekki/lean@<resolved-version> dist.integrity --json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Capture the target package's full exact `dist.integrity` together with the resolved version. For a Bootstrap-generated consumer, that exact integrity is part of the reviewed companion metadata update.
|
|
86
|
+
|
|
87
|
+
Do not use a moving `@latest` reference for the modifying apply after preview. Use the same exact package version for preview, apply, and final check.
|
|
88
|
+
|
|
89
|
+
If the resolved version equals the installed version and the exact-version check passes, report `LEAN ALREADY CURRENT` and stop without creating a branch or commit.
|
|
90
|
+
|
|
91
|
+
If the resolved target is semantically older than the installed package, report `LEAN DOWNGRADE REQUESTED` and stop. Normal `/lean-update` does not authorize a downgrade or rollback; that requires a separate explicit recovery/rollback decision with repository-specific evidence.
|
|
92
|
+
|
|
93
|
+
## 4. Preview the whole-profile update
|
|
94
|
+
|
|
95
|
+
Run the target package's update command without `--apply` and inspect the complete plan. For the standard package:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
npx --yes @mriekki/lean@<target-version> update
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Do not approve the package's interactive apply prompt during preview. When needed, invoke preview in the environment's non-interactive/read-only form so the printed plan is observed without applying it.
|
|
102
|
+
|
|
103
|
+
The preview must cover every component in the installed profile together. A managed conflict/drift in any component blocks the whole update.
|
|
104
|
+
|
|
105
|
+
Stop on unsafe states such as:
|
|
106
|
+
|
|
107
|
+
- `LOCAL_DRIFT`;
|
|
108
|
+
- `CONFLICT`;
|
|
109
|
+
- `LOCAL_MISSING`;
|
|
110
|
+
- `UNTRACKED_CONFLICT`;
|
|
111
|
+
- path collisions/conflicts;
|
|
112
|
+
- unaccepted Core `RETIRED_PATH`.
|
|
113
|
+
|
|
114
|
+
Core retired paths are an ownership-transfer decision. Never auto-add `--accept-retired core:<path>` merely to make the update pass. Explain the retired path and require a separate explicit ownership decision before re-previewing it.
|
|
115
|
+
|
|
116
|
+
For a Bootstrap-generated consumer, also preview the companion generated-consumer changes:
|
|
117
|
+
|
|
118
|
+
- `POC_BOOTSTRAP.json` keeps the same package/profile but changes `generation.lean.version` and `generation.lean.integrity` to the exact reviewed target;
|
|
119
|
+
- generated package-verification surfaces should consume `POC_BOOTSTRAP.json` dynamically when the accepted Bootstrap contract supports that form;
|
|
120
|
+
- a recognized older Bootstrap-generated verification block may be migrated only when its embedded old package/version/integrity exactly match the currently approved manifest metadata;
|
|
121
|
+
- an unrecognized or locally modified generated verification surface is a stop condition, not permission to reconstruct Bootstrap output by hand.
|
|
122
|
+
|
|
123
|
+
## 5. Present one bounded update choice
|
|
124
|
+
|
|
125
|
+
When the exact target package plan and any generated-consumer companion plan are safe, present:
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
LEAN UPDATE READY
|
|
129
|
+
|
|
130
|
+
Installed: <package>@<installed-version>
|
|
131
|
+
Target: <package>@<target-version>
|
|
132
|
+
Target integrity: <exact dist.integrity>
|
|
133
|
+
Profile: <profile>
|
|
134
|
+
Core: <old> → <new>
|
|
135
|
+
Deployment: <old> → <new> / unchanged
|
|
136
|
+
Generated consumer metadata: <not present / coherent update planned>
|
|
137
|
+
Managed drift/conflicts: NONE
|
|
138
|
+
|
|
139
|
+
1. Apply the exact Lean package update [GIT + FILE WRITE] — recommended
|
|
140
|
+
2. Keep inspecting only [READ ONLY]
|
|
141
|
+
3. Stop [NO ACTION]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Choosing option 1 authorizes only:
|
|
145
|
+
|
|
146
|
+
- creation/switch to one repository-appropriate short-lived update branch when needed;
|
|
147
|
+
- exact target package apply;
|
|
148
|
+
- when `POC_BOOTSTRAP.json` is present, update of its exact `generation.lean.version` and `generation.lean.integrity` to the reviewed target while preserving package/profile;
|
|
149
|
+
- migration of a recognized Bootstrap-generated package-verification block from duplicated current literals to the accepted manifest-driven form, only when the existing block still exactly matches the current approved metadata;
|
|
150
|
+
- package/baseline/generated-consumer verification;
|
|
151
|
+
- inspection of the resulting meaningful diff.
|
|
152
|
+
|
|
153
|
+
It does not authorize `/deliver`, merge, npm/Core/Deployment/Bootstrap release publication, arbitrary regeneration, or deployment.
|
|
154
|
+
|
|
155
|
+
## 6. Apply only the exact previewed package
|
|
156
|
+
|
|
157
|
+
If the consumer is on its default branch, create/switch to a short-lived branch such as:
|
|
158
|
+
|
|
159
|
+
```text
|
|
160
|
+
chore/update-lean-<target-version>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Branch setup is routine inside the selected bounded update action when safe and unambiguous.
|
|
164
|
+
|
|
165
|
+
Apply using the same exact package version that was previewed, for example:
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
npx --yes @mriekki/lean@<target-version> update --apply
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
If explicit Core retired-path ownership transfer was separately approved, pass only the exact reviewed paths using the package's `--accept-retired core:<path>` contract. Never widen that set implicitly.
|
|
172
|
+
|
|
173
|
+
For a Bootstrap-generated consumer, complete the reviewed companion metadata changes in the same bounded update before declaring success. Preserve every unrelated `POC_BOOTSTRAP.json` field. Never change package identity or profile as an incidental version update.
|
|
174
|
+
|
|
175
|
+
Do not run direct `tools/package/sync.py`, Deployment Kit sync, or a remote `[sync-core]` request as part of a package-managed update.
|
|
176
|
+
|
|
177
|
+
## 7. Verify all baselines, generated metadata, and the diff
|
|
178
|
+
|
|
179
|
+
After apply, run the exact target package check:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
npx --yes @mriekki/lean@<target-version> check
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Then inspect:
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
git status --short --branch
|
|
189
|
+
git diff --stat
|
|
190
|
+
git diff -- LEAN_BASELINE.json CORE_BASELINE.json DEPLOYMENT_BASELINE.json POC_BOOTSTRAP.json .github/workflows/ci.yml
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Confirm:
|
|
194
|
+
|
|
195
|
+
- `LEAN_BASELINE.json` records the exact target package/version/profile;
|
|
196
|
+
- component baseline commits/distributions match the umbrella baseline;
|
|
197
|
+
- package check passes for the whole profile;
|
|
198
|
+
- when `POC_BOOTSTRAP.json` exists, its package/version/profile agree with `LEAN_BASELINE.json` and its integrity equals the exact reviewed target registry integrity;
|
|
199
|
+
- when the repository contains `tools/lean-package/check-managed-baselines.py`, that generated baseline checker passes after all companion metadata changes;
|
|
200
|
+
- generated package-verification surfaces no longer contradict the approved manifest metadata;
|
|
201
|
+
- consumer-owned content was not overwritten;
|
|
202
|
+
- only intended package-managed changes, reviewed generated-consumer companion changes, and reviewed ownership transfers occurred.
|
|
203
|
+
|
|
204
|
+
If generated CI still embeds a different package version/integrity after the update, report `GENERATED LEAN VERIFICATION DRIFT` and stop before delivery.
|
|
205
|
+
|
|
206
|
+
Present the meaningful diff for human review. After acceptance, recommend `/deliver` for normal commit/push/PR/CI mechanics.
|
|
207
|
+
|
|
208
|
+
## 8. Boundaries
|
|
209
|
+
|
|
210
|
+
`/lean-update` never:
|
|
211
|
+
|
|
212
|
+
- updates only Core or only Deployment when `LEAN_BASELINE.json` manages them together;
|
|
213
|
+
- uses a different package version for apply than the reviewed preview;
|
|
214
|
+
- performs a downgrade/rollback as an ordinary update;
|
|
215
|
+
- overwrites unexplained managed drift;
|
|
216
|
+
- auto-accepts Core retired-path ownership transfer;
|
|
217
|
+
- silently repairs a pre-existing mismatch between `POC_BOOTSTRAP.json` and `LEAN_BASELINE.json`;
|
|
218
|
+
- changes a generated consumer's package identity/profile or regenerates the repository as an incidental version update;
|
|
219
|
+
- guesses at locally modified/unrecognized Bootstrap-generated verification logic;
|
|
220
|
+
- publishes npm/Core/Deployment/Bootstrap releases or tags;
|
|
221
|
+
- merges the consumer PR;
|
|
222
|
+
- deploys an environment.
|
|
223
|
+
|
|
224
|
+
If reusable shared content is wrong rather than merely outdated, route the defect through `/upstream-fix` first. Package-managed adoption of the accepted fix happens only after an accepted Lean package release contains that upstream commit.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: upstream-fix
|
|
3
|
-
description: Route reusable bugs discovered in a consumer to the canonical shared repository, allow bounded upstream implementation, and return adoption
|
|
3
|
+
description: Route reusable bugs discovered in a consumer to the canonical shared repository, allow bounded upstream implementation, and return adoption through the consumer's actual provenance/update boundary.
|
|
4
4
|
argument-hint: "[optional problem summary]"
|
|
5
5
|
user-invocable: true
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -13,32 +13,26 @@ disable-model-invocation: true
|
|
|
13
13
|
The governing rule is:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
|
-
discover in
|
|
17
|
-
→ diagnose/prove in
|
|
18
|
-
→ fix in
|
|
16
|
+
discover in consumer
|
|
17
|
+
→ diagnose/prove in consumer
|
|
18
|
+
→ fix in owning canonical repository
|
|
19
19
|
→ deliver there
|
|
20
|
-
→
|
|
21
|
-
→ verify again in
|
|
20
|
+
→ adopt through the consumer's recorded distribution boundary
|
|
21
|
+
→ verify again in consumer
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
A temporary edit to a shared-managed file inside
|
|
24
|
+
A temporary edit to a shared-managed file inside a consumer may be useful as diagnosis/proof, but it is never the canonical delivered fix.
|
|
25
25
|
|
|
26
26
|
## 1. Invocation authorization
|
|
27
27
|
|
|
28
28
|
Invoking `/upstream-fix` authorizes:
|
|
29
29
|
|
|
30
30
|
- read-only ownership/provenance inspection in the consumer;
|
|
31
|
-
- classification
|
|
31
|
+
- classification to the smallest canonical owner;
|
|
32
32
|
- inspection of already-available local canonical repository candidates;
|
|
33
|
-
- when ownership and the
|
|
33
|
+
- when ownership and the bounded patch are clear and a canonical checkout is safe, routine creation/use of one short-lived canonical work branch and application of only that bounded fix plus focused tests/docs.
|
|
34
34
|
|
|
35
|
-
Invocation does **not** authorize
|
|
36
|
-
|
|
37
|
-
- commit, push, PR creation, merge, release publication, or deployment;
|
|
38
|
-
- rewriting/discarding consumer work;
|
|
39
|
-
- changing more than one canonical repository in the same bounded fix;
|
|
40
|
-
- broad filesystem scans or cloning shared repositories merely to satisfy the helper;
|
|
41
|
-
- treating a temporary consumer patch as accepted shared implementation.
|
|
35
|
+
Invocation does **not** authorize commit, push, PR creation, merge, release publication, package publication, deployment, rewriting/discarding consumer work, or changing multiple canonical repositories in one bounded fix.
|
|
42
36
|
|
|
43
37
|
Normal review and `/deliver` occur later while focused on the owning canonical repository.
|
|
44
38
|
|
|
@@ -46,20 +40,16 @@ Normal review and `/deliver` occur later while focused on the owning canonical r
|
|
|
46
40
|
|
|
47
41
|
From the consumer root inspect, when present:
|
|
48
42
|
|
|
43
|
+
- `LEAN_BASELINE.json`;
|
|
49
44
|
- `CORE_BASELINE.json`;
|
|
50
45
|
- `DEPLOYMENT_BASELINE.json`;
|
|
51
46
|
- `.github/lean-workspace.json`;
|
|
52
47
|
- current Git branch/status/diff;
|
|
53
48
|
- the files involved in the reported problem or temporary proof.
|
|
54
49
|
|
|
55
|
-
Run repository-local managed-baseline checks when available
|
|
56
|
-
|
|
57
|
-
```text
|
|
58
|
-
python tools/lean-core/check-core-baseline.py --root .
|
|
59
|
-
python tools/lean-deployment/check-deployment-baseline.py
|
|
60
|
-
```
|
|
50
|
+
Run repository-local managed-baseline checks when available.
|
|
61
51
|
|
|
62
|
-
Do not assume every generated-looking file is shared-owned. Use baseline managed-path records as the primary ownership evidence.
|
|
52
|
+
Do not assume every generated-looking file is shared-owned. Use baseline managed-path records as the primary ownership evidence, and use `LEAN_BASELINE.json` to determine whether component baselines are managed together by an umbrella package.
|
|
63
53
|
|
|
64
54
|
## 3. Classify the owner
|
|
65
55
|
|
|
@@ -67,7 +57,7 @@ Use the smallest owning layer that would need the same fix for another consumer.
|
|
|
67
57
|
|
|
68
58
|
### Consumer-owned
|
|
69
59
|
|
|
70
|
-
|
|
60
|
+
Application domain logic, UI behavior, app-specific configuration, product tests, and consumer architecture normally remain consumer-owned.
|
|
71
61
|
|
|
72
62
|
Result:
|
|
73
63
|
|
|
@@ -76,13 +66,11 @@ CONSUMER FIX
|
|
|
76
66
|
Owner: current repository
|
|
77
67
|
```
|
|
78
68
|
|
|
79
|
-
|
|
69
|
+
Return to the consumer's normal `/start-work` / implementation / review / `/deliver` flow.
|
|
80
70
|
|
|
81
71
|
### Core-owned
|
|
82
72
|
|
|
83
|
-
Evidence includes a
|
|
84
|
-
|
|
85
|
-
Result:
|
|
73
|
+
Evidence includes a path managed by `CORE_BASELINE.json` or behavior defined by reusable Core workflow assets.
|
|
86
74
|
|
|
87
75
|
```text
|
|
88
76
|
CORE BUG
|
|
@@ -91,26 +79,33 @@ Owner: <repository recorded by CORE_BASELINE.json>
|
|
|
91
79
|
|
|
92
80
|
### Deployment-Kit-owned
|
|
93
81
|
|
|
94
|
-
Evidence includes a
|
|
95
|
-
|
|
96
|
-
Result:
|
|
82
|
+
Evidence includes a path managed by `DEPLOYMENT_BASELINE.json` or reusable deployment mechanics owned by that recorded Kit.
|
|
97
83
|
|
|
98
84
|
```text
|
|
99
85
|
DEPLOYMENT BUG
|
|
100
86
|
Owner: <repository recorded by DEPLOYMENT_BASELINE.json>
|
|
101
87
|
```
|
|
102
88
|
|
|
89
|
+
### Package assembly / Lean Platform-owned
|
|
90
|
+
|
|
91
|
+
When canonical component source is correct but the published package bytes, component pins, package engine, or umbrella baseline behavior is wrong:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
LEAN PLATFORM BUG
|
|
95
|
+
Owner: package/platform repository supported by evidence
|
|
96
|
+
```
|
|
97
|
+
|
|
103
98
|
### Generator/control-plane owned
|
|
104
99
|
|
|
105
|
-
If
|
|
100
|
+
If the package payload is correct but generation/publication/orchestration materializes it incorrectly, classify Bootstrap/control-plane ownership from evidence rather than patching a generated consumer.
|
|
106
101
|
|
|
107
|
-
If ownership is genuinely ambiguous, stop at `UPSTREAM OWNER UNCLEAR
|
|
102
|
+
If ownership is genuinely ambiguous, stop at `UPSTREAM OWNER UNCLEAR`. Do not write to multiple repositories speculatively.
|
|
108
103
|
|
|
109
104
|
## 4. Temporary consumer proof
|
|
110
105
|
|
|
111
|
-
A temporary consumer edit to a shared-managed path is allowed for diagnosis when it
|
|
106
|
+
A temporary consumer edit to a shared-managed path is allowed for diagnosis when it proves the fix in real application context.
|
|
112
107
|
|
|
113
|
-
|
|
108
|
+
Report it explicitly:
|
|
114
109
|
|
|
115
110
|
```text
|
|
116
111
|
TEMPORARY SHARED-MANAGED PROOF
|
|
@@ -119,48 +114,38 @@ Canonical owner: <repo>
|
|
|
119
114
|
Do not deliver this consumer copy.
|
|
120
115
|
```
|
|
121
116
|
|
|
122
|
-
Do not silently
|
|
117
|
+
Do not silently discard the proof and do not stage/commit it as ordinary consumer implementation.
|
|
123
118
|
|
|
124
|
-
## 5. Resolve a canonical
|
|
119
|
+
## 5. Resolve a safe canonical checkout
|
|
125
120
|
|
|
126
|
-
For the classified owner
|
|
121
|
+
For the classified owner consider, in order:
|
|
127
122
|
|
|
128
|
-
1. explicit path supplied by the human;
|
|
129
|
-
2. an already-open workspace folder
|
|
123
|
+
1. an explicit path supplied by the human;
|
|
124
|
+
2. an already-open workspace folder with the expected Git remote;
|
|
130
125
|
3. a normal sibling checkout derived from the canonical repository name.
|
|
131
126
|
|
|
132
|
-
Do not broadly scan the filesystem
|
|
133
|
-
|
|
134
|
-
A candidate is safe for bounded upstream implementation only when:
|
|
127
|
+
Do not broadly scan the filesystem and do not clone automatically merely to continue.
|
|
135
128
|
|
|
136
|
-
|
|
137
|
-
- Git state can be inspected;
|
|
138
|
-
- no merge/rebase/cherry-pick is in progress;
|
|
139
|
-
- unrelated local work is absent;
|
|
140
|
-
- branch state does not require reset/rebase/force/stash/discard operations.
|
|
141
|
-
|
|
142
|
-
If no safe local canonical checkout exists, report the exact canonical repository and the proven consumer evidence. Do not clone automatically just to continue.
|
|
129
|
+
A candidate is safe only when it is the expected repository, has no merge/rebase/cherry-pick in progress, has no unrelated local work, and does not require stash/reset/rebase/force/discard operations.
|
|
143
130
|
|
|
144
131
|
## 6. Port the bounded fix upstream
|
|
145
132
|
|
|
146
|
-
When
|
|
147
|
-
|
|
148
|
-
1. inspect the canonical implementation and tests before editing;
|
|
149
|
-
2. create/use a repository-appropriate short-lived branch tied to the upstream issue/work item when needed;
|
|
150
|
-
3. reproduce the root cause against canonical code where practical;
|
|
151
|
-
4. apply the reusable fix in the canonical source, not by copying consumer-specific names/configuration;
|
|
152
|
-
5. add/update focused canonical tests that would have caught the defect;
|
|
153
|
-
6. update canonical docs only when the contract changed;
|
|
154
|
-
7. run relevant local checks when available;
|
|
155
|
-
8. show the canonical meaningful diff and observed validation.
|
|
133
|
+
When a safe canonical checkout exists and the equivalent reusable fix is clear:
|
|
156
134
|
|
|
157
|
-
|
|
135
|
+
1. inspect canonical implementation/tests before editing;
|
|
136
|
+
2. create/use one repository-appropriate short-lived branch;
|
|
137
|
+
3. reproduce the root cause canonically where practical;
|
|
138
|
+
4. apply the reusable fix without consumer-specific names/configuration;
|
|
139
|
+
5. add/update focused tests that would have caught the defect;
|
|
140
|
+
6. update canonical docs when the contract changed;
|
|
141
|
+
7. run relevant local checks;
|
|
142
|
+
8. show the meaningful canonical diff and observed validation.
|
|
158
143
|
|
|
159
|
-
If the consumer proof cannot be generalized safely, stop and reclassify
|
|
144
|
+
If the consumer proof cannot be generalized safely, stop and reclassify rather than forcing it upstream.
|
|
160
145
|
|
|
161
146
|
## 7. Handoff to canonical delivery
|
|
162
147
|
|
|
163
|
-
|
|
148
|
+
When the upstream implementation is ready:
|
|
164
149
|
|
|
165
150
|
```text
|
|
166
151
|
UPSTREAM FIX READY
|
|
@@ -172,23 +157,53 @@ Validation: <observed checks>
|
|
|
172
157
|
Next: focus the canonical repository and run /deliver
|
|
173
158
|
```
|
|
174
159
|
|
|
175
|
-
`/upstream-fix` does not commit/push/open/merge the canonical PR itself.
|
|
160
|
+
`/upstream-fix` does not commit/push/open/merge the canonical PR itself.
|
|
161
|
+
|
|
162
|
+
## 8. Adopt the accepted fix through the right boundary
|
|
163
|
+
|
|
164
|
+
After the canonical PR is merged and required default-branch CI is green, re-read the consumer provenance before choosing adoption.
|
|
165
|
+
|
|
166
|
+
### Package-managed consumer (`LEAN_BASELINE.json` present)
|
|
167
|
+
|
|
168
|
+
Do **not** direct-sync Core or Deployment Kit into the consumer.
|
|
169
|
+
|
|
170
|
+
The accepted component fix must first become part of an accepted published Lean package:
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
canonical Core/Deployment fix merged
|
|
174
|
+
→ Lean Platform pins the exact accepted component commit
|
|
175
|
+
→ Lean Platform PR + CI
|
|
176
|
+
→ explicit package publication gate
|
|
177
|
+
→ published exact @mriekki/lean version
|
|
178
|
+
→ consumer /lean-update <version>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Until that package exists, report:
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
PACKAGE RELEASE REQUIRED
|
|
185
|
+
Consumer adoption is blocked on a Lean package that contains the accepted upstream commit.
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Do not silently patch `LEAN_BASELINE.json`, `CORE_BASELINE.json`, or `DEPLOYMENT_BASELINE.json` to pretend the package contains the new component.
|
|
189
|
+
|
|
190
|
+
### Component-only Core consumer (`LEAN_BASELINE.json` absent)
|
|
191
|
+
|
|
192
|
+
A Core-owned fix may return through `/core-sync` using the exact accepted Core commit/distribution.
|
|
176
193
|
|
|
177
|
-
|
|
194
|
+
### Component-only Deployment consumer (`LEAN_BASELINE.json` absent)
|
|
178
195
|
|
|
179
|
-
|
|
196
|
+
A Deployment-owned fix may return through the canonical Deployment Kit compatibility sync and refresh `DEPLOYMENT_BASELINE.json`.
|
|
180
197
|
|
|
181
|
-
|
|
182
|
-
- Deployment-Kit-owned fixes return through the canonical Deployment Kit consumer-sync capability and refresh `DEPLOYMENT_BASELINE.json`;
|
|
183
|
-
- generator/control-plane fixes are validated by regenerating or using that platform's canonical update path, not by manually editing generated managed files.
|
|
198
|
+
### Generator/control-plane fix
|
|
184
199
|
|
|
185
|
-
|
|
200
|
+
Validate through that platform's canonical regeneration/update path, never by manually editing generated managed files.
|
|
186
201
|
|
|
187
|
-
|
|
202
|
+
Then rerun the original reproduction and baseline checks in the consumer.
|
|
188
203
|
|
|
189
204
|
## 9. Consumer delivery guard
|
|
190
205
|
|
|
191
|
-
If `/deliver` is invoked in a consumer with unexplained Core
|
|
206
|
+
If `/deliver` is invoked in a consumer with unexplained Core-, Deployment-, or Lean-package-managed drift, stop before staging/commit/push. Route reusable managed-file changes through `/upstream-fix` and then through the appropriate accepted update boundary.
|
|
192
207
|
|
|
193
208
|
Consumer-owned changes may be delivered normally when managed baselines are clean.
|
|
194
209
|
|
|
@@ -197,10 +212,10 @@ Consumer-owned changes may be delivered normally when managed baselines are clea
|
|
|
197
212
|
`/upstream-fix` never:
|
|
198
213
|
|
|
199
214
|
- merges changes;
|
|
200
|
-
- publishes releases/tags;
|
|
215
|
+
- publishes releases/tags/packages;
|
|
201
216
|
- deploys production;
|
|
202
|
-
- commits one
|
|
217
|
+
- commits one bounded fix across multiple repositories;
|
|
203
218
|
- auto-stashes, resets, rebases, force-pushes, or discards work;
|
|
204
|
-
- turns a maintainer multi-root workspace into generated repository content;
|
|
205
219
|
- requires ordinary consumer users to clone shared repositories;
|
|
206
|
-
- treats a temporary
|
|
220
|
+
- treats a temporary managed consumer edit as a permanent fork;
|
|
221
|
+
- bypasses `LEAN_BASELINE.json` with component-only sync.
|