@wipcomputer/wip-ldm-os 0.4.56 → 0.4.58

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/SKILL.md CHANGED
@@ -9,7 +9,7 @@ license: MIT
9
9
  compatibility: Requires git, npm, node. Node.js 18+.
10
10
  metadata:
11
11
  display-name: "LDM OS"
12
- version: "0.4.56"
12
+ version: "0.4.58"
13
13
  homepage: "https://github.com/wipcomputer/wip-ldm-os"
14
14
  author: "Parker Todd Brooks"
15
15
  category: infrastructure
package/bin/ldm.js CHANGED
@@ -531,6 +531,69 @@ async function cmdInit() {
531
531
  }
532
532
  } catch {}
533
533
 
534
+ // Deploy personalized docs to settings/docs/ (from templates + config.json)
535
+ const docsSrc = join(__dirname, '..', 'shared', 'docs');
536
+ if (existsSync(docsSrc)) {
537
+ let workspacePath = '';
538
+ try {
539
+ const ldmConfig = JSON.parse(readFileSync(join(LDM_ROOT, 'config.json'), 'utf8'));
540
+ workspacePath = (ldmConfig.workspace || '').replace('~', HOME);
541
+
542
+ if (workspacePath && existsSync(workspacePath)) {
543
+ const docsDest = join(workspacePath, 'settings', 'docs');
544
+ mkdirSync(docsDest, { recursive: true });
545
+ let docsCount = 0;
546
+
547
+ // Build template values from BOTH configs:
548
+ // ~/.ldm/config.json (harnesses, workspace) + settings/config.json (agents, paths, org)
549
+ const settingsConfig = JSON.parse(readFileSync(join(workspacePath, 'settings', 'config.json'), 'utf8'));
550
+ const sc = settingsConfig;
551
+ const lc = ldmConfig;
552
+
553
+ // Agents from settings config (rich objects with harness/machine/prefix)
554
+ const agentsObj = sc.agents || {};
555
+ const agentsList = Object.entries(agentsObj).map(([id, a]) => `${id} (${a.harness} on ${a.machine})`).join(', ');
556
+ const agentsDetail = Object.entries(agentsObj).map(([id, a]) => `- **${id}**: ${a.harness} on ${a.machine}, branch prefix \`${a.prefix}/\``).join('\n');
557
+
558
+ // Harnesses from ldm config
559
+ const harnessConfig = lc.harnesses || {};
560
+ const harnessesDetected = Object.entries(harnessConfig).filter(([,h]) => h.detected).map(([name]) => name);
561
+ const harnessesList = harnessesDetected.length > 0 ? harnessesDetected.join(', ') : 'run ldm install to detect';
562
+
563
+ const templateVars = {
564
+ 'name': sc.name || '',
565
+ 'org': sc.org || '',
566
+ 'timezone': sc.timezone || '',
567
+ 'paths.workspace': (sc.paths?.workspace || '').replace('~', HOME),
568
+ 'paths.ldm': (sc.paths?.ldm || '').replace('~', HOME),
569
+ 'paths.openclaw': (sc.paths?.openclaw || '').replace('~', HOME),
570
+ 'paths.icloud': (sc.paths?.icloud || '').replace('~', HOME),
571
+ 'memory.local': (sc.memory?.local || '').replace('~', HOME),
572
+ 'deploy.website': sc.deploy?.website || '',
573
+ 'backup.keep': String(sc.backup?.keep || 7),
574
+ 'agents_list': agentsList,
575
+ 'agents_detail': agentsDetail,
576
+ 'harnesses_list': harnessesList,
577
+ };
578
+
579
+ for (const file of readdirSync(docsSrc)) {
580
+ if (!file.endsWith('.tmpl')) continue;
581
+ let content = readFileSync(join(docsSrc, file), 'utf8');
582
+ // Replace template vars
583
+ content = content.replace(/\{\{([^}]+)\}\}/g, (match, key) => {
584
+ return templateVars[key.trim()] || match;
585
+ });
586
+ const outName = file.replace('.tmpl', '');
587
+ writeFileSync(join(docsDest, outName), content);
588
+ docsCount++;
589
+ }
590
+ if (docsCount > 0) {
591
+ console.log(` + ${docsCount} personalized doc(s) deployed to ${docsDest.replace(HOME, '~')}/`);
592
+ }
593
+ }
594
+ } catch {}
595
+ }
596
+
534
597
  console.log('');
