@mriekki/lean 0.1.0 → 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.
Files changed (41) hide show
  1. package/README.md +71 -67
  2. package/assets/components.json +33 -33
  3. package/assets/core/distribution.json +52 -51
  4. package/assets/deployment/distribution.json +34 -34
  5. package/assets/generated/ASSEMBLY.json +38 -33
  6. package/assets/generated/core/core/skills/core-sync/SKILL.md +78 -120
  7. package/assets/generated/core/core/skills/deploy/SKILL.md +74 -91
  8. package/assets/generated/core/core/skills/lean-update/SKILL.md +189 -0
  9. package/assets/generated/core/core/skills/upstream-fix/SKILL.md +91 -76
  10. package/assets/generated/deployment/distribution/lean-poc-deploy.py +8 -8
  11. package/assets/generated/deployment/src/lean_poc_deployment/__init__.py +3 -3
  12. package/assets/generated/deployment/src/lean_poc_deployment/__main__.py +3 -3
  13. package/assets/generated/deployment/src/lean_poc_deployment/app_cli.py +140 -140
  14. package/assets/generated/deployment/src/lean_poc_deployment/app_runtime.py +455 -455
  15. package/assets/generated/deployment/src/lean_poc_deployment/app_runtime_remote.py +415 -415
  16. package/assets/generated/deployment/src/lean_poc_deployment/box_platform.py +208 -208
  17. package/assets/generated/deployment/src/lean_poc_deployment/box_platform_assets.py +100 -100
  18. package/assets/generated/deployment/src/lean_poc_deployment/box_platform_remote.py +271 -271
  19. package/assets/generated/deployment/src/lean_poc_deployment/cli.py +437 -437
  20. package/assets/generated/deployment/src/lean_poc_deployment/doctor.py +121 -121
  21. package/assets/generated/deployment/src/lean_poc_deployment/entrypoint.py +25 -25
  22. package/assets/generated/deployment/src/lean_poc_deployment/errors.py +5 -5
  23. package/assets/generated/deployment/src/lean_poc_deployment/keys.py +171 -171
  24. package/assets/generated/deployment/src/lean_poc_deployment/profiles.py +204 -204
  25. package/assets/generated/deployment/src/lean_poc_deployment/route_registry.py +367 -367
  26. package/assets/generated/deployment/src/lean_poc_deployment/route_registry_remote.py +443 -443
  27. package/assets/generated/deployment/src/lean_poc_deployment/security.py +290 -290
  28. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_adapter.py +334 -334
  29. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_adapter_remote.py +339 -339
  30. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_cli.py +85 -85
  31. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_import_recovery.py +437 -437
  32. package/assets/generated/deployment/src/lean_poc_deployment/ssh.py +118 -118
  33. package/assets/generated/deployment/src/lean_poc_deployment/teardown.py +286 -286
  34. package/assets/generated/deployment/src/lean_poc_deployment/teardown_cli.py +120 -120
  35. package/assets/generated/deployment/src/lean_poc_deployment/teardown_remote.py +100 -100
  36. package/assets/generated/deployment/src/lean_poc_deployment/trust.py +278 -278
  37. package/bin/lean.mjs +9 -9
  38. package/package.json +33 -33
  39. package/src/cli.mjs +131 -131
  40. package/src/engine.mjs +243 -243
  41. package/src/package-data.mjs +18 -18
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@mriekki/lean",
4
- "version": "0.1.0",
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",
@@ -244,137 +249,137 @@
244
249
  {
245
250
  "source": "distribution/lean-poc-deploy.py",
246
251
  "destination": "tools/lean-deployment/lean-poc-deploy.py",
247
- "sha256": "98e282d4f85999c3a37c47af6805cfa645f7de6e7e2e4a686e4d0012850805df"
252
+ "sha256": "4f300e1de447f6b8ecd57f561bdf000743baaa39051aa359f65d0a051be2e220"
248
253
  },
