holistic 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 (66) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/CONTRIBUTING.md +121 -0
  3. package/LICENSE +21 -0
  4. package/README.md +329 -0
  5. package/bin/holistic +17 -0
  6. package/bin/holistic.cmd +23 -0
  7. package/bin/holistic.js +59 -0
  8. package/dist/__tests__/mcp-notification.test.d.ts +5 -0
  9. package/dist/__tests__/mcp-notification.test.d.ts.map +1 -0
  10. package/dist/__tests__/mcp-notification.test.js +255 -0
  11. package/dist/__tests__/mcp-notification.test.js.map +1 -0
  12. package/dist/cli.d.ts +6 -0
  13. package/dist/cli.d.ts.map +1 -0
  14. package/dist/cli.js +637 -0
  15. package/dist/cli.js.map +1 -0
  16. package/dist/core/docs.d.ts +3 -0
  17. package/dist/core/docs.d.ts.map +1 -0
  18. package/dist/core/docs.js +602 -0
  19. package/dist/core/docs.js.map +1 -0
  20. package/dist/core/git-hooks.d.ts +17 -0
  21. package/dist/core/git-hooks.d.ts.map +1 -0
  22. package/dist/core/git-hooks.js +144 -0
  23. package/dist/core/git-hooks.js.map +1 -0
  24. package/dist/core/git.d.ts +12 -0
  25. package/dist/core/git.d.ts.map +1 -0
  26. package/dist/core/git.js +121 -0
  27. package/dist/core/git.js.map +1 -0
  28. package/dist/core/lock.d.ts +2 -0
  29. package/dist/core/lock.d.ts.map +1 -0
  30. package/dist/core/lock.js +40 -0
  31. package/dist/core/lock.js.map +1 -0
  32. package/dist/core/redact.d.ts +3 -0
  33. package/dist/core/redact.d.ts.map +1 -0
  34. package/dist/core/redact.js +13 -0
  35. package/dist/core/redact.js.map +1 -0
  36. package/dist/core/setup.d.ts +35 -0
  37. package/dist/core/setup.d.ts.map +1 -0
  38. package/dist/core/setup.js +654 -0
  39. package/dist/core/setup.js.map +1 -0
  40. package/dist/core/splash.d.ts +9 -0
  41. package/dist/core/splash.d.ts.map +1 -0
  42. package/dist/core/splash.js +35 -0
  43. package/dist/core/splash.js.map +1 -0
  44. package/dist/core/state.d.ts +42 -0
  45. package/dist/core/state.d.ts.map +1 -0
  46. package/dist/core/state.js +744 -0
  47. package/dist/core/state.js.map +1 -0
  48. package/dist/core/sync.d.ts +12 -0
  49. package/dist/core/sync.d.ts.map +1 -0
  50. package/dist/core/sync.js +106 -0
  51. package/dist/core/sync.js.map +1 -0
  52. package/dist/core/types.d.ts +210 -0
  53. package/dist/core/types.d.ts.map +1 -0
  54. package/dist/core/types.js +2 -0
  55. package/dist/core/types.js.map +1 -0
  56. package/dist/daemon.d.ts +7 -0
  57. package/dist/daemon.d.ts.map +1 -0
  58. package/dist/daemon.js +242 -0
  59. package/dist/daemon.js.map +1 -0
  60. package/dist/mcp-server.d.ts +11 -0
  61. package/dist/mcp-server.d.ts.map +1 -0
  62. package/dist/mcp-server.js +266 -0
  63. package/dist/mcp-server.js.map +1 -0
  64. package/docs/handoff-walkthrough.md +119 -0
  65. package/docs/structured-metadata.md +341 -0
  66. package/package.json +67 -0
