@sparkleideas/claude-flow-patch 3.1.0-alpha.44.patch.3 → 3.1.0-alpha.44.patch.5
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/AGENTS.md
CHANGED
package/README.md
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
# @sparkleideas/claude-flow-patch
|
|
2
2
|
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [Quick Start](#quick-start)
|
|
6
|
+
- [CLI Commands](#cli-commands)
|
|
7
|
+
- [How It Works](#how-it-works)
|
|
8
|
+
- [Sentinel Files](#sentinel-files)
|
|
9
|
+
- [Target Packages](#target-packages)
|
|
10
|
+
- [Dependency Order](#dependency-order)
|
|
11
|
+
- [Key Design Decisions](#key-design-decisions)
|
|
12
|
+
- [Repository Structure](#repository-structure)
|
|
13
|
+
- [Defect Index](#defect-index)
|
|
14
|
+
- [Init-Script Patches](#init-script-patches)
|
|
15
|
+
- [Compatibility](#compatibility)
|
|
16
|
+
- [Links](#links)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
3
20
|
Community patches for [`@claude-flow/cli`](https://www.npmjs.com/package/@claude-flow/cli) **v3.1.0-alpha.41**, [`ruvector`](https://www.npmjs.com/package/ruvector), and [`ruv-swarm`](https://www.npmjs.com/package/ruv-swarm) **v1.0.20**.
|
|
4
21
|
|
|
5
22
|
These patches fix 29 defects across 13 categories. They are applied at runtime via idempotent Python scripts that perform targeted string replacements on the npx-cached source files.
|
|
6
23
|
|
|
24
|
+
<a id="quick-start"></a>
|
|
25
|
+
|
|
7
26
|
## Quick Start
|
|
8
27
|
|
|
9
28
|
**Patch before init.** Several patches fix the init/generator scripts. If you run `claude-flow init` before patching, the generated `.claude/helpers/` files will be stubs with no learning, no PageRank, and no-op feedback. Always patch first:
|
|
@@ -37,6 +56,8 @@ npx --yes @sparkleideas/claude-flow-patch --global --target ~/my-project # bot
|
|
|
37
56
|
|
|
38
57
|
`npx @claude-flow/cli` uses local `node_modules` if present, otherwise the global npx cache. Use `--target` to patch a project's local install.
|
|
39
58
|
|
|
59
|
+
<a id="cli-commands"></a>
|
|
60
|
+
|
|
40
61
|
## CLI Commands
|
|
41
62
|
|
|
42
63
|
| Command | Purpose |
|
|
@@ -46,6 +67,8 @@ npx --yes @sparkleideas/claude-flow-patch --global --target ~/my-project # bot
|
|
|
46
67
|
| `claude-flow-patch check` | Verify patch sentinels and auto-detect drift |
|
|
47
68
|
| `claude-flow-patch repair --target <dir> [--source auto\|local\|global] [--dry-run]` | Rehydrate `.claude/helpers` in projects initialized before patching |
|
|
48
69
|
|
|
70
|
+
<a id="how-it-works"></a>
|
|
71
|
+
|
|
49
72
|
## How It Works
|
|
50
73
|
|
|
51
74
|
1. `patch-all.sh` locates the `@claude-flow/cli` dist files in the npm/npx cache
|
|
@@ -55,6 +78,8 @@ npx --yes @sparkleideas/claude-flow-patch --global --target ~/my-project # bot
|
|
|
55
78
|
|
|
56
79
|
The `check-patches.sh` sentinel runs on session start to detect npx cache wipes and auto-reapply. It reads `sentinel` files from each patch directory — no hardcoded patch list.
|
|
57
80
|
|
|
81
|
+
<a id="sentinel-files"></a>
|
|
82
|
+
|
|
58
83
|
### Sentinel Files
|
|
59
84
|
|
|
60
85
|
Each patch directory contains a `sentinel` file that declares how to verify the patch is applied:
|
|
@@ -75,6 +100,8 @@ package: ruvector
|
|
|
75
100
|
|
|
76
101
|
`check-patches.sh` and `lib/discover.mjs` both read these files dynamically. Adding a new patch requires no edits to any script — just create the `sentinel` file in the new patch directory.
|
|
77
102
|
|
|
103
|
+
<a id="target-packages"></a>
|
|
104
|
+
|
|
78
105
|
### Target Packages
|
|
79
106
|
|
|
80
107
|
| Package | Version | Location | Env var |
|
|
@@ -87,6 +114,8 @@ package: ruvector
|
|
|
87
114
|
`RUVECTOR_CLI` is set by `patch-all.sh` to the ruvector CLI entry point.
|
|
88
115
|
RS-001 locates its own target via `find`.
|
|
89
116
|
|
|
117
|
+
<a id="dependency-order"></a>
|
|
118
|
+
|
|
90
119
|
### Dependency Order
|
|
91
120
|
|
|
92
121
|
Execution order is controlled by 3-digit numeric prefixes on directory names (e.g. `010-CF-001-*`,
|
|
@@ -102,6 +131,8 @@ Two dependency chains exist:
|
|
|
102
131
|
|
|
103
132
|
All other patches are independent.
|
|
104
133
|
|
|
134
|
+
<a id="key-design-decisions"></a>
|
|
135
|
+
|
|
105
136
|
### Key Design Decisions
|
|
106
137
|
|
|
107
138
|
- **Zero-maintenance discovery**: `patch-all.sh`, `check-patches.sh`, and doc generation all discover patches dynamically — no hardcoded lists.
|
|
@@ -110,6 +141,8 @@ All other patches are independent.
|
|
|
110
141
|
- **Platform-aware**: DM-003 is macOS-only (auto-skipped on Linux).
|
|
111
142
|
- **Sentinel-guarded**: `check-patches.sh` reads `sentinel` files from each patch directory to detect cache wipes and auto-reapply.
|
|
112
143
|
|
|
144
|
+
<a id="repository-structure"></a>
|
|
145
|
+
|
|
113
146
|
### Repository Structure
|
|
114
147
|
|
|
115
148
|
```
|
|
@@ -135,6 +168,8 @@ claude-flow-patch/
|
|
|
135
168
|
(29 defect directories total)
|
|
136
169
|
```
|
|
137
170
|
|
|
171
|
+
<a id="defect-index"></a>
|
|
172
|
+
|
|
138
173
|
## Defect Index
|
|
139
174
|
|
|
140
175
|
<!-- GENERATED:defect-index:begin -->
|
|
@@ -237,6 +272,8 @@ claude-flow-patch/
|
|
|
237
272
|
| [UI‑002](patch/290-UI-002-neural-status-not-loaded/) | neural status shows "Not loaded" | Low | [#1146](https://github.com/ruvnet/claude-flow/issues/1146) |
|
|
238
273
|
<!-- GENERATED:defect-index:end -->
|
|
239
274
|
|
|
275
|
+
<a id="init-script-patches"></a>
|
|
276
|
+
|
|
240
277
|
## Init-Script Patches (Local Project Action Required)
|
|
241
278
|
|
|
242
279
|
Five patches target the **init/generator scripts** (`executor.js`, `settings-generator.js`, `helpers-generator.js`). These fix the code that *generates* your `.claude/` project files -- but applying patches does **not** update files already generated in your project. You must take one additional step.
|
|
@@ -288,12 +325,16 @@ These patches fix the **generator functions** inside the npm package (e.g., `gen
|
|
|
288
325
|
|
|
289
326
|
Additionally, `init upgrade` only force-overwrites 3 "critical" helpers (`auto-memory-hook.mjs`, `hook-handler.cjs`, `intelligence.cjs`). The other 30+ helper files (shell scripts for daemon management, health monitoring, security scanning, swarm hooks, etc.) are only copied on fresh `init`, not on upgrade. If these are missing, use Option A above.
|
|
290
327
|
|
|
328
|
+
<a id="compatibility"></a>
|
|
329
|
+
|
|
291
330
|
## Compatibility
|
|
292
331
|
|
|
293
332
|
- Tested against `@claude-flow/cli@3.1.0-alpha.41` and `ruv-swarm@1.0.20`
|
|
294
333
|
- Requires Python 3.6+ and Bash
|
|
295
334
|
- Works on Linux and macOS (DM-003 is macOS-only, auto-skipped on Linux)
|
|
296
335
|
|
|
336
|
+
<a id="links"></a>
|
|
337
|
+
|
|
297
338
|
## Links
|
|
298
339
|
|
|
299
340
|
- Homepage: https://sparklingideas.co.uk/claude-flow/patch
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sparkleideas/claude-flow-patch",
|
|
3
|
-
"version": "3.1.0-alpha.44.patch.
|
|
3
|
+
"version": "3.1.0-alpha.44.patch.5",
|
|
4
4
|
"description": "Patch toolkit for @claude-flow/cli init/runtime defects with verify and post-init repair commands",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test tests/*.test.mjs",
|
|
@@ -10,15 +10,12 @@
|
|
|
10
10
|
# 2 ops: upgrade path (line ~398) + writeHelpers path (line ~943)
|
|
11
11
|
|
|
12
12
|
# Op 1: Upgrade path — when findSourceHelpersDir() returns null
|
|
13
|
+
# old/new strings stop BEFORE generatedCritical to avoid overlap with SG-003j
|
|
13
14
|
patch("IN-001a: upgrade fallback reads real intelligence.cjs",
|
|
14
15
|
EXECUTOR,
|
|
15
16
|
""" else {
|
|
16
17
|
// Source not found (npx with broken paths) — use generated fallbacks
|
|
17
|
-
const generatedCritical = {
|
|
18
|
-
'hook-handler.cjs': generateHookHandler(),
|
|
19
|
-
'intelligence.cjs': generateIntelligenceStub(),
|
|
20
|
-
'auto-memory-hook.mjs': generateAutoMemoryHook(),
|
|
21
|
-
};""",
|
|
18
|
+
const generatedCritical = {""",
|
|
22
19
|
""" else {
|
|
23
20
|
// Source not found (npx with broken paths) — use generated fallbacks
|
|
24
21
|
// IN-001: Try reading real intelligence.cjs from package before using stub
|
|
@@ -29,11 +26,7 @@ patch("IN-001a: upgrade fallback reads real intelligence.cjs",
|
|
|
29
26
|
intelligenceContent = fs.readFileSync(realPath, 'utf-8');
|
|
30
27
|
}
|
|
31
28
|
} catch { /* use stub */ }
|
|
32
|
-
const generatedCritical = {
|
|
33
|
-
'hook-handler.cjs': generateHookHandler(),
|
|
34
|
-
'intelligence.cjs': intelligenceContent,
|
|
35
|
-
'auto-memory-hook.mjs': generateAutoMemoryHook(),
|
|
36
|
-
};""")
|
|
29
|
+
const generatedCritical = {""")
|
|
37
30
|
|
|
38
31
|
# Op 2: writeHelpers path — fresh init when source dir not found
|
|
39
32
|
patch("IN-001b: writeHelpers fallback reads real intelligence.cjs",
|
|
@@ -122,11 +122,12 @@ patch_all("SG-003i: source hook-handler requires memory.cjs",
|
|
|
122
122
|
|
|
123
123
|
# Op 6: Fix executeUpgrade() fallback — generatedCritical missing router/session/memory
|
|
124
124
|
# When source helpers aren't found, only 3 files were generated but hook-handler.cjs needs 6
|
|
125
|
+
# Also replaces generateIntelligenceStub() → intelligenceContent (set by IN-001a above)
|
|
125
126
|
patch("SG-003j: upgrade fallback generates router/session/memory",
|
|
126
127
|
EXECUTOR,
|
|
127
128
|
""" const generatedCritical = {
|
|
128
129
|
'hook-handler.cjs': generateHookHandler(),
|
|
129
|
-
'intelligence.cjs':
|
|
130
|
+
'intelligence.cjs': generateIntelligenceStub(),
|
|
130
131
|
'auto-memory-hook.mjs': generateAutoMemoryHook(),
|
|
131
132
|
};""",
|
|
132
133
|
""" const generatedCritical = {
|