249
254
  {
250
255
  "source": "src/lean_poc_deployment/__init__.py",
251
256
  "destination": "tools/lean-deployment/lean_poc_deployment/__init__.py",
252
- "sha256": "9f84e6ff170f657459fc461833007f874c6fdd4f6c6d3964ee41d7ec3d0e33d0"
257
+ "sha256": "47695e1cc417117ee5d5e7b85d3301fd0dc99963eacfedbe499f3798d28dee72"
253
258
  },
254
259
  {
255
260
  "source": "src/lean_poc_deployment/__main__.py",
256
261
  "destination": "tools/lean-deployment/lean_poc_deployment/__main__.py",
257
- "sha256": "5791f61aa75f2048bb7ef968f382ca81b7c14520599f0d358113fde33392e7ee"
262
+ "sha256": "8742c1b766812edb07174a724d676ffeff58b71b3c192d35102a3e652e962946"
258
263
  },
259
264
  {
260
265
  "source": "src/lean_poc_deployment/app_cli.py",
261
266
  "destination": "tools/lean-deployment/lean_poc_deployment/app_cli.py",
262
- "sha256": "a70e0471a34a111eecf4c26c49a76273b53dd67351f9c57484bf58a7372baf4a"
267
+ "sha256": "29cf78cd27302341d5fe74877e6b4e211a465bb9991fc720585122f7d4b49190"
263
268
  },
264
269
  {
265
270
  "source": "src/lean_poc_deployment/app_runtime.py",
266
271
  "destination": "tools/lean-deployment/lean_poc_deployment/app_runtime.py",
267
- "sha256": "9cd033b0d483dabf28c9ff4289a0d7621e8e8355704c94221238fa33905b9ae4"
272
+ "sha256": "68c623735fc45b6d20cdfc5c110cfa41a4540f030da479d355b456a1e13a21a3"
268
273
  },
269
274
  {
270
275
  "source": "src/lean_poc_deployment/app_runtime_remote.py",
271
276
  "destination": "tools/lean-deployment/lean_poc_deployment/app_runtime_remote.py",
272
- "sha256": "7433314dedf08a189b7c672897a499367511778bedc0f1080ae6c72bb86f9867"
277
+ "sha256": "f3ccde6ed3c6e5fe185a9a0f032a5c924fa0906e3619e12d0ad6228c1210f8ec"
273
278
  },
274
279
  {
275
280
  "source": "src/lean_poc_deployment/box_platform.py",
276
281
  "destination": "tools/lean-deployment/lean_poc_deployment/box_platform.py",
277
- "sha256": "346f3f61252bc61f052ddc1865d6843a4ca512f6a5f67d80d0e13c7d878863ba"
282
+ "sha256": "163c022bbd8ecccadebbebdc8cef8e272fc95dd0dc3cdb35d4e6e10013c91040"
278
283
  },
279
284
  {
280
285
  "source": "src/lean_poc_deployment/box_platform_assets.py",
281
286
  "destination": "tools/lean-deployment/lean_poc_deployment/box_platform_assets.py",
282
- "sha256": "c2787fc800afec76183fbcb0bb27e96b016ea65b6a5fec62595eb68b01b90561"
287
+ "sha256": "07ef27a63ebff9fb2a810d0c40dd601e14f767c6f8faaedcedd54bb3b79ffef4"
283
288
  },
284
289
  {
285
290
  "source": "src/lean_poc_deployment/box_platform_remote.py",
286
291
  "destination": "tools/lean-deployment/lean_poc_deployment/box_platform_remote.py",
287
- "sha256": "1e5094c48ada1b92e19e94d2ad8140de54645da3ab32d3ae2a09478f459d2e7d"
292
+ "sha256": "1702614cada6f0829abe1d412d8a90f7452c96db2f2693631d20cdb08de29aaa"
288
293
  },
289
294
  {
290
295
  "source": "src/lean_poc_deployment/cli.py",
291
296
  "destination": "tools/lean-deployment/lean_poc_deployment/cli.py",
292
- "sha256": "d6da84777cdae2e55dd636adc3e90fc8cbc777a29dd5df85a936c1cbb2cf3f05"
297
+ "sha256": "a30230969a27ec0df67f311694c13c91520f11104ceae2906cc9f5f46e6f8b23"
293
298
  },
