@wipcomputer/wip-ldm-os 0.4.73-alpha.5 → 0.4.73-alpha.7

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/bin/ldm.js CHANGED
@@ -1321,23 +1321,31 @@ async function cmdInstall() {
1321
1321
 
1322
1322
  // Check if target looks like an npm package (starts with @ or is a plain name without /)
1323
1323
  if (resolvedTarget.startsWith('@') || (!resolvedTarget.includes('/') && !existsSync(resolve(resolvedTarget)))) {
1324
- // Try npm install to temp dir
1324
+ // Try npm pack + tar extract to temp dir
1325
+ // npm install --prefix silently fails for scoped packages in temp directories...
1326
+ // it creates the lock file but doesn't extract files. npm pack is reliable.
1325
1327
  const npmName = resolvedTarget;
1326
1328
  const tempDir = join(LDM_TMP, `npm-${Date.now()}`);
1327
1329
  console.log('');
1328
1330
  console.log(` Installing ${npmName} from npm...`);
1329
1331
  try {
1330
1332
  mkdirSync(tempDir, { recursive: true });
1331
- execSync(`npm install ${npmName} --prefix "${tempDir}"`, { stdio: 'pipe' });
1332
- // Find the installed package in node_modules (strip @tag suffix like @alpha)
1333
- const pkgName = npmName.replace(/@(alpha|beta|latest|next|\d[\d.]*[-\w.]*)$/, '');
1334
- const installed = join(tempDir, 'node_modules', pkgName);
1335
- if (existsSync(installed)) {
1336
- console.log(` + Installed from npm`);
1337
- repoPath = installed;
1333
+ // Use npm pack + tar instead of npm install --prefix
1334
+ const tarball = execSync(`npm pack ${npmName} --pack-destination "${tempDir}" 2>/dev/null`, {
1335
+ encoding: 'utf8', timeout: 60000, cwd: tempDir,
1336
+ }).trim();
1337
+ const tarPath = join(tempDir, tarball);
1338
+ if (existsSync(tarPath)) {
1339
+ execSync(`tar xzf "${tarPath}" -C "${tempDir}"`, { stdio: 'pipe' });
1340
+ const extracted = join(tempDir, 'package');
1341
+ if (existsSync(extracted)) {
1342
+ console.log(` + Installed from npm`);
1343
+ repoPath = extracted;
1344
+ } else {
1345
+ console.error(` x npm pack succeeded but extraction failed`);
1346
+ }
1338
1347
  } else {
1339
- console.error(` x Package installed but not found at expected path`);
1340
- process.exit(1);
1348
+ console.error(` x npm pack failed: tarball not found`);
1341
1349
  }
1342
1350
  } catch (e) {
1343
1351
  // npm failed, fall through to git clone or path resolution
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-ldm-os",
3
- "version": "0.4.73-alpha.5",
3
+ "version": "0.4.73-alpha.7",
4
4
  "type": "module",
5
5
  "description": "LDM OS: identity, memory, and sovereignty infrastructure for AI agents",
6
6
  "engines": {
@@ -16,11 +16,31 @@ Your AI reads the spec, explains what LDM OS is, checks if it's already installe
16
16
  1. **Self-update.** Checks npm for a newer version of itself. Updates first, then re-runs with new code.
17
17
  2. **System scan.** Reads `~/.ldm/extensions/`, `~/.openclaw/extensions/`, Claude Code MCP config, CLI binaries on PATH.
18
18
  3. **Catalog check.** Matches installed extensions against the catalog. Shows what's available, what's behind.
19
- 4. **npm version check.** Checks every installed extension against npm for newer versions.
20
- 5. **Update.** Clones from GitHub, builds if needed, deploys to extensions dirs, registers MCP/hooks/skills.
19
+ 4. **npm version check.** Checks every installed extension against npm for newer versions (uses dist-tags for alpha/beta).
20
+ 5. **Update.** Resolves the install source (see Source Resolution below), deploys to extensions dirs, registers MCP/hooks/skills.
21
21
  6. **Health check.** Verifies CLIs exist, no broken symlinks, no stale configs.
22
22
  7. **Cleanup.** Removes staging dirs, prunes ghost entries from registry.
23
23
 
24
+ ## Release Tracks
25
+
26
+ ```bash
27
+ ldm install # stable (npm @latest)
28
+ ldm install --alpha # alpha track (npm @alpha)
29
+ ldm install --beta # beta track (npm @beta)
30
+ ```
31
+
32
+ Each track overwrites whatever is installed. Alpha, beta, and stable all use the same install path. The flag only changes which npm dist-tag is checked for updates.
33
+
34
+ ## Source Resolution
35
+
36
+ When updating, the installer finds the package in priority order:
37
+
38
+ 1. **npm** (when `--alpha` or `--beta`): downloads from npm dist-tag. Works on any machine.
39
+ 2. **Local private repo** (developer machine): finds the repo at `~/wipcomputerinc/repos/ldm-os/`. Works offline, no npm or internet needed.
40
+ 3. **GitHub clone** (fallback): clones the public repo. Existing behavior.
41
+
42
+ Alpha/beta installs never require `deploy-public`. Merge to private main, `wip-release alpha`, `ldm install --alpha`, done.
43
+
24
44
  ## Dry Run
25
45
 
26
46
  Always preview first:
@@ -1,77 +1,91 @@
1
1
  # How Releases Work
2
2
 
3
- ## The Pipeline
3
+ ## Four Release Tracks
4
4
 
5
- Every release follows these steps. No shortcuts.
5
+ | Track | npm tag | Who | Purpose |
6
+ |-------|---------|-----|---------|
7
+ | **Alpha** | `@alpha` | Developer | Moving fast. Fix, test, iterate. No deploy-public needed. |
8
+ | **Beta** | `@beta` | Testers | Testing the distribution pipeline. npm + installer verified. |
9
+ | **Hotfix** | `@latest` | Everyone | Emergency fix. Goes straight to stable. No deploy-public. |
10
+ | **Stable** | `@latest` | Everyone | Full release. deploy-public syncs the public repo. |
6
11
 
7
- ### 1. Branch and Code
12
+ ## The Alpha Flow (Development)
8
13
 
9
- Create a worktree, make your changes, commit:
10
- ```bash
11
- ldm worktree add my-prefix/feature-name
12
- cd _worktrees/repo--my-prefix--feature-name/
13
- # edit files
14
- git add <files>
15
- git commit -m "description"
16
- ```
17
-
18
- ### 2. Write Release Notes
19
-
20
- Create `RELEASE-NOTES-v{version}.md` (dashes, not dots) in the repo root. Commit it on the branch with the code. It gets reviewed in the PR.
21
-
22
- ### 3. Push and PR
14
+ This is the fast path. Most work happens here.
23
15
 
24
16
  ```bash
25
- git push -u origin my-prefix/feature-name
26
- gh pr create --title "..." --body "..."
27
- gh pr merge --merge --delete-branch
28
- ```
17
+ # 1. Branch and code
18
+ git worktree add .worktrees/repo--my-prefix--feature -b my-prefix/feature
19
+ cd .worktrees/repo--my-prefix--feature/
20
+ # edit, commit
29
21
 
30
- Never squash merge. Always `--merge`.
22
+ # 2. Push, PR, merge
23
+ git push -u origin my-prefix/feature
24
+ gh pr create && gh pr merge --merge
31
25
 
32
- ### 4. Release
26
+ # 3. Alpha release
27
+ cd /path/to/repo && git checkout main && git pull
28
+ wip-release alpha --notes="what changed"
33
29
 
34
- ```bash
35
- cd /path/to/repo # main working tree, not worktree
36
- git checkout main && git pull
37
- wip-release patch # auto-detects the release notes file
30
+ # 4. Install and test
31
+ ldm install --alpha
38
32
  ```
39
33
 
40
- `wip-release` handles: version bump, CHANGELOG.md, SKILL.md version sync, npm publish, GitHub release, website skill publish.
34
+ Done. No deploy-public. No public repo sync. The installer pulls from npm @alpha (or finds the local private repo if offline).
41
35
 
42
- ### 5. Deploy to Public
36
+ **Sub-tool versions:** If you changed a sub-tool's code, bump its `package.json` version in the PR. Same version = same code. `wip-release` warns if files changed without a version bump.
37
+
38
+ ## The Stable Flow (Public Release)
43
39
 
44
40
  ```bash
45
- bash deploy-public.sh /path/to/private-repo org/public-repo
46
- ```
41
+ # 1-3. Same as alpha: branch, PR, merge
47
42
 
48
- Syncs everything except `ai/` to the public repo. Creates matching release with notes.
43
+ # 4. Write release notes on the branch
44
+ # RELEASE-NOTES-v{version}.md in repo root, committed with the code
49
45
 
50
- ### 6. Install (Dogfood)
46
+ # 5. Stable release
47
+ git checkout main && git pull
48
+ wip-release patch # auto-detects release notes
51
49
 
52
- Open a new AI session and paste:
53
- ```
54
- Read https://wip.computer/install/wip-ldm-os.txt
50
+ # 6. Deploy to public
51
+ deploy-public /path/to/private-repo org/public-repo
52
+
53
+ # 7. Dogfood
54
+ ldm install
55
55
  ```
56
56
 
57
- The AI walks through: explain, dry run, install. Never `npm install -g` directly.
57
+ `wip-release` handles: version bump, CHANGELOG.md, SKILL.md sync, npm publish, GitHub release.
58
+
59
+ `deploy-public` syncs everything except `ai/` to the public repo. Creates a matching release.
58
60
 
59
61
  ## Quality Gates
60
62
 
61
- `wip-release` enforces before publishing:
63
+ `wip-release` enforces before publishing (stable only):
62
64
  - Release notes must be a file (not a flag)
63
- - Must reference a GitHub issue
64
65
  - Product docs must be updated
65
- - Technical docs must be updated if source changed
66
66
  - No stale merged branches
67
67
  - Must run from main working tree (not worktree)
68
68
 
69
+ Alpha/beta skip most gates for speed.
70
+
71
+ ## Source Resolution
72
+
73
+ The installer resolves sources in priority order:
74
+
75
+ 1. **npm** (with dist-tag for alpha/beta): works on any machine with internet
76
+ 2. **Local private repo**: works offline on developer machines
77
+ 3. **GitHub clone**: fallback for stable installs and third-party tools
78
+
79
+ ## Version Immutability
80
+
81
+ Same version = same code. Always. If code changed, the version must change. The installer uses version comparison to decide whether to deploy. `wip-release` validates that sub-tools with changed files have bumped versions.
82
+
69
83
  ## Three Separate Steps
70
84
 
71
85
  | Step | What happens | What it means |
72
86
  |------|-------------|---------------|
73
87
  | Merge | PR merged to main | Code lands. Nothing else changes. |
74
- | Deploy | wip-release + deploy-public | Published to npm + GitHub. Not on your machine yet. |
75
- | Install | Run the install prompt | Extensions updated on your machine. |
88
+ | Release | `wip-release alpha/beta/patch` | Published to npm. Available for install. |
89
+ | Install | `ldm install [--alpha/--beta]` | Extensions updated on your machine. |
76
90
 
77
- After Deploy, stop. Don't copy files. Don't npm install. Dogfood the install prompt.
91
+ For stable releases, add a fourth step: `deploy-public` to sync the public GitHub repo.