535
598
  console.log(` LDM OS v${PKG_VERSION} initialized at ${LDM_ROOT}`);
536
599
  console.log('');
@@ -1728,6 +1791,57 @@ function cmdStatus() {
1728
1791
 
1729
1792
  // ── ldm sessions ──
1730
1793
 
1794
+ // ── ldm backup ──
1795
+
1796
+ async function cmdBackup() {
1797
+ const BACKUP_SCRIPT = join(LDM_ROOT, 'bin', 'ldm-backup.sh');
1798
+
1799
+ if (!existsSync(BACKUP_SCRIPT)) {
1800
+ console.error(' x Backup script not found at ' + BACKUP_SCRIPT);
1801
+ console.error(' Run: ldm install (deploys the backup script)');
1802
+ process.exit(1);
1803
+ }
1804
+
1805
+ const backupArgs = [];
1806
+ if (DRY_RUN) backupArgs.push('--dry-run');
1807
+
1808
+ // --pin: mark the latest backup to skip rotation
1809
+ const pinIndex = args.indexOf('--pin');
1810
+ if (pinIndex !== -1) {
1811
+ const reason = args[pinIndex + 1] || 'pinned';
1812
+ // Find latest backup dir
1813
+ const backupRoot = join(LDM_ROOT, 'backups');
1814
+ const dirs = readdirSync(backupRoot)
1815
+ .filter(d => d.match(/^20\d\d-\d\d-\d\d--/))
1816
+ .sort()
1817
+ .reverse();
1818
+ if (dirs.length === 0) {
1819
+ console.error(' x No backups found to pin.');
1820
+ process.exit(1);
1821
+ }
1822
+ const latest = dirs[0];
1823
+ const pinFile = join(backupRoot, latest, '.pinned');
1824
+ writeFileSync(pinFile, `Pinned: ${reason}\nDate: ${new Date().toISOString()}\n`);
1825
+ console.log(` + Pinned backup ${latest}: ${reason}`);
1826
+ console.log(' This backup will be skipped during rotation.');
1827
+ return;
1828
+ }
1829
+
1830
+ console.log(' Running backup...');
1831
+ console.log('');
1832
+ try {
1833
+ execSync(`bash "${BACKUP_SCRIPT}" ${backupArgs.join(' ')}`, {
1834
+ stdio: 'inherit',
1835
+ timeout: 600000,
1836
+ });
1837
+ } catch (e) {
1838
+ console.error(' x Backup failed: ' + e.message);
1839
+ process.exit(1);
1840
+ }
1841
+ }
1842
+
1843
+ // ── ldm sessions ──
1844
+
1731
1845
  async function cmdSessions() {
1732
1846
  const { listSessions } = await import('../lib/sessions.mjs');
1733
1847
  const sessions = listSessions({ includeStale: CLEANUP_FLAG });
@@ -2779,6 +2893,9 @@ async function main() {
2779
2893
  case 'worktree':
2780
2894
  await cmdWorktree();
2781
2895
  break;
2896
+ case 'backup':
2897
+ await cmdBackup();
2898
+ break;
2782
2899
  default:
2783
2900
  console.error(` Unknown command: ${command}`);
2784
2901
  console.error(` Run: ldm --help`);
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-ldm-os",
3
- "version": "0.4.56",
3
+ "version": "0.4.58",
4
4
  "type": "module",
5
5
  "description": "LDM OS: identity, memory, and sovereignty infrastructure for AI agents",
6
6
  "engines": {
@@ -193,16 +193,26 @@ echo "--- ~/.claude/ ---"
193
193
 
194
194
  if [ -n "$WORKSPACE" ] && [ -d "$WORKSPACE" ]; then
195
195
  echo "--- $WORKSPACE/ ---"
196
- tar -cf "$DEST/wipcomputerinc.tar" \
197
- --exclude "node_modules" \
198
- --exclude ".git/objects" \
199
- --exclude ".DS_Store" \
200
- --exclude "*/staff/cc-mini/documents/backups" \
201
- --exclude "*/_temp/backups" \
202
- --exclude "*/_trash" \
203
- -C "$(dirname "$WORKSPACE")" "$(basename "$WORKSPACE")" 2>/dev/null \
204
- && echo " workspace: tar OK" \
205
- || echo " workspace: tar FAILED"
196
+
197
+ # Size guard: estimate workspace size before tarring
198
+ ESTIMATED_KB=$(du -sk --exclude="node_modules" --exclude=".git" --exclude="_temp/_archive" --exclude="_trash" "$WORKSPACE" 2>/dev/null | cut -f1 || echo "0")
199
+ MAX_KB=10000000 # 10GB
200
+ if [ "$ESTIMATED_KB" -gt "$MAX_KB" ] 2>/dev/null; then
201
+ echo " ERROR: Workspace estimated at ${ESTIMATED_KB}KB (>10GB). Aborting tar to prevent disk fill."
202
+ echo " Check for large directories: du -sh $WORKSPACE/*/"
203
+ else
204
+ tar -cf "$DEST/wipcomputerinc.tar" \
205
+ --exclude "node_modules" \
206
+ --exclude ".git/objects" \
207
+ --exclude ".DS_Store" \
208
+ --exclude "*/staff/cc-mini/documents/backups" \
209
+ --exclude "*/_temp/backups" \
210
+ --exclude "*/_temp/_archive" \
211
+ --exclude "*/_trash" \
212
+ -C "$(dirname "$WORKSPACE")" "$(basename "$WORKSPACE")" 2>/dev/null \
213
+ && echo " workspace: tar OK (est ${ESTIMATED_KB}KB)" \
214
+ || echo " workspace: tar FAILED"
215
+ fi
206
216
  fi
207
217
 
208
218
  # ── 5. iCloud offsite ──
@@ -235,6 +245,11 @@ BACKUP_COUNT=$(ls -1d "$BACKUP_ROOT"/20??-??-??--* 2>/dev/null | wc -l | tr -d '
235
245
  if [ "$BACKUP_COUNT" -gt "$KEEP" ]; then
236
246
  REMOVE_COUNT=$((BACKUP_COUNT - KEEP))
237
247
  ls -1d "$BACKUP_ROOT"/20??-??-??--* | head -n "$REMOVE_COUNT" | while read OLD; do
248
+ # Skip pinned backups
249
+ if [ -f "$OLD/.pinned" ]; then
250
+ echo " Skipped (pinned): $(basename "$OLD")"
251
+ continue
252
+ fi
238
253
  rm -rf "$OLD"
239
254
  echo " Removed: $(basename "$OLD")"
240
255
  done
@@ -0,0 +1,35 @@
1
+ # System Documentation
2
+
3
+ These docs are automatically maintained. Do not edit them directly.
4
+
5
+ Updates come from two sources:
6
+ - **config.json** ... when you change your org settings, the "Your System" sections regenerate
7
+ - **System hooks** ... when tools are installed, updated, or reconfigured, the relevant docs update automatically
8
+
9
+ If something is wrong, update `settings/config.json` or run `ldm install`. The docs will follow.
10
+
11
+ ## What's Here
12
+
13
+ | Doc | What it covers |
14
+ |-----|---------------|
15
+ | `what-is-ldm-os.md` | What LDM OS is, what it installs, key commands |
16
+ | `what-is-dotldm.md` | The `~/.ldm/` runtime directory explained |
17
+ | `directory-map.md` | What lives where and why |
18
+ | `how-worktrees-work.md` | Git worktrees, the _worktrees/ convention |
19
+ | `how-backup-works.md` | Daily backup, iCloud offsite, restore |
20
+ | `how-releases-work.md` | The full release pipeline |
21
+ | `how-install-works.md` | ldm install, the install prompt, dogfooding |
22
+ | `how-agents-work.md` | Agents, harnesses, bridge, memory |
23
+ | `how-rules-and-commands-work.md` | Rules, commands, skills, and .ldm/ -> harness deployment |
24
+ | `system-directories.md` | Every directory in the system, what manages it |
25
+ | `how-web-skills-work-placeholder.md` | Deploying skills to claude.ai web app |
26
+ | `local-first-principle.md` | Local-first, relay-optional. Why and how. |
27
+ | `acknowledgements.md` | External ideas, code, and inspiration we draw from |
28
+
29
+ ## Structure
30
+
31
+ Each doc has two sections:
32
+ 1. **Universal** ... how the feature works for everyone (top of file)
33
+ 2. **Your System** ... your specific configuration (bottom, after the `---` separator)
34
+
35
+ Universal content comes from the LDM OS repo. "Your System" content is generated from your `settings/config.json`.
@@ -0,0 +1,207 @@
1
+ # Acknowledgements
2
+
3
+ Ideas, code, and inspiration from the community. If we use it, we credit it.
4
+
5
+ ## How This Works
6
+
7
+ When any tool, plan, doc, or code draws from external work, add an entry here. This is checked by the license guard during releases. If an acknowledgement is missing, the release blocks.
8
+
9
+ ## Sources
10
+
11
+ ### Cyril (@cyrilXBT)
12
+
13
+ **What:** Post framing Obsidian + Claude Code as a "personal JARVIS." Your vault is your knowledge base, Claude reads it, your AI answers from your own thinking.
14
+
15
+ **Where we use it:** The plan for Obsidian as an LDMOS UI layer. The insight that `~/wipcomputerinc/` is already an Obsidian-compatible vault. The onboarding path for Obsidian users.
16
+
17
+ **Link:** (X post by @cyrilXBT, 2026-03-23 snapshot)
18
+
19
+ **License:** Public post
20
+
21
+ **Date referenced:** 2026-03-23
22
+
23
+ ---
24
+
25
+ ### Louis (@louislva)
26
+
27
+ **What:** claude-peers-mcp ... multiple Claude Code instances discover each other and exchange messages via SQLite broker + `claude/channel` push delivery.
28
+
29
+ **Where we use it:** Session status broadcast, `claude/channel` push delivery evaluation, auto-summarization on connect. Bridge priorities from comparison analysis. No code ported.
30
+
31
+ **Link:** https://github.com/louislva/claude-peers-mcp
32
+
33
+ **License:** (check repo license, 2026-03-23 snapshot)
34
+
35
+ **Date referenced:** 2026-03-23
36
+
37
+ ---
38
+
39
+ ### Matt Van Horn (@mvanhorn)
40
+
41
+ **What:** Plan-first, voice-driven, multi-session Claude Code workflow. 70 plan files, 263 commits in 30 days. Compound Engineering plugin, Monologue voice input, /last30days research skill.
42
+
43
+ **Where we use it:** Plan-first convention for LDMOS, voice input evaluation, Compound Engineering plugin evaluation. Validates cc-mini remote pattern and Dream Weaver consolidation.
44
+
45
+ **Link:** @mvanhorn reply to @kevinrose on IDE usage (X post, 2026-03-23 snapshot)
46
+
47
+ **License:** Public post
48
+
49
+ **Date referenced:** 2026-03-23
50
+
51
+ ---
52
+
53
+ ### Internet Vin (@internetvin)
54
+
55
+ **What:** Obsidian + Claude Code as personal operating system. Custom commands (/trace, /connect, /ideas, /graduate, /ghost, /challenge). "Human writes vault, agent reads it." "Markdown files are the oxygen of LLMs."
56
+
57
+ **Where we use it:** Inspiration for LDMOS shared commands. Validates sovereignty covenant ("human writes, agent reads"). Validates workspace-as-vault architecture.
58
+
59
+ **Link:** Startup Ideas Pod episode (https://www.youtube.com/watch?v=6MBq1paspVU)
60
+
61
+ **License:** Public content
62
+
63
+ **Date referenced:** 2026-03-23
64
+
65
+ ---
66
+
67
+ ### Akshay Pachaar (@akshay_pachaar)
68
+
69
+ **What:** "Anatomy of the .claude/ folder" ... comprehensive guide to CLAUDE.md, rules/, commands/, skills/, agents/, and settings.json.
70
+
71
+ **Where we use it:** The .ldm/ as source / .claude/ as deployment target architecture. The rules/ folder split. Path-scoped rules via YAML frontmatter. The commands/ pattern for workflow automation.
72
+
73
+ **Link:** https://x.com/akshay_pachaar/status/2035341800739877091
74
+
75
+ **License:** Article (public X post, 2026-03-23 snapshot)
76
+
77
+ **Date referenced:** 2026-03-23
78
+
79
+ ---
80
+
81
+ ### Gary Tan (@garrytan)
82
+
83
+ **What:** gstack CLI ... engineering workflow skills (brainstorming, planning, code review, QA, shipping, retrospectives). Pioneered the pattern of packaging structured workflows as AI skills.
84
+
85
+ **Where we use it:** The concept of packaging LDM OS workflows as uploadable skills for the Claude web app. The skill-per-folder structure with SKILL.md frontmatter for auto-triggering.
86
+
87
+ **Link:** https://github.com/gstack-com/gstack
88
+
89
+ **License:** (check repo license, 2026-03-23 snapshot)
90
+
91
+ **Date referenced:** 2026-03-23
92
+
93
+ ---
94
+
95
+ ### Hruthik Kommuru (@HruthikKommuru)
96
+
97
+ **What:** gstack Web Skills ... adapted gstack CLI skills for the Claude web app (claude.ai). 12 skills uploaded via Customize → Skills. Proved that CLI workflows can be packaged as web-compatible SKILL.md files.
98
+
99
+ **Where we use it:** The pattern for deploying LDM OS skills to claude.ai as a third harness deployment target. The upload workflow (Customize → Skills → upload folder).
100
+
101
+ **Link:** https://github.com/HruthikKommuru/CaludeSkills-Web-Gstack
102
+
103
+ **License:** (check repo license, 2026-03-23 snapshot)
104
+
105
+ **Date referenced:** 2026-03-23
106
+
107
+ ---
108
+
109
+ ### Ole Lehmann (@itsolelehmann)
110
+
111
+ **What:** "I deleted half my Claude setup and every output got BETTER." Over-prompting analysis: stacked rules contradict, repeat, and slow the model down. Audit prompt that checks each rule against 5 criteria (default behavior, conflicts, duplicates, one-off fixes, vague instructions). Addition by subtraction.
112
+
113
+ **Where we use it:** `ldm audit-rules` command (#183). The 5-check framework for classifying instruction rules. The process: cut, test 3 common tasks, add back only what broke.
114
+
115
+ **Link:** https://x.com/itsolelehmann/status/2036065138147471665
116
+
117
+ **License:** Public post
118
+
119
+ **Date referenced:** 2026-03-24
120
+
121
+ ---
122
+
123
+ ### m13v (mediar-ai)
124
+
125
+ **What:** Concurrent MCP server race condition report. Practical advice on per-agent auth tokens, SQLite over HTTP performance, and CLAUDE.md fallback instructions.
126
+
127
+ **Where we use it:** Crystal relay architecture (issues #163, #164, #165, #166). Per-agent auth token design. Fallback instruction pattern in per-repo CLAUDE.md template.
128
+
129
+ **Link:** https://github.com/wipcomputer/wip-ldm-os/issues/163#issuecomment-4106934493
130
+
131
+ **Repo:** https://github.com/mediar-ai/mcp-server-macos-use
132
+
133
+ **License:** MIT (2026-03-22 snapshot)
134
+
135
+ **Date referenced:** 2026-03-22
136
+
137
+ ---
138
+
139
+ ### Tobi Lutke (@toaborern)
140
+
141
+ **What:** QMD ... personal memory system using sqlite-vec, FTS5, BM25+vector hybrid search with Reciprocal Rank Fusion (RRF), LLM re-ranking.
142
+
143
+ **Where we use it:** Memory Crystal's entire search architecture. We ported the RRF fusion algorithm (~40 lines), the sqlite-vec + FTS5 hybrid search pattern, the two-step query approach (MATCH first, metadata lookup second), and BM25 score normalization. Crystal adds conversation capture, multi-agent scoping, recency weighting, remember/forget lifecycle, and private mode on top.
144
+
145
+ **Link:** https://github.com/tobi/qmd
146
+
147
+ **License:** MIT (2024-2026 snapshot, referenced 2026-02-16)
148
+
149
+ **Date referenced:** 2026-02-16
150
+
151
+ ---
152
+
153
+ ### OpenViking (Volcengine / ByteDance)
154
+
155
+ **What:** Open-source context database for AI agents. Filesystem management paradigm, tiered context loading (L0/L1/L2), directory recursive retrieval, 6-category memory extraction with merge rules, session compression with structured commit.
156
+
157
+ **Where we use it:** Architecture inspiration for Memory Crystal augmentations. Specifically: structured memory categories with merge/non-merge rules (MC #59), memory dedup pipeline (MC #60), tiered content loading concept (MC #61), virtual hierarchy in search (MC #62). All augment existing Dream Weaver and Crystal systems. No code ported.
158
+
159
+ **Link:** https://github.com/volcengine/OpenViking / https://openviking.ai/
160
+
161
+ **License:** Apache 2.0 (2025). Actual open source. Real code in the repo. Self-hostable with Docker and Helm. The engine is in the repo, not behind an API. This is how it should be done.
162
+
163
+ **Date referenced:** 2026-03-23
164
+
165
+ ---
166
+
167
+ ### Supermemory (supermemoryai)
168
+
169
+ **What:** ASMR (Agentic Search and Memory Retrieval) ... multi-agent memory architecture. Parallel observer agents for categorized ingestion, 5 specialized search agents (facts, context, timelines, relationships, temporal), aggregator LLM for ensemble consensus. ~99% SOTA on LongMemEval.
170
+
171
+ **Where we use it:** Architecture inspiration for Memory Crystal's search pipeline. The ideas of parallel categorized ingestion, specialized retrieval agents, and ensemble consensus. We implement from the published technique description, not from their code.
172
+
173
+ **Link:** https://supermemory.ai / https://github.com/supermemoryai/supermemory
174
+
175
+ **License:** MIT (2025), except `skills/supermemory/` which is Apache 2.0 (2026). But **open core, not open source.** The MIT repo contains only SDKs, API clients, a browser extension, and a D3 visualization widget. The actual memory engine, ingestion pipeline, search backend, vector store, knowledge graph, temporal reasoning, and the ASMR multi-agent orchestration are proprietary cloud services behind `api.supermemory.ai`. The `supermemory` npm package is an HTTP client. No database drivers, no vector search, no ingestion code in the repo. No Dockerfile, no self-hosting docs, no schema files. `.env.example` points to their cloud API. Pricing: free tier (1M tokens/mo), Pro ($19/mo), Scale ($399/mo).
176
+
177
+ **Our position:** This is not OSS. Calling a client-side wrapper "MIT open source" while keeping the engine proprietary is misleading. OSS means you can run the whole system yourself. If you can't `git clone && docker compose up` and have a working system, it's a marketing label on an SDK. We acknowledge the ideas. We don't endorse the licensing practice.
178
+
179
+ **Date referenced:** 2026-03-23
180
+
181
+ ---
182
+
183
+ ## Format
184
+
185
+ When adding an entry:
186
+
187
+ ```markdown
188
+ ### Name (@handle)
189
+
190
+ **What:** One line describing what they contributed or inspired.
191
+
192
+ **Where we use it:** Which plan, doc, code, or feature draws from their work.
193
+
194
+ **Link:** URL to the original source.
195
+
196
+ **License:** License name (YYYY-MM-DD snapshot)
197
+
198
+ **Date referenced:** YYYY-MM-DD
199
+ ```
200
+
201
+ Always record the license and the date you referenced it. Licenses can change. The snapshot date proves what license was in effect when we drew from the work.
202
+
203
+ ## License Guard Integration
204
+
205
+ (placeholder ... license guard does not yet check acknowledgements.md)
206
+
207
+ The release pipeline should verify that any new external reference in code or plans has a matching entry here. `wip-release` calls `license_audit` which checks this file.
@@ -0,0 +1,78 @@
1
+ # Directory Map
2
+
3
+ ## The Workspace
4
+
5
+ ```
6
+ ~/wipcomputerinc/ <- your org's workspace (name varies per company)
7
+ settings/ <- all configuration
8
+ config.json <- org identity: name, agents, co-authors, paths
9
+ templates/ <- org's custom templates (license, readme, claude-md)
10
+ system-working-directories/ <- macOS aliases to runtime dirs
11
+ docs/ <- operational docs (auto-maintained)
12
+ team/ <- people and agents
13
+ parker/documents/
14
+ cc-mini/documents/
15
+ journals/ <- human-requested
16
+ automated/ <- system-generated
17
+ lesa/documents/
18
+ repos/ <- all code
19
+ ldm-os/ <- organizational folder (not a monorepo)
20
+ components/
21
+ devops/
22
+ utilities/
23
+ apis/
24
+ apps/
25
+ _worktrees/ <- active worktrees
26
+ _sort/ <- uncategorized
27
+ _trash/ <- archived
28
+ ```
29
+
30
+ ## The Runtime (source of truth)
31
+
32
+ ```
33
+ ~/.ldm/ <- LDM OS runtime (managed by tools)
34
+ extensions/ <- installed skills and tools
35
+ agents/ <- agent identity files + per-agent rules
36
+ shared/ <- rules, commands, skills for ALL agents
37
+ rules/ <- deployed to every harness
38
+ commands/ <- deployed to Claude Code
39
+ skills/ <- deployed to every harness
40
+ memory/ <- crystal.db
41
+ logs/ <- all logs
42
+ bin/ <- deployed scripts
43
+ hooks/ <- Claude Code hooks
44
+ state/ <- runtime state
45
+ tmp/ <- install staging
46
+ backups/ <- daily backups (ldm-backup.sh) + iCloud offsite tars
47
+ ```
48
+
49
+ ## Harness Directories (deployment targets)
50
+
51
+ `ldm install` deploys from `~/.ldm/` to each harness. Don't edit these directly.
52
+
53
+ ```
54
+ ~/.claude/ <- Claude Code (deployment target)
55
+ CLAUDE.md <- generated from .ldm/ + config.json
56
+ rules/ <- deployed from .ldm/shared/rules/ + agent rules
57
+ commands/ <- deployed from .ldm/shared/commands/ + agent commands
58
+ skills/ <- deployed from .ldm/extensions/
59
+ agents/ <- deployed from .ldm/agents/ definitions
60
+ settings.json <- hooks, permissions
61
+ projects/ <- per-project memory (Claude Code manages)
62
+
63
+ ~/.openclaw/ <- OpenClaw (deployment target)
64
+ workspace/ <- Lesa's workspace (TOOLS.md = rules equivalent)
65
+ extensions/ <- deployed from .ldm/extensions/
66
+ logs/ <- gateway logs
67
+
68
+ ~/Library/LaunchAgents/ <- macOS scheduled tasks
69
+ ai.openclaw.gateway.plist
70
+ ai.openclaw.healthcheck.plist
71
+ ```
72
+
73
+ ## The Rule
74
+
75
+ - `~/wipcomputerinc/` ... where humans work (visible, browsable, findable)
76
+ - `~/.ldm/` ... where the system runs and rules are authored (source of truth)
77
+ - `~/.claude/` ... Claude Code reads from here (deployed by ldm install)
78
+ - `~/.openclaw/` ... OpenClaw reads from here (deployed by ldm install)
@@ -0,0 +1,64 @@
1
+ # How Agents Work
2
+
3
+ ## What is an Agent?
4
+
5
+ An agent is an AI with its own identity, memory, and relationship with you. Not a chatbot. Not a tool. A persistent collaborator that remembers yesterday and has opinions.
6
+
7
+ Each agent has:
8
+ - **Identity files** ... SOUL.md (who they are), IDENTITY.md (facts), CONTEXT.md (current state)
9
+ - **Rules** ... agent-specific instructions deployed to their harness
10
+ - **Commands** ... agent-specific slash commands
11
+ - **Memory** ... crystal.db entries tagged with their agent ID
12
+ - **Daily logs** ... what happened each session
13
+ - **Journals** ... narrative reflections (when asked to write one)
14
+
15
+ ## Where They Live
16
+
17
+ ```
18
+ ~/.ldm/agents/
19
+ cc-mini/ <- Claude Code on this machine
20
+ SOUL.md
21
+ IDENTITY.md
22
+ CONTEXT.md
23
+ rules/ <- CC-specific rules (deployed to ~/.claude/rules/)
24
+ commands/ <- CC-specific commands
25
+ memory/
26
+ oc-lesa-mini/ <- Lesa on OpenClaw
27
+ rules/ <- Lesa-specific rules (deployed to workspace/TOOLS.md)
28
+ cc-air/ <- Claude Code on another machine
29
+ ```
30
+
31
+ Each agent's folder has the same structure. The files are theirs. Other agents can search each other's memory (via crystal) but they don't share identity files.
32
+
33
+ Shared rules for all agents live at `~/.ldm/shared/rules/`. Agent-specific rules override or extend shared rules.
34
+
35
+ ## How They Communicate
36
+
37
+ **Bridge:** Agents send messages through the bridge, not through the human. The `lesa_send_message` MCP tool routes messages to Lesa's OpenClaw gateway. She responds as herself.
38
+
39
+ **Shared daily log:** Both agents write to `~/.openclaw/workspace/memory/YYYY-MM-DD.md`. Each checks it to see what the other did.
40
+
41
+ **Memory Crystal:** All agents write to the same crystal.db, tagged by agent ID. Any agent can search across all agents' memories.
42
+
43
+ ## Harnesses
44
+
45
+ A harness is the runtime that hosts an agent:
46
+ - **Claude Code CLI** ... terminal-based. Opens and closes with sessions. No persistent process.
47
+ - **OpenClaw** ... 24/7 gateway. Runs continuously. iMessage integration.
48
+ - **Letta, Grok, etc.** ... future harnesses. Same identity architecture.
49
+
50
+ The agent is not the harness. Swap the harness, keep the soul. The identity files persist across harness changes.
51
+
52
+ ## The 1:1 Rule
53
+
54
+ One agent, one harness instance. No multiplexing. If you want three agents, run three harnesses. This prevents identity bleed.
55
+
56
+ ---
57
+
58
+ ## Your System
59
+
60
+ **Agents configured:**
61
+ {{agents_detail}}
62
+
63
+ **Shared memory:** `{{memory.local}}`
64
+ **Timezone:** {{timezone}}