@@ -0,0 +1,119 @@
1
+ # Cross-Agent Handoff Walkthrough
2
+
3
+ This is a practical example of the workflow Holistic is built for.
4
+
5
+ ## Scenario
6
+
7
+ You start work in one agent, switch tools later, then pick the same project back up from a phone session.
8
+
9
+ Without Holistic, each session starts with a re-brief.
10
+
11
+ With Holistic, the repo carries the memory forward.
12
+
13
+ ## The problem in one diagram
14
+
15
+ ```mermaid
16
+ sequenceDiagram
17
+ participant U as User
18
+ participant C1 as Cowork
19
+ participant R as Repo
20
+ participant A as Antigravity
21
+ participant M as Mobile Codex
22
+
23
+ U->>C1: Start session and fix a bug
24
+ C1->>R: Write checkpoints and handoff state
25
+ U->>A: Open repo later in a different tool
26
+ A->>R: Read HOLISTIC.md, history, regression watch
27
+ A->>U: Recap current state and ask continue/tweak/new
28
+ A->>R: Update progress and handoff
29
+ U->>M: Reopen repo from phone
30
+ M->>R: Read the same repo memory
31
+ M->>U: Continue with shared context
32
+ ```
33
+
34
+ ## Step-by-step
35
+
36
+ ### 1. Session starts in Cowork
37
+
38
+ The agent should read:
39
+
40
+ - `HOLISTIC.md`
41
+ - `.holistic/context/project-history.md`
42
+ - `.holistic/context/regression-watch.md`
43
+
44
+ Then it should recap:
45
+
46
+ - the active objective
47
+ - the latest status
48
+ - what has already been tried
49
+ - what should happen next
50
+
51
+ ### 2. Work happens
52
+
53
+ Mid-session, Holistic should preserve:
54
+
55
+ - the current goal
56
+ - any attempted fixes
57
+ - important assumptions
58
+ - blockers
59
+ - project impact
60
+ - regression risks
61
+
62
+ This matters when a future agent touches the same files but does not share the original context window.
63
+
64
+ ### 3. Session ends
65
+
66
+ At handoff time, the agent should show a summary for review before finalizing it.
67
+
68
+ That handoff should answer:
69
+
70
+ | Question | Example |
71
+ | --- | --- |
72
+ | What changed? | Added resume flow state and daemon setup |
73
+ | Why did it change? | To preserve context across agent switches |
74
+ | What still needs attention? | Test sync behavior from a second device |
75
+ | What must not regress? | Do not lose active goal when a new session starts |
76
+
77
+ ### 4. A different agent picks up later
78
+
79
+ When Antigravity opens the repo, it should not need a fresh brief from scratch.
80
+
81
+ Its first 30 seconds should look like this:
82
+
83
+ 1. read the Holistic entrypoint
84
+ 2. read history and regression memory
85
+ 3. recap the last known state
86
+ 4. ask whether to continue, tweak, or start something new
87
+
88
+ ## What a good recap sounds like
89
+
90
+ > Current objective: finish the sync handoff flow.
91
+ > Latest status: the state branch automation is in place.
92
+ > Already tried: generated restore and sync helpers for Windows, macOS, and Linux.
93
+ > Try next: verify the handoff flow from a second device.
94
+ > Regression watch: do not lose the prior unfinished task when a new session starts.
95
+
96
+ ## What gets better over time
97
+
98
+ Holistic becomes more valuable the more often the project changes hands.
99
+
100
+ That long-term archive helps future agents see:
101
+
102
+ - which fixes were durable
103
+ - which changes created regressions
104
+ - what tradeoffs were already accepted
105
+ - what not to "clean up" without understanding the original reason
106
+
107
+ ## Why this works on mobile too
108
+
109
+ The portable layer is the repo itself.
110
+
111
+ A laptop daemon can improve passive capture on that laptop, but the real continuity comes from:
112
+
113
+ - repo-visible handoff docs
114
+ - long-term project history
115
+ - regression watch memory
116
+ - portable state synced through git
117
+
118
+ That is why Holistic is cross-agent and cross-platform instead of laptop-bound.
119
+
@@ -0,0 +1,341 @@
1
+ # Structured Metadata Guide
2
+
3
+ Holistic v1.1+ supports enhanced structured metadata for impact notes and regression risks. This provides richer context for future agents while maintaining backward compatibility with plain text.
4
+
5
+ ## Overview
6
+
7
+ **Why structured metadata?**
8
+ - **Severity levels** - Quickly identify critical vs. low-priority changes
9
+ - **Area tags** - Filter and search by component (CLI, daemon, docs, etc.)
10
+ - **Outcome tracking** - Know if changes succeeded, partially worked, or failed
11
+ - **Validation checklists** - Concrete steps to verify regression prevention
12
+ - **Session relationships** - Link related work across sessions
13
+
14
+ ## New Types
15
+
16
+ ### Severity
17
+ ```typescript
18
+ type Severity = "critical" | "high" | "medium" | "low" | "info";
19
+ ```
20
+
21
+ ### Outcome Status
22
+ ```typescript
23
+ type OutcomeStatus = "success" | "partial" | "failed" | "ongoing" | "unknown";
24
+ ```
25
+
26
+ ### Area Tags
27
+ ```typescript
28
+ type AreaTag =
29
+ | "cli" // Command-line interface
30
+ | "daemon" // Background daemon/watcher
31
+ | "state-management" // Session and state handling
32
+ | "docs" // Documentation generation
33
+ | "git-integration" // Git snapshot and commit handling
34
+ | "sync" // Cross-device sync functionality
35
+ | "adapters" // Agent-specific adapters
36
+ | "tests" // Test infrastructure
37
+ | "types" // TypeScript type definitions
38
+ | "architecture" // System architecture/design
39
+ | "ux"; // User experience
40
+ ```
41
+
42
+ ## Structured Impact Notes
43
+
44
+ ### Basic Structure
45
+ ```typescript
46
+ interface ImpactNote {
47
+ description: string; // What changed and why it matters
48
+ severity?: Severity; // How important is this change?
49
+ affectedAreas?: AreaTag[]; // Which components were affected?
50
+ outcome?: OutcomeStatus; // Was it successful?
51
+ }
52
+ ```
53
+
54
+ ### Example Usage
55
+
56
+ **Plain text (still supported):**
57
+ ```bash
58
+ holistic checkpoint \
59
+ --impact "Added resume flow state and daemon setup"
60
+ ```
61
+
62
+ **Structured metadata (new):**
63
+ ```typescript
64
+ // In code or via JSON input
65
+ {
66
+ impactsStructured: [
67
+ {
68
+ description: "Added resume flow state and daemon setup",
69
+ severity: "high",
70
+ affectedAreas: ["cli", "state-management", "daemon"],
71
+ outcome: "success"
72
+ }
73
+ ]
74
+ }
75
+ ```
76
+
77
+ **Rendered output:**
78
+ ```markdown
79
+ - Why it mattered:
80
+ - Added resume flow state and daemon setup _[severity: high | areas: cli, state-management, daemon | outcome: success]_
81
+ ```
82
+
83
+ ## Structured Regression Risks
84
+
85
+ ### Basic Structure
86
+ ```typescript
87
+ interface RegressionRisk {
88
+ description: string;
89
+ severity?: Severity;
90
+ affectedAreas?: AreaTag[];
91
+ validationChecklist?: ValidationItem[];
92
+ }
93
+
94
+ interface ValidationItem {
95
+ description: string;
96
+ command?: string;
97
+ expectedOutcome?: string;
98
+ }
99
+ ```
100
+
101
+ ### Example Usage
102
+
103
+ **Plain text (still supported):**
104
+ ```bash
105
+ holistic checkpoint \
106
+ --regression "Do not lose active goal when a new session starts"
107
+ ```
108
+
109
+ **Structured metadata with validation (new):**
110
+ ```typescript
111
+ {
112
+ regressionsStructured: [
113
+ {
114
+ description: "Do not lose active goal when a new session starts",
115
+ severity: "critical",
116
+ affectedAreas: ["state-management", "cli"],
117
+ validationChecklist: [
118
+ {
119
+ description: "Start a session with a goal",
120
+ command: "holistic start-new --goal 'Test goal'",
121
+ expectedOutcome: "Session created with currentGoal set"
122
+ },
123
+ {
124
+ description: "Start another session without ending the first",
125
+ command: "holistic start-new --goal 'Second goal'",
126
+ expectedOutcome: "First session preserved in pendingWork with original goal"
127
+ },
128
+ {
129
+ description: "Resume and verify first goal is still accessible",
130
+ command: "holistic resume --json",
131
+ expectedOutcome: "JSON shows first goal in pendingWork array"
132
+ }
133
+ ]
134
+ }
135
+ ]
136
+ }
137
+ ```
138
+
139
+ **Rendered output:**
140
+ ```markdown
141
+ - Do not regress:
142
+ - Do not lose active goal when a new session starts _[severity: critical | areas: state-management, cli]_
143
+ - Validation checklist:
144
+ - Start a session with a goal
145
+ - Command: `holistic start-new --goal 'Test goal'`
146
+ - Expected: Session created with currentGoal set
147
+ - Start another session without ending the first
148
+ - Command: `holistic start-new --goal 'Second goal'`
149
+ - Expected: First session preserved in pendingWork with original goal
150
+ - Resume and verify first goal is still accessible
151
+ - Command: `holistic resume --json`
152
+ - Expected: JSON shows first goal in pendingWork array
153
+ ```
154
+
155
+ ## Session-Level Metadata
156
+
157
+ You can also add session-level structured metadata:
158
+
159
+ ```typescript
160
+ interface SessionRecord {
161
+ // ... existing fields ...
162
+
163
+ // Session-level metadata
164
+ severity?: Severity; // Overall session importance
165
+ outcomeStatus?: OutcomeStatus; // Did the session achieve its goal?
166
+ affectedAreas?: AreaTag[]; // Which components did this session touch?
167
+ relatedSessions?: string[]; // IDs of related/dependent sessions
168
+ }
169
+ ```
170
+
171
+ ### Example
172
+
173
+ ```typescript
174
+ {
175
+ severity: "high",
176
+ outcomeStatus: "success",
177
+ affectedAreas: ["daemon", "sync", "state-management"],
178
+ relatedSessions: [
179
+ "session-2026-03-19T19-30-32-935Z",
180
+ "session-2026-03-20T00-04-53-218Z"
181
+ ]
182
+ }
183
+ ```
184
+
185
+ **Rendered in project-history.md:**
186
+ ```markdown
187
+ ## Daemon passive capture implementation
188
+
189
+ - Session: session-2026-03-20T14-22-15-442Z
190
+ - Agent: claude
191
+ - Status: handed_off
192
+ - When: 2026-03-20T16:45:30.123Z
193
+ - Severity: high
194
+ - Outcome: success
195
+ - Affected areas: daemon, sync, state-management
196
+ - Related sessions: session-2026-03-19T19-30-32-935Z, session-2026-03-20T00-04-53-218Z
197
+ - Goal: Implement background file watcher for passive capture
198
+ - Summary: ...
199
+ ```
200
+
201
+ ## Backward Compatibility
202
+
203
+ **Important:** The legacy string arrays (`impactNotes`, `regressionRisks`) are maintained for backward compatibility:
204
+
205
+ ```typescript
206
+ interface SessionRecord {
207
+ // Legacy - always populated from CLI string inputs
208
+ impactNotes: string[];
209
+ regressionRisks: string[];
210
+
211
+ // New - optional structured versions
212
+ impactNotesStructured?: ImpactNote[];
213
+ regressionRisksStructured?: RegressionRisk[];
214
+ }
215
+ ```
216
+
217
+ - If only plain text is provided, it goes into the legacy arrays
218
+ - If structured metadata is provided, it uses the new fields
219
+ - The rendering logic prefers structured metadata when available, falls back to plain text
220
+ - Existing sessions with plain text continue to work exactly as before
221
+
222
+ ## CLI Integration (Future)
223
+
224
+ Currently, structured metadata is accessible via TypeScript/JSON. Future CLI enhancements could include:
225
+
226
+ ```bash
227
+ # Add structured impact with inline metadata
228
+ holistic checkpoint \
229
+ --impact-structured "Added daemon watch mode" \
230
+ --impact-severity high \
231
+ --impact-areas daemon,cli \
232
+ --impact-outcome success
233
+
234
+ # Add regression with validation checklist
235
+ holistic checkpoint \
236
+ --regression-structured "Daemon must auto-restart after crash" \
237
+ --regression-severity critical \
238
+ --regression-areas daemon \
239
+ --regression-validate "ps aux | grep holistic-daemon" \
240
+ --regression-validate-expect "One daemon process running"
241
+ ```
242
+
243
+ ## Benefits
244
+
245
+ ### For Agents
246
+ - **Faster context recovery** - Scan by severity and area instead of reading everything
247
+ - **Better decision making** - Know outcome status before attempting similar work
248
+ - **Concrete validation** - Run checklist commands to verify regression prevention
249
+
250
+ ### For Teams
251
+ - **Searchability** - `holistic history --search --areas daemon --severity critical`
252
+ - **Metrics** - Track success rates, identify problematic areas
253
+ - **Documentation** - Validation checklists become living test specs
254
+
255
+ ### For Long-Term Memory
256
+ - **Rich filters** - "Show all critical regressions affecting state-management"
257
+ - **Impact analysis** - "What succeeded vs. what's still ongoing?"
258
+ - **Dependency tracking** - "Which sessions are related to this fix?"
259
+
260
+ ## Migration Strategy
261
+
262
+ You don't need to migrate existing sessions. The system handles both formats:
263
+
264
+ 1. **Leave existing sessions as-is** - They'll continue using plain text rendering
265
+ 2. **Use structured metadata for new critical work** - Especially for:
266
+ - Critical bug fixes that must not regress
267
+ - Complex multi-session features
268
+ - Changes affecting core architecture
269
+ 3. **Add validation checklists** when you fix something another agent might break later
270
+
271
+ ## Example: Real-World Structured Handoff
272
+
273
+ ```typescript
274
+ // Hypothetical handoff for implementing portable state sync
275
+ {
276
+ summary: "Implemented cross-device state sync via dedicated portable state ref",
277
+ severity: "high",
278
+ outcomeStatus: "success",
279
+ affectedAreas: ["sync", "git-integration", "daemon"],
280
+ relatedSessions: ["session-2026-03-19T19-30-32-935Z"], // Original sync planning session
281
+
282
+ impactsStructured: [
283
+ {
284
+ description: "Portable state now syncs through refs/holistic/state",
285
+ severity: "high",
286
+ affectedAreas: ["sync", "git-integration"],
287
+ outcome: "success"
288
+ },
289
+ {
290
+ description: "Restore scripts can now pull remote state on new devices",
291
+ severity: "medium",
292
+ affectedAreas: ["sync", "cli"],
293
+ outcome: "success"
294
+ }
295
+ ],
296
+
297
+ regressionsStructured: [
298
+ {
299
+ description: "Portable state ref must stay isolated from the main working branch history",
300
+ severity: "critical",
301
+ affectedAreas: ["sync", "git-integration"],
302
+ validationChecklist: [
303
+ {
304
+ description: "Verify the remote portable state ref exists",
305
+ command: "git ls-remote origin refs/holistic/state",
306
+ expectedOutcome: "A ref named refs/holistic/state is present on the remote"
307
+ },
308
+ {
309
+ description: "Verify restore script fetches the portable state ref explicitly",
310
+ command: "grep -n 'refs/holistic/state' .holistic/system/restore-state.sh",
311
+ expectedOutcome: "Restore helper references refs/holistic/state directly"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ description: "Sync must handle concurrent updates from multiple devices",
317
+ severity: "high",
318
+ affectedAreas: ["sync", "state-management"],
319
+ validationChecklist: [
320
+ {
321
+ description: "Create handoff on device A",
322
+ command: "holistic handoff && ./.holistic/system/sync-state.sh",
323
+ expectedOutcome: "Portable state ref updated with device A handoff"
324
+ },
325
+ {
326
+ description: "Create different handoff on device B before pulling A",
327
+ command: "holistic handoff",
328
+ expectedOutcome: "Local portable state has device B handoff"
329
+ },
330
+ {
331
+ description: "Pull and verify both handoffs are preserved",
332
+ command: ".holistic/system/restore-state.sh && cat .holistic/state.json",
333
+ expectedOutcome: "Either both handoffs merged or user prompted for conflict resolution"
334
+ }
335
+ ]
336
+ }
337
+ ]
338
+ }
339
+ ```
340
+
341
+ This creates rich, searchable, verifiable project memory that travels with the repo.
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "holistic",
3
+ "version": "0.2.0",
4
+ "private": false,
5
+ "description": "Repo memory, MCP handoffs, and session continuity for AI coding agents",
6
+ "keywords": [
7
+ "ai",
8
+ "ai-agents",
9
+ "coding-assistant",
10
+ "developer-tools",
11
+ "cli",
12
+ "mcp",
13
+ "repo-memory",
14
+ "agent-handoff",
15
+ "session-continuity",
16
+ "context-management",
17
+ "context-preservation",
18
+ "claude",
19
+ "codex",
20
+ "cursor",
21
+ "copilot",
22
+ "gemini",
23
+ "multi-agent"
24
+ ],
25
+ "author": "lweis",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/lweiss01/holistic.git"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/lweiss01/holistic/issues"
33
+ },
34
+ "homepage": "https://github.com/lweiss01/holistic#readme",
35
+ "type": "module",
36
+ "bin": "bin/holistic.js",
37
+ "scripts": {
38
+ "build": "node scripts/build.mjs",
39
+ "clean": "node scripts/clean.mjs",
40
+ "prepublishOnly": "npm run clean && npm run build && npm test",
41
+ "holistic": "node --experimental-strip-types ./src/cli.ts",
42
+ "daemon": "node --experimental-strip-types ./src/daemon.ts",
43
+ "release:check": "node scripts/release-check.mjs",
44
+ "test": "node --experimental-strip-types ./tests/run-tests.ts",
45
+ "test:smoke": "node scripts/smoke-test.mjs"
46
+ },
47
+ "engines": {
48
+ "node": ">=24.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^25.5.0",
52
+ "typescript": "^5.9.3"
53
+ },
54
+ "files": [
55
+ "dist",
56
+ "bin",
57
+ "README.md",
58
+ "CHANGELOG.md",
59
+ "LICENSE",
60
+ "CONTRIBUTING.md",
61
+ "docs/handoff-walkthrough.md",
62
+ "docs/structured-metadata.md"
63
+ ],
64
+ "dependencies": {
65
+ "@modelcontextprotocol/sdk": "^1.27.1"
66
+ }
67
+ }