@mriekki/lean 0.1.1 → 0.2.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/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
- ## V0.1 profile
7
+ ## Current `greenfield-poc` profile
8
8
 
9
- The initial `greenfield-poc` profile bundles:
9
+ The current profile bundles:
10
10
 
11
- - Lean Agentic Core `1.10.0` from commit `e2d64b10f1a30507471755339c20e8b58e62be16`, distribution `greenfield-workspace`;
11
+ - Lean Agentic Core `1.11.0` from commit `5b2f13bb188f74fa0d7b6b8d7985fe3abfc543f9`, distribution `greenfield-workspace`;
12
12
  - Lean POC Deployment Kit commit `4c23140576b39608a3ef285cad4abe53dccb9c47`, distribution `greenfield-poc`.
13
13
 
14
+ Core `1.11.0` adds the package-aware `/lean-update` workflow for `LEAN_BASELINE.json` consumers, keeps `/core-sync` as a compatibility/router path for component-only Core consumers, and aligns `/upstream-fix` and `/deploy` with the package and generated Deployment Kit boundaries.
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
- V0.1 intentionally 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.
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 is staged manually and requires explicit 2FA approval before it becomes public. After the bootstrap version exists, `.github/workflows/npm-stage.yml` can use npm Trusted Publishing (OIDC) to stage future versions without a long-lived npm publish token; human 2FA approval remains the final publication gate.
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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@mriekki/lean",
4
- "version": "0.1.1",
4
+ "version": "0.2.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": "e2d64b10f1a30507471755339c20e8b58e62be16",
18
- "version": "1.10.0",
17
+ "commit": "5b2f13bb188f74fa0d7b6b8d7985fe3abfc543f9",
18
+ "version": "1.11.0",
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.1.1",
4
+ "version": "0.2.0",
5
5
  "components": {
6
6
  "core": {
7
7
  "repository": "mriekki/lean-agentic-core",
8
- "commit": "e2d64b10f1a30507471755339c20e8b58e62be16",
9
- "version": "1.10.0",
8
+ "commit": "5b2f13bb188f74fa0d7b6b8d7985fe3abfc543f9",
9
+ "version": "1.11.0",
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": "b9534533c2b612f2787ce4b9d40494bd5a3554ccb646f500610fb899be8113d2"
86
+ },
82
87
  {
83
88
  "source": "core/skills/core-sync/SKILL.md",
84
89
  "destination": ".github/skills/core-sync/SKILL.md",
85
- "sha256": "6b2393639f3cc0581bed0df8667fc67691ae915d137b9f070c60bbdb042148a6"
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": "26d979b8876db4031f7e95887ab16a7c530d1fcd60043410ed8d20c4ea5f5301"
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": "57fca71a95a32f4dd17ed3fba13b9b1ccbd644082de175622960d9c65aaa47a0"
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: Guided Core-to-consumer synchronization that uses a safe local Core checkout when available and otherwise uses configured remote orchestration without requiring a Core clone.
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` updates a consumer repository to a newer accepted Lean Agentic Core baseline while preserving consumer-owned content and the Human-in-the-Loop delivery boundary.
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
- A local Core checkout is an optimization, not a prerequisite. Do not clone Core merely to satisfy `/core-sync`.
13
+ For package-managed consumers, `/lean-update` is authoritative.
14
14
 
15
- Invocation starts read-only. One explicit sync choice may authorize the bounded mechanics needed for the selected local or remote path; merge/final acceptance remains separate.
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. Establish the consumer baseline
17
+ ## 1. Classify the consumer before doing anything else
18
18
 
19
- From the consumer repository, read:
19
+ From the consumer repository read, when present:
20
20
 
21
- - `CORE_BASELINE.json`,
22
- - `.github/lean-workspace.json` when present,
23
- - `.github/lean-core-sync.json` when present,
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 current managed overlay already has unexplained local drift, missing managed files, or invalid baseline metadata. Do not treat consumer edits as disposable.
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
- ## 2. Resolve the Core source automatically
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 developer's filesystem.
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
- - it is a Git repository,
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 just because the local candidate is absent.
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
- ## 3. Classify a local Core checkout
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
- A local Core checkout may be automatically refreshed only when all of these are true:
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 local Core checkout is dirty, ahead, diverged, on an intentional non-default ref, or otherwise ambiguous, preserve it unchanged. When a remote provider is configured, prefer the remote path for the consumer update. Otherwise stop with the observed local state and the missing capability; do not silently use an unaccepted local ref.
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
- ### Safe local Core available
95
+ ## 5. Present one bounded compatibility-sync choice
85
96
 
86
- Present:
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 to the accepted Core source [GIT + FILE WRITE] — recommended
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
- Choosing option 1 authorizes only the bounded local-sync mechanics described below: safe Core refresh if needed, consumer sync-branch setup, safe Core overlay application, and verification. It does not authorize `/deliver`, merge, release publication, or production deployment.
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
- Choosing option 1 authorizes creation of exactly the configured remote sync request for this consumer. It does not authorize merging the resulting consumer PR.
125
+ The selected choice does not authorize merge, release publication, or deployment.
121
126
 
122
- ### Neither source is usable
127
+ ## 6. Local compatibility path
123
128
 
124
- Report `CORE SYNC BLOCKED` with the evidence. A missing local Core checkout by itself is not an error; the blocker is the absence of both a safe local source and a configured/usable remote provider.
129
+ After local option 1 is selected:
125
130
 
126
- ## 5. Local sync path
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. If behind and fast-forward-safe, update using the equivalent of:
133
-
134
- ```text
135
- git -C <core-path> pull --ff-only
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 individual managed files as a substitute for the canonical sync tool.
139
+ Do not manually copy managed files as a substitute for the canonical tool.
145
140
 
146
- ## 6. Remote sync path
141
+ ## 7. Remote compatibility path
147
142
 
148
- Remote orchestration is consumer configuration, not a hardcoded Core service. Read `.github/lean-core-sync.json` and require:
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
- Only the placeholders `{owner}` and `{repository}` may be substituted in `titleTemplate`. Resolve them from the consumer's canonical GitHub remote. Do not put product requirements, baseline JSON, source code, secrets, or other private consumer details into the public request.
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
- For `github-issue-control-plane`, create exactly one issue in the configured provider repository using the rendered title and an empty body. Use the environment's normal GitHub integration or CLI; never request or expose a long-lived Core credential merely to make the request.
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
- The remote provider is expected to:
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
- - validate requester/target authorization,
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
- If the configured provider does not support that contract, report `REMOTE SYNC UNAVAILABLE`; do not silently clone Core or invent a different synchronization mechanism.
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
- If the developer has a local consumer checkout, remind them to use `/pull-latest` after the remote sync PR is merged when their local working state is safe. Do not overwrite unrelated local work.
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
- ## 8. Boundaries
166
+ ## 9. Boundaries
208
167
 
209
168
  `/core-sync` never:
210
169
 
211
- - requires a local Core clone when a configured remote provider can perform the update,
212
- - modifies a dirty/diverged/intentional local Core checkout automatically,
213
- - uses merge/rebase/reset/force operations to refresh Core,
214
- - treats managed consumer drift as disposable,
215
- - overwrites consumer-owned paths merely because Core has a similarly named destination,
216
- - publishes a Core release/tag,
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 content itself is wrong, fix Core canonically instead of forking the reusable file in the consumer.
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. Selects and verifies the environment/target, preserves production gates, and delegates deterministic execution to repository-provided platform scripts."
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
- The skill owns interaction, validation, target safety, and authorization. Repository-provided scripts own deployment mechanics.
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 the skill when an approved repository script exists.
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 approved deployment/release requirements,
24
- - configured named deployment environments,
25
- - checkout-local environment-to-target bindings when the project uses them,
26
- - the selected environment's readiness evidence,
27
- - the approved release/artifact policy,
28
- - repository-provided deployment entry points,
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 file names, script paths, target OS, SSH aliases, container runtime, or release format unless the repository establishes them.
32
+ Do not assume configuration filenames, target OS, SSH aliases, container runtime, or release format unless the repository establishes them.
32
33
 
33
- If deployment engineering is not delivered or the selected environment is not operationally ready, stop and route to the repository's deployment work item or `/production-readiness` as appropriate.
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
- SELECT DEPLOYMENT ENVIRONMENT
37
+ tools/lean-deployment/lean-poc-deploy.py
38
+ ```
43
39
 
44
- 1. staging
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
- 2. production
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
- 3. Stop
55
- ```
44
+ ## 2. Select an environment explicitly
56
45
 
57
- Environment names and target labels above are examples only.
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 an environment is named but is not configured in this checkout, fail explicitly;
65
- - selecting an environment chooses scope but does not itself authorize the deployment write.
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 a remote deployment:
72
+ Before remote deployment:
82
73
 
83
74
  - verify the selected environment resolves to its configured target;
84
- - use the repository-approved stable target/SSH alias rather than a hard-coded transient address when that is the approved design;
85
- - preserve enrolled SSH host-key verification independently of the current IP address;
86
- - stop on an unknown host identity or changed host key;
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 the actual target OS is compatible with the environment's approved expected target OS before choosing target-specific deployment behavior.
79
+ - verify actual target OS compatibility before target-specific behavior.
89
80
 
90
- Changing an environment's bound target is configuration/readiness work, not a deployment fallback. Stop and route to the approved rebind/readiness workflow when rebinding is needed.
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. Select the local launcher by developer workstation OS
85
+ ## 4. Resolve the repository-provided launcher
95
86
 
96
- Use repository-provided platform-appropriate deployment entry points.
87
+ Prefer the canonical repository-provided deployment interface established by the current deployment baseline.
97
88
 
98
- Typical dispatch is:
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
- ```text
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
- The repository may define different supported launchers. Follow its contract rather than inventing a path.
93
+ Launcher choice may depend on developer workstation OS; target behavior depends on selected target OS. Do not confuse those dimensions.
106
94
 
107
- The launcher choice is based on the developer workstation OS. Target-specific behavior is based on the selected environment's approved target OS. Do not confuse those two dimensions.
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
- If the developer workstation or target OS is unsupported by the repository's approved deployment implementation, stop with a clear blocker.
97
+ ## 5. Resolve release/artifact identity
110
98
 
111
- ## 5. Preserve one deployment contract across launchers
99
+ Use the repository's approved policy for the selected environment.
112
100
 
113
- Where a repository provides multiple local launchers, they must preserve equivalent deployment semantics and safety behavior.
101
+ For production require the approved formal release/artifact evidence, including immutable identity when required.
114
102
 
115
- Prefer a common logical contract such as:
103
+ For non-production, use only the broader artifact policy explicitly allowed by the repository. Do not invent relaxed staging semantics.
116
104
 
117
- ```text
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
- Do not pass secret values on command lines merely to make launchers symmetric. Use the repository's approved protected credential mechanism.
107
+ ## 6. Preserve the deployment tool's exact authorization contract
125
108
 
126
- Environment-specific values are configuration, not reasons to duplicate otherwise equivalent deployment procedures.
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
- ## 6. Resolve release/artifact identity
111
+ For example, the standard Deployment Kit may require operation-specific phrases such as:
129
112
 
130
- Use the repository's approved policy for the selected environment.
113
+ ```text
114
+ [APP DEPLOY WRITE]
115
+ [PRODUCTION APP DEPLOY]
116
+ ```
131
117
 
132
- For a production-role environment, require the approved formal release/artifact evidence, including immutable identity when the project requires it.
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
- For non-production environments, the repository may allow the same formal release policy or a broader immutable CI/commit artifact policy. Do not invent broader permissions when the project has not approved them.
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
- When promoting a tested artifact from a non-production environment to production, prefer deploying the exact same immutable artifact/digest rather than rebuilding it for production.
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 authorization gate
124
+ ## 7. Present the deployment preview and gate
139
125
 
140
- Before running the modifying deployment script, show the resolved non-secret facts:
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 script>
150
- Release/artifact: <verified identity>
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 remote deployment ask for one bounded authorization such as:
142
+ For a non-production deployment ask for one bounded authorization covering the exact reviewed plan and required tool phrase.
155
143
 
156
- ```text
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
- Authorize deployment to <environment>? [PRODUCTION WRITE]
147
+ [PRODUCTION WRITE]
164
148
  ```
165
149
 
166
- Production authorization applies only to the exact environment, verified target, release/artifact, and evidence shown. If any of those materially changes, stop and require renewed review/authorization.
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, invoke the repository-provided launcher with the explicitly selected environment and approved release/artifact inputs.
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 remote writes as part of `/deploy` unless they are explicitly part of the already-approved deployment script contract and authorization scope.
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's deployment contract. Never redirect the deployment to another environment or host.
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 the script completes, use repository-provided readiness/smoke checks and evidence recording when available.
162
+ After execution, use repository-provided readiness/smoke/evidence commands when available.
181
163
 
182
- Report at least the non-secret outcome supported by evidence:
164
+ Report only evidence-backed outcomes:
183
165
 
184
- - selected environment,
185
- - verified target identity/label,
186
- - release/artifact identity,
187
- - deployment result,
188
- - readiness/smoke result,
189
- - rollback outcome when applicable.
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 the repository requires stronger readiness evidence.
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 and database restore/destructive recovery remain separate decisions when the project contract makes them separate.
176
+ Application rollback, database restore, destructive recovery, and environment tear-down remain separate decisions when the repository contract makes them separate.
@@ -0,0 +1,189 @@
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, and umbrella baseline 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
+ ```
20
+
21
+ Do not replace this with direct Core-only or Deployment-Kit-only synchronization when `LEAN_BASELINE.json` is present.
22
+
23
+ Invocation starts read-only. One explicit update choice may authorize safe branch setup plus the exact package apply and verification. `/deliver`, merge, release publication, and production deployment remain separate.
24
+
25
+ ## 1. Establish package-managed provenance
26
+
27
+ From the consumer root read:
28
+
29
+ - `LEAN_BASELINE.json`;
30
+ - `CORE_BASELINE.json` when present;
31
+ - `DEPLOYMENT_BASELINE.json` when present;
32
+ - current Git status, branch, remotes, and default branch when observable.
33
+
34
+ Require `LEAN_BASELINE.json` to identify:
35
+
36
+ - package name;
37
+ - installed package version;
38
+ - profile;
39
+ - recorded Core component commit/version/distribution;
40
+ - recorded Deployment component commit/distribution when that component is present.
41
+
42
+ 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.
43
+
44
+ Do not synthesize or repair missing umbrella provenance by hand.
45
+
46
+ ## 2. Verify the installed package baseline first
47
+
48
+ Before planning an update, verify that the current managed state still matches the exact installed package version recorded in `LEAN_BASELINE.json`.
49
+
50
+ For the standard package this is equivalent to:
51
+
52
+ ```text
53
+ npx --yes @mriekki/lean@<installed-version> check
54
+ ```
55
+
56
+ Use the package identity recorded by the baseline rather than silently substituting another package.
57
+
58
+ 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.
59
+
60
+ Also inspect Git state. Preserve unrelated consumer work; never auto-stash, reset, clean, rebase, force-update, or discard it.
61
+
62
+ ## 3. Resolve one exact target package
63
+
64
+ If the human supplied an exact version, use that exact version after confirming it exists.
65
+
66
+ 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:
67
+
68
+ ```text
69
+ npm view @mriekki/lean@latest version --json
70
+ npm view @mriekki/lean@<resolved-version> dist.integrity --json
71
+ ```
72
+
73
+ 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.
74
+
75
+ 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.
76
+
77
+ 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.
78
+
79
+ ## 4. Preview the whole-profile update
80
+
81
+ Run the target package's update command without `--apply` and inspect the complete plan. For the standard package:
82
+
83
+ ```text
84
+ npx --yes @mriekki/lean@<target-version> update
85
+ ```
86
+
87
+ 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.
88
+
89
+ The preview must cover every component in the installed profile together. A managed conflict/drift in any component blocks the whole update.
90
+
91
+ Stop on unsafe states such as:
92
+
93
+ - `LOCAL_DRIFT`;
94
+ - `CONFLICT`;
95
+ - `LOCAL_MISSING`;
96
+ - `UNTRACKED_CONFLICT`;
97
+ - path collisions/conflicts;
98
+ - unaccepted Core `RETIRED_PATH`.
99
+
100
+ 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.
101
+
102
+ ## 5. Present one bounded update choice
103
+
104
+ When the exact target package plan is safe, present:
105
+
106
+ ```text
107
+ LEAN UPDATE READY
108
+
109
+ Installed: <package>@<installed-version>
110
+ Target: <package>@<target-version>
111
+ Profile: <profile>
112
+ Core: <old> → <new>
113
+ Deployment: <old> → <new> / unchanged
114
+ Managed drift/conflicts: NONE
115
+
116
+ 1. Apply the exact Lean package update [GIT + FILE WRITE] — recommended
117
+ 2. Keep inspecting only [READ ONLY]
118
+ 3. Stop [NO ACTION]
119
+ ```
120
+
121
+ Choosing option 1 authorizes only:
122
+
123
+ - creation/switch to one repository-appropriate short-lived update branch when needed;
124
+ - exact target package apply;
125
+ - package/baseline verification;
126
+ - inspection of the resulting meaningful diff.
127
+
128
+ It does not authorize `/deliver`, merge, npm/Core/Deployment release publication, or deployment.
129
+
130
+ ## 6. Apply only the exact previewed package
131
+
132
+ If the consumer is on its default branch, create/switch to a short-lived branch such as:
133
+
134
+ ```text
135
+ chore/update-lean-<target-version>
136
+ ```
137
+
138
+ Branch setup is routine inside the selected bounded update action when safe and unambiguous.
139
+
140
+ Apply using the same exact package version that was previewed, for example:
141
+
142
+ ```text
143
+ npx --yes @mriekki/lean@<target-version> update --apply
144
+ ```
145
+
146
+ 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.
147
+
148
+ Do not run direct `tools/package/sync.py`, Deployment Kit sync, or a remote `[sync-core]` request as part of a package-managed update.
149
+
150
+ ## 7. Verify all baselines and the diff
151
+
152
+ After apply, run the exact target package check:
153
+
154
+ ```text
155
+ npx --yes @mriekki/lean@<target-version> check
156
+ ```
157
+
158
+ Then inspect:
159
+
160
+ ```text
161
+ git status --short --branch
162
+ git diff --stat
163
+ git diff -- LEAN_BASELINE.json CORE_BASELINE.json DEPLOYMENT_BASELINE.json
164
+ ```
165
+
166
+ Confirm:
167
+
168
+ - `LEAN_BASELINE.json` records the exact target package/version/profile;
169
+ - component baseline commits/distributions match the umbrella baseline;
170
+ - package check passes for the whole profile;
171
+ - consumer-owned content was not overwritten;
172
+ - only intended package-managed changes and reviewed ownership transfers occurred.
173
+
174
+ Present the meaningful diff for human review. After acceptance, recommend `/deliver` for normal commit/push/PR/CI mechanics.
175
+
176
+ ## 8. Boundaries
177
+
178
+ `/lean-update` never:
179
+
180
+ - updates only Core or only Deployment when `LEAN_BASELINE.json` manages them together;
181
+ - uses a different package version for apply than the reviewed preview;
182
+ - performs a downgrade/rollback as an ordinary update;
183
+ - overwrites unexplained managed drift;
184
+ - auto-accepts Core retired-path ownership transfer;
185
+ - publishes npm/Core/Deployment releases or tags;
186
+ - merges the consumer PR;
187
+ - deploys an environment.
188
+
189
+ 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 to exact baseline sync.
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 the consumer
17
- → diagnose/prove in the consumer
18
- → fix in the owning canonical repository
16
+ discover in consumer
17
+ → diagnose/prove in consumer
18
+ → fix in owning canonical repository
19
19
  → deliver there
20
- → sync the accepted shared commit back into the consumer
21
- → verify again in the consumer
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 the consumer may be useful as diagnosis/proof, but it is never the canonical delivered fix.
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 of the problem to the owning layer;
31
+ - classification to the smallest canonical owner;
32
32
  - inspection of already-available local canonical repository candidates;
33
- - when ownership and the intended patch are clear and a canonical checkout is safe, routine creation/use of one short-lived canonical work branch and application of only the bounded equivalent fix plus its focused tests/docs.
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
- Examples: application domain logic, UI behavior, app-specific configuration, product tests, consumer architecture.
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
- Stop upstream routing and continue through the consumer's normal `/start-work` / implementation / review / `/deliver` flow.
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 changed/problematic path managed by `CORE_BASELINE.json`, or behavior defined by canonical Lean workflow skills/agents/instructions.
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 changed/problematic path managed by `DEPLOYMENT_BASELINE.json`, or reusable deployment behavior owned by the pinned Deployment Kit.
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 generated output is wrong but the managed payload itself is correct, classify the generator/orchestrator rather than patching the generated consumer. Resolve ownership from repository/project evidence; do not guess between Bootstrap and a control plane when evidence is insufficient.
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` and present the competing evidence. Do not write to multiple repositories speculatively.
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 helps prove the fix in the real application context.
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
- Clearly report it as:
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 revert/discard the proof, because it may contain useful evidence. Do not stage/commit it as ordinary consumer implementation. Adoption later replaces the private proof with the accepted shared baseline.
117
+ Do not silently discard the proof and do not stage/commit it as ordinary consumer implementation.
123
118
 
124
- ## 5. Resolve a canonical local checkout
119
+ ## 5. Resolve a safe canonical checkout
125
120
 
126
- For the classified owner, consider local candidates in this order:
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 whose Git remote unambiguously matches the recorded canonical repository;
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. A multi-root maintainer workspace is a convenience, not a requirement.
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
- - it is the expected Git repository;
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 the safe local canonical checkout exists and the equivalent fix is clear:
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
- Preserve consumer specificity. A shared fix must not hard-code the consumer name, target, data, environment, route, or product requirement merely because that consumer exposed the bug.
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 or ask for a narrower canonical design rather than forcing the patch upstream.
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
- After the upstream implementation is ready, report:
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. `/deliver` retains the normal reviewed-diff and merge/finalize gates in exactly one repository.
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
- ## 8. Adopt the accepted fix back into the consumer
194
+ ### Component-only Deployment consumer (`LEAN_BASELINE.json` absent)
178
195
 
179
- After the canonical PR is merged and its accepted default-branch CI is green:
196
+ A Deployment-owned fix may return through the canonical Deployment Kit compatibility sync and refresh `DEPLOYMENT_BASELINE.json`.
180
197
 
181
- - Core-owned fixes return through `/core-sync` using the exact accepted Core commit/distribution;
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
- Then rerun the original consumer reproduction and baseline checks.
200
+ Validate through that platform's canonical regeneration/update path, never by manually editing generated managed files.
186
201
 
187
- A successful consumer retest is evidence that the shared fix works in context; it does not turn the consumer copy into the canonical source.
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- or Deployment-Kit-managed file drift, stop before staging/commit/push. Route reusable managed-file changes through `/upstream-fix` and accepted baseline sync first.
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 change across multiple repositories;
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 shared-managed consumer edit as a legitimate permanent fork.
220
+ - treats a temporary managed consumer edit as a permanent fork;
221
+ - bypasses `LEAN_BASELINE.json` with component-only sync.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mriekki/lean",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Public consumer distribution and updater for Lean engineering assets.",
5
5
  "type": "module",
6
6
  "bin": {