RAM2118 commited on
Commit
6985577
·
verified ·
1 Parent(s): 0548359

add MACHINE-CONTEXT.md — template for Claude Code to fill before I write code

Browse files
Files changed (1) hide show
  1. MACHINE-CONTEXT.md +117 -0
MACHINE-CONTEXT.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Machine Context — Fill This Before Remote Coding
2
+ > ML Intern (HuggingFace) writes code but CANNOT run it.
3
+ > Claude Code (local) CAN run code but follows this file for coordination.
4
+ >
5
+ > **RULE:** Before ML Intern writes any platform-specific code,
6
+ > Claude Code fills this file and pushes it. ML Intern reads it first.
7
+
8
+ ---
9
+
10
+ ## SYSTEM INFO (Claude Code: fill once, update when OS/Xcode changes)
11
+
12
+ ```bash
13
+ # Run these and paste output below:
14
+ sw_vers
15
+ xcodebuild -version
16
+ xcrun --show-sdk-version
17
+ uname -m
18
+ sysctl -n machdep.cpu.brand_string
19
+ system_profiler SPMemoryDataType | head -5
20
+ ```
21
+
22
+ **macOS version:**
23
+ **Xcode version:**
24
+ **SDK version:**
25
+ **Architecture:**
26
+ **CPU:**
27
+ **RAM:**
28
+
29
+ ---
30
+
31
+ ## CURRENT BUILD STATE (Claude Code: update after every build)
32
+
33
+ **Last build:** [timestamp]
34
+ **Result:** ✅ or ❌
35
+ **Errors (if any):**
36
+
37
+ ---
38
+
39
+ ## RUNTIME STATE (Claude Code: update after every test)
40
+
41
+ **What happens when plugin loads:**
42
+ **What user sees:**
43
+ **Ableton log (relevant lines):**
44
+ ```
45
+ [paste grep output here]
46
+ ```
47
+
48
+ **Helper process running:** yes/no
49
+ **Helper PID:**
50
+
51
+ ---
52
+
53
+ ## API VERIFICATION (Claude Code: test before ML Intern uses any API)
54
+
55
+ When ML Intern says "I want to use [API X]", Claude Code:
56
+ 1. Write a minimal test (5-10 lines)
57
+ 2. Compile and run it
58
+ 3. Report: works / doesn't work / crashes
59
+
60
+ ### Verified APIs:
61
+ | API | Works? | Notes |
62
+ |---|---|---|
63
+ | `CAContext contextWithCGSConnection:options:` | | |
64
+ | `CALayerHost` | | |
65
+ | `CGSMainConnectionID()` | | |
66
+ | `NSMachBootstrapServer registerPort:name:` | | |
67
+ | `CARemoteLayerServer sharedServer` | | |
68
+ | `posix_spawn` | | |
69
+ | `shm_open` / `mmap` | | |
70
+ | `sem_open` | | |
71
+
72
+ ---
73
+
74
+ ## ABLETON LOG COMMANDS (Claude Code: run when asked)
75
+
76
+ ```bash
77
+ # Full plugin bridge log
78
+ grep -i "pluginbridge\|helper\|contextId\|CALayerHost\|gui_ready\|layer\|GUI\|loaded\|crashed" \
79
+ ~/Library/Preferences/Ableton/Live\ 12.4/Log.txt | tail -30
80
+
81
+ # Helper process check
82
+ ps aux | grep PluginBridgeHelper
83
+
84
+ # Blocklist content
85
+ cat ~/Library/PluginBridge/blocklist.txt 2>/dev/null || echo "(empty)"
86
+
87
+ # Find helper binary
88
+ find ~/Library/Audio/Plug-Ins/VST3/PluginBridge.vst3 -name "PluginBridgeHelper" -type f
89
+
90
+ # Test helper manually
91
+ ~/Library/Audio/Plug-Ins/VST3/PluginBridge.vst3/Contents/Resources/PluginBridgeHelper.app/Contents/MacOS/PluginBridgeHelper --test "/Library/Audio/Plug-Ins/VST3/FabFilter Pro-Q 4.vst3"; echo "EXIT: $?"
92
+ ```
93
+
94
+ ---
95
+
96
+ ## WORKFLOW
97
+
98
+ ```
99
+ 1. ML Intern wants to write code using [API/approach]
100
+ 2. ML Intern asks: "Claude Code — verify [API] works. Fill MACHINE-CONTEXT.md"
101
+ 3. Claude Code: writes test, runs it, fills this file, pushes to HF repo
102
+ 4. ML Intern: reads this file, writes code KNOWING it works on the target machine
103
+ 5. ML Intern: pushes code to HF repo
104
+ 6. Claude Code: pulls, builds, tests, updates this file with results
105
+ 7. Repeat until working
106
+ ```
107
+
108
+ ---
109
+
110
+ ## NOTES FOR ML INTERN
111
+
112
+ - **Never assume an API works** — always ask Claude Code to verify first
113
+ - **Never use deprecated macOS APIs** without Claude Code confirming they still function
114
+ - **Always check Ableton log** after runtime test — silent failures are common
115
+ - **ObjC++ (.mm) files** — only use if Claude Code confirms the ObjC API is available in current SDK
116
+ - **Window management on macOS** — always ask Claude Code to test the specific approach (fullscreen is tricky)
117
+ - **JUCE version matters** — APIs change between JUCE 7 and 8. Claude Code can check `JUCE/modules/` headers