@@ -131,3 +131,177 @@ If this returns results, something violated the rules.
131131---
132132
133133* This file is the source of truth for AI agent behavior in this workspace.*
134+
135+ ---
136+
137+ ## User QoL (Quality of Life) Considerations on Install
138+
139+ * SAIF-processes/methodology — Structured AI Integration Framework*
140+
141+ When setting up the Wave Toolkit or any SpiralSafe ecosystem repository, follow these installation QoL principles to ensure smooth onboarding and consistent execution across sessions.
142+
143+ ### 1. Absolute References
144+
145+ ** Always use absolute paths** rather than relative paths in scripts and configurations:
146+
147+ ``` powershell
148+ # ✅ Good: Absolute references
149+ $WaveToolkitPath = "$HOME\wave-toolkit"
150+ $ScriptPath = Join-Path $WaveToolkitPath "scripts\system"
151+
152+ # ❌ Bad: Relative paths that break when working directory changes
153+ $ScriptPath = ".\scripts\system"
154+ ```
155+
156+ ** Why it matters:**
157+ - AI agents may execute from different working directories
158+ - Cron jobs and scheduled tasks don't inherit the expected ` $PWD `
159+ - Sub-processes spawned by agents start with unpredictable paths
160+ - Cross-session persistence requires stable path anchors
161+
162+ ** Use these environment-aware patterns:**
163+ ``` powershell
164+ # Repository root detection (PowerShell 7+ ternary, or if-else for 5.1)
165+ $gitRoot = git rev-parse --show-toplevel 2>$null
166+ $RepoRoot = if ($gitRoot) { $gitRoot } else { $PSScriptRoot }
167+
168+ # Cross-platform home directory
169+ $UserHome = if ($IsWindows) { $env:USERPROFILE } else { $env:HOME }
170+
171+ # Canonical Wave Toolkit path
172+ $WaveRoot = Join-Path $UserHome "wave-toolkit"
173+ ```
174+
175+ ### 2. Shell Aliases for Cross-Platform Support
176+
177+ ** Create aliases for native shell platforms** to ensure consistent command availability:
178+
179+ ``` powershell
180+ # PowerShell aliases for Unix-like commands
181+ Set-Alias -Name ll -Value Get-ChildItem -Scope Global
182+ Set-Alias -Name grep -Value Select-String -Scope Global
183+ Set-Alias -Name touch -Value New-Item -Scope Global
184+ Set-Alias -Name which -Value Get-Command -Scope Global
185+
186+ # Export for persistence
187+ Export-ModuleMember -Alias * -Function *
188+ ```
189+
190+ ``` cmd
191+ :: CMD aliases (system_aliases.cmd)
192+ @echo off
193+ doskey ll=dir /a $*
194+ doskey grep=findstr $*
195+ doskey cat=type $*
196+ doskey clear=cls
197+ ```
198+
199+ ** Binding across execution frame 'event horizons':**
200+
201+ When an AI agent spawns processes or hands off to sub-agents, aliases may not persist. To ensure binding:
202+
203+ 1 . ** Profile-level loading** : Add aliases to ` $PROFILE ` for automatic loading
204+ 2 . ** Explicit sourcing** : Source alias files at the start of each session
205+ 3 . ** Function wrappers** : Prefer functions over aliases for complex operations (functions export more reliably)
206+
207+ ``` powershell
208+ # Ensure aliases persist across PowerShell sessions
209+ if (Test-Path "$HOME\wave-toolkit\scripts\system\aliases.ps1") {
210+ . "$HOME\wave-toolkit\scripts\system\aliases.ps1"
211+ }
212+ ```
213+
214+ ### 3. Python Caching for CI/CD Workflows
215+
216+ ** Use ` actions/setup-python@v5 ` with pip caching** to improve install performance in GitHub Actions:
217+
218+ ``` yaml
219+ # .github/workflows/ci.yml
220+ jobs :
221+ build :
222+ runs-on : ubuntu-latest
223+ steps :
224+ - uses : actions/checkout@v4
225+
226+ - name : Set up Python
227+ uses : actions/setup-python@v5
228+ with :
229+ python-version : ' 3.11'
230+ cache : ' pip' # Enable pip dependency caching
231+ cache-dependency-path : ' **/requirements*.txt'
232+
233+ - name : Install dependencies
234+ run : pip install -r requirements.txt
235+ ` ` `
236+
237+ **Why caching matters for QoL:**
238+ - Reduces CI run time by 30-60 seconds per workflow
239+ - Decreases load on package registries (pip, npm, etc.)
240+ - Provides consistent dependency resolution across runs
241+ - Enables faster iteration during development
242+
243+ **For other package managers:**
244+ ` ` ` yaml
245+ # Node.js with npm cache
246+ - uses : actions/setup-node@v4
247+ with :
248+ node-version : ' 20'
249+ cache : ' npm'
250+
251+ # PowerShell module caching (manual)
252+ - name : Cache PowerShell modules
253+ uses : actions/cache@v4
254+ with :
255+ path : ~/.local/share/powershell/Modules
256+ key : ${{ runner.os }}-pwsh-${{ hashFiles('**/requirements.psd1') }}
257+ ` ` `
258+
259+ ### 4. Bootstrap Verification Checklist
260+
261+ When running ` Setup-Wave.ps1` or similar bootstrap scripts, verify:
262+
263+ | Check | Status | Recovery Action |
264+ |-------|--------|-----------------|
265+ | Git available | `git --version` | Install Git for Windows |
266+ | PowerShell 7+ | `$PSVersionTable.PSVersion` | Install pwsh from Microsoft Store |
267+ | Execution policy allows scripts | `Get-ExecutionPolicy` | `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser` |
268+ | Required directories exist | `Test-Path $WaveRoot` | Run bootstrap again |
269+ | Profile is writable | `Test-Path $PROFILE` | Create profile directory |
270+
271+ # ## 5. Event Horizon Boundaries
272+
273+ **"Event horizons"** in this context refer to execution boundaries where context may be lost:
274+
275+ - **New shell session**: Aliases, functions, and variables reset
276+ - **Sub-process spawn**: Child processes don't inherit parent's aliases
277+ - **Agent handoff**: When one AI agent delegates to another
278+ - **Scheduled execution**: Cron/Task Scheduler runs have minimal environment
279+
280+ **Mitigation strategies:**
281+
282+ ` ` ` powershell
283+ # 1. Environment variable persistence
284+ [Environment]::SetEnvironmentVariable("WAVE_ROOT", $WaveRoot, "User")
285+
286+ # 2. Session checkpoint (for agent handoffs)
287+ @{
288+ Timestamp = Get-Date -Format "o"
289+ WaveRoot = $WaveRoot
290+ Branch = git branch --show-current
291+ Aliases = Get-Alias | Select-Object Name, Definition
292+ } | ConvertTo-Json | Out-File ".wave-session.json"
293+
294+ # 3. Reload on session start
295+ if (Test-Path ".wave-session.json") {
296+ $session = Get-Content ".wave-session.json" | ConvertFrom-Json
297+ Write-Host "Resuming Wave session from $($session.Timestamp)"
298+ }
299+ ` ` `
300+
301+ ---
302+
303+ # # Related Documentation
304+
305+ - **[Development Workflow](docs/guides/DEVELOPMENT_WORKFLOW.md)** — Session boundary errors and recovery patterns
306+ - **[Wave Guide](wave.md)** — Philosophy and complete workflow guide
307+ - **[Setup Script](Setup-Wave.ps1)** — One-time bootstrap implementation
0 commit comments