294
299
  {
295
300
  "source": "src/lean_poc_deployment/doctor.py",
296
301
  "destination": "tools/lean-deployment/lean_poc_deployment/doctor.py",
297
- "sha256": "1b86ee7df00b5e10c3859bc227562d14a954ebbe9f68fea12ff63f290e888926"
302
+ "sha256": "139914e437832fd8c5b8d2d8d6fc0ef8aa004862fde45989547e572c461f299d"
298
303
  },
299
304
  {
300
305
  "source": "src/lean_poc_deployment/entrypoint.py",
301
306
  "destination": "tools/lean-deployment/lean_poc_deployment/entrypoint.py",
302
- "sha256": "62112d18f265dea737748e61216c25f9c52a1174e0d4bd69d6afe09fa8097e26"
307
+ "sha256": "08a27a64680f7a72b68c6272f5185c7fdb23678efbda456fd0894272e2e6187e"
303
308
  },
304
309
  {
305
310
  "source": "src/lean_poc_deployment/errors.py",
306
311
  "destination": "tools/lean-deployment/lean_poc_deployment/errors.py",
307
- "sha256": "ecee46ca5746e5225a4cc30aa2cdc57a8746658d9b3ab45f7c9a775e24f9b5b6"
312
+ "sha256": "0bc20b1b739f999960422b7bd05249f4179f3612910ecbb6cf2805b5f4babd61"
308
313
  },
309
314
  {
310
315
  "source": "src/lean_poc_deployment/keys.py",
311
316
  "destination": "tools/lean-deployment/lean_poc_deployment/keys.py",
312
- "sha256": "91777f7c0716d44157320fcbadae1bd2c24d04caa1dce5c15c7fca91af3a2e02"
317
+ "sha256": "5a85bb6941957c45eb3c30ef1f350b669932287b9e2f4a23178260c72009e26c"
313
318
  },
314
319
  {
315
320
  "source": "src/lean_poc_deployment/profiles.py",
316
321
  "destination": "tools/lean-deployment/lean_poc_deployment/profiles.py",
317
- "sha256": "f9d1ae5e0690dc2e4e733153bb5f4427e53636a2c224a5e67c35493702733d7e"
322
+ "sha256": "9d73f86714db5c59a07354348e394647d62a3c31b173c4d3c4c4353872da908a"
318
323
  },
319
324
  {
320
325
  "source": "src/lean_poc_deployment/teardown.py",
321
326
  "destination": "tools/lean-deployment/lean_poc_deployment/teardown.py",
322
- "sha256": "041d93558ed69379429c193c5a058c2aa5ba8991c0a57ce3387b61c65fbd76a0"
327
+ "sha256": "edcf921aa92988176b756abf4bbc9b0b83ae1d855b6e8d487b67aaad7727cb55"
323
328
  },
324
329
  {
325
330
  "source": "src/lean_poc_deployment/teardown_cli.py",
326
331
  "destination": "tools/lean-deployment/lean_poc_deployment/teardown_cli.py",
327
- "sha256": "cae6721ad047822ac77942059bd4da3f34af382002eb284f144d4aae8470f69f"
332
+ "sha256": "ec1271db5f57135189892e87f2df3ffc5fcb6e763ff1eb9604bc4e50788c3325"
328
333
  },
329
334
  {
330
335
  "source": "src/lean_poc_deployment/teardown_remote.py",
331
336
  "destination": "tools/lean-deployment/lean_poc_deployment/teardown_remote.py",
332
- "sha256": "a3f30f66d1d7ad2d54ec9d2e55fe1cd4112f655e51ee0f4d24682ec3ed4cf9dd"
337
+ "sha256": "9745fd9f721eea2da8f5d32688cc6a293e46aa9f9e5c5825c6a08cacb1121fb1"
333
338
  },
334
339
  {
335
340
  "source": "src/lean_poc_deployment/route_registry.py",
336
341
  "destination": "tools/lean-deployment/lean_poc_deployment/route_registry.py",
337
- "sha256": "a3404ce7a4a84f2daa33f30eb09ffe19eaf19c72a44ae8a986d9b5ef0e7fc729"
342
+ "sha256": "8c19da6790fac66d0cb8fe099fb09c026966a6e5952df58bd936ce03a72f1928"
338
343
  },
339
344
  {
340
345
  "source": "src/lean_poc_deployment/route_registry_remote.py",
341
346
  "destination": "tools/lean-deployment/lean_poc_deployment/route_registry_remote.py",
342
- "sha256": "e7254f6949e3e234ed113eccec492976aacbbedaa5ea127ebdcebd9fdf12959b"
347
+ "sha256": "84c37f417ff21f05e7802acef33f4927c878e92f7ae791462eef77281f052bdf"
343
348
  },
344
349
  {
345
350
  "source": "src/lean_poc_deployment/security.py",
346
351
  "destination": "tools/lean-deployment/lean_poc_deployment/security.py",
347
- "sha256": "e18c93066132b176b95d91cd423cd6047648a492c8efc992d6ea2c9f633ad7b3"
352
+ "sha256": "f0946186e384794c81a78fbf50b6afdbbd79a0b22216034778fbb24d523696b6"
348
353
  },
349
354
  {
350
355
  "source": "src/lean_poc_deployment/sqlite_adapter.py",
351
356
  "destination": "tools/lean-deployment/lean_poc_deployment/sqlite_adapter.py",
352
- "sha256": "a9627729b66a50f743b05918da705a10f59efd519b5395c3f4ffdb25f7c54bb0"
357
+ "sha256": "b6f5fd33b776a1fb02d6b6a00fbab0b95827946e5fee51aafef9446fa084f42b"
353
358
  },
354
359
  {
355
360
  "source": "src/lean_poc_deployment/sqlite_adapter_remote.py",
356
361
  "destination": "tools/lean-deployment/lean_poc_deployment/sqlite_adapter_remote.py",
357
- "sha256": "5f24e730d76b357edd11f0bc98a8869fcb132cedde82374f4ae7690bba754b66"
362
+ "sha256": "77feaf6d60632375be4407145741244198f1836eff02e2d8c85f86c8d2c374e2"
358
363
  },
359
364
  {
360
365
  "source": "src/lean_poc_deployment/sqlite_cli.py",
361
366
  "destination": "tools/lean-deployment/lean_poc_deployment/sqlite_cli.py",
362
- "sha256": "83db4958fa84c2c52a5ebea242a0a7beb0222bc4ba8a03c32121ab8e7c9c8212"
367
+ "sha256": "0b68c0cd8c92a7e59071b6f922fe6bbf38d03276387856d1efa743118467bbca"
363
368
  },
364
369
  {
365
370
  "source": "src/lean_poc_deployment/sqlite_import_recovery.py",
366
371
  "destination": "tools/lean-deployment/lean_poc_deployment/sqlite_import_recovery.py",
367
- "sha256": "90524f94f46789786fb5d40fb7c402d54cfc8618f7bc1dd9a94605cabe4fb6fe"
372
+ "sha256": "8bba9aeb1ff2aca5360972a3f66e3dd8e3dc3a6484f5091af201f447454ab4f5"
368
373
  },
369
374
  {
370
375
  "source": "src/lean_poc_deployment/ssh.py",
371
376
  "destination": "tools/lean-deployment/lean_poc_deployment/ssh.py",
372
- "sha256": "42fe2ae7e57695b74b387cec33e413bfb61da46a18a92d6d457f70278e91a4bf"
377
+ "sha256": "9eb568ec75a288b1069e629c67d567d5bb0a7a2074563c70f49057326154f7d2"
373
378
  },
374
379
  {
375
380
  "source": "src/lean_poc_deployment/trust.py",
376
381
  "destination": "tools/lean-deployment/lean_poc_deployment/trust.py",
377
- "sha256": "fdc6ddd7fca6f5ee310d6d50250d5b364fb4a0e92c71b6758e6b7f0045461645"
382
+ "sha256": "b143fa828c3a23df3909dacfd78ae56b9ec1159628eb45261d69c0aa6ddd1a7b"
378
383
  }
379
384
  ]
380
385
  }
@@ -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.