From 30de9e1673fc2e75ea4da433ef84ef1f08463540 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:40:48 +0000 Subject: [PATCH 1/7] Initial plan From f324434cf3cb2b432fc8a617304a499734b47ed2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:43:25 +0000 Subject: [PATCH 2/7] Add comprehensive "What Copilot is Best At" section to copilot-instructions.md Co-authored-by: mikejmorgan-ai <73376634+mikejmorgan-ai@users.noreply.github.com> --- .github/copilot-instructions.md | 93 +++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f409509e9..3aed90964 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -3,6 +3,99 @@ ## Project Overview CX Linux is the AI-native OS layer for the $50B Linux system administration market. Instead of memorizing commands and googling errors, users describe their intent and the AI executes it safely and intelligently. +## What Copilot is Best At Working On + +### 🎯 High-Value Areas for AI Assistance + +GitHub Copilot excels at helping with these CX Terminal components: + +#### 1. **AI Agent Development** ⭐⭐⭐ +- **Why:** Repetitive patterns with agent trait implementations +- **Tasks:** Adding new specialized agents (cloud providers, package managers, system introspection) +- **Pattern:** `impl Agent for NewAgent { async fn execute() { ... } }` +- **Impact:** Each new agent multiplies platform capabilities + +#### 2. **Voice/Audio Pipeline** ⭐⭐⭐ +- **Why:** Complex audio processing with standard patterns +- **Tasks:** Speech transcription, audio buffering, voice command mapping to CLI +- **Components:** `voice/` module with cpal audio capture +- **Pattern:** Async audio stream processing, VAD (Voice Activity Detection) + +#### 3. **Learning/ML Components** ⭐⭐⭐ +- **Why:** Local ML algorithms benefit from vectorization optimization +- **Tasks:** TF-IDF implementation, N-gram pattern extraction, command suggestion ranking +- **Components:** `learning/` module for privacy-preserving ML +- **Pattern:** Statistical learning over command history without external data + +#### 4. **Rendering & UI Logic** ⭐⭐ +- **Why:** Complex layout math and WebGPU shader boilerplate +- **Tasks:** Text painting algorithms, glyph caching, tab bar layouts, WGSL shaders +- **Components:** `render/` and `termwindow/` modules +- **Caution:** Performance-critical; suggest benchmarks + +#### 5. **Lua API Bindings** ⭐⭐⭐ +- **Why:** 13+ lua-api-crates with repetitive FFI patterns +- **Tasks:** Exposing Rust functions to Lua configuration system +- **Pattern:** `#[lua(...)] pub fn method(&self) -> mlua::Result` +- **Impact:** Extensibility without recompilation + +#### 6. **Protocol/IPC Layer** ⭐⭐ +- **Why:** JSON-RPC serialization patterns are mechanical +- **Tasks:** Message types, daemon communication, Unix socket handling +- **Components:** `cx_daemon/` module with 4-byte length-prefixed JSON-RPC +- **Pattern:** Serde serialization with proper error handling + +#### 7. **Test Coverage** ⭐⭐⭐ +- **Why:** Test boilerplate is highly repetitive +- **Tasks:** Unit tests, integration tests, mock implementations, error scenarios +- **Target:** 95%+ coverage on new code +- **Pattern:** Tokio async tests with proper cleanup + +#### 8. **CLI Command Implementation** ⭐⭐ +- **Why:** Clap argument parsing follows predictable patterns +- **Tasks:** Adding new `cx` subcommands with help text and validation +- **Components:** CLI modules for user-facing commands +- **Pattern:** Natural language intent parsing with safety validation + +### ⚠️ Areas Requiring Caution + +Copilot should be more conservative in these areas: + +#### Security-Critical Code ❌ +- Command validation logic in `security/` +- Sandboxing and privilege escalation prevention +- Authentication/authorization flows +- **Approach:** Manual review required; suggest defensive patterns + +#### Core Terminal Emulation 🔶 +- VT/ANSI escape sequence parsing (inherited from WezTerm) +- PTY handling and process management +- **Approach:** These are mature; avoid unnecessary changes + +#### Cryptographic Operations ❌ +- SSH key handling, certificate validation +- Encryption/decryption routines +- **Approach:** Only suggest well-vetted libraries (ring, rustls) + +### 💡 Optimal Copilot Usage Patterns + +**Best practices when using Copilot on this codebase:** + +1. **New Agent Scaffolding:** Copilot can generate entire agent implementations from trait signatures +2. **Lua Binding Boilerplate:** Let Copilot write FFI bindings after you define the Rust signature +3. **Test Generation:** Provide function signature + expected behavior, get comprehensive tests +4. **Error Handling:** Copilot excels at adding `anyhow::Result` error propagation +5. **Async Patterns:** Trust Copilot for Tokio async/await boilerplate +6. **Documentation:** Effective at generating rustdoc comments from function signatures +7. **Refactoring:** Good at mechanical refactors (rename, extract function, update imports) + +**When to ignore Copilot suggestions:** + +- Security-critical validation logic (always manually review) +- Performance-critical hot paths (profile before accepting) +- Architecture decisions (require human judgment) +- Breaking changes to public APIs (consider compatibility) + ## MANDATORY PRIORITIES ### 1. BSL 1.1 License Protection ⚠️ From 81047ba5d96f45c47997059de1e673e714ddfb34 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:45:20 +0000 Subject: [PATCH 3/7] Fix inaccuracies in copilot instructions per code review feedback Co-authored-by: mikejmorgan-ai <73376634+mikejmorgan-ai@users.noreply.github.com> --- .github/copilot-instructions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 3aed90964..76887914d 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -34,7 +34,7 @@ GitHub Copilot excels at helping with these CX Terminal components: - **Caution:** Performance-critical; suggest benchmarks #### 5. **Lua API Bindings** ⭐⭐⭐ -- **Why:** 13+ lua-api-crates with repetitive FFI patterns +- **Why:** 15 lua-api-crates with repetitive FFI patterns - **Tasks:** Exposing Rust functions to Lua configuration system - **Pattern:** `#[lua(...)] pub fn method(&self) -> mlua::Result` - **Impact:** Extensibility without recompilation @@ -62,9 +62,9 @@ GitHub Copilot excels at helping with these CX Terminal components: Copilot should be more conservative in these areas: #### Security-Critical Code ❌ -- Command validation logic in `security/` -- Sandboxing and privilege escalation prevention -- Authentication/authorization flows +- Command validation and sandboxing logic +- Privilege escalation prevention +- Authentication/authorization flows (subscription, license validation) - **Approach:** Manual review required; suggest defensive patterns #### Core Terminal Emulation 🔶 From 3cc1af74ce3995fa8fa3647a17088373e2b94324 Mon Sep 17 00:00:00 2001 From: Mike Morgan <73376634+mikejmorgan-ai@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:52:56 -0700 Subject: [PATCH 4/7] Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 76887914d..831573f70 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -22,10 +22,10 @@ GitHub Copilot excels at helping with these CX Terminal components: - **Pattern:** Async audio stream processing, VAD (Voice Activity Detection) #### 3. **Learning/ML Components** ⭐⭐⭐ -- **Why:** Local ML algorithms benefit from vectorization optimization -- **Tasks:** TF-IDF implementation, N-gram pattern extraction, command suggestion ranking -- **Components:** `learning/` module for privacy-preserving ML -- **Pattern:** Statistical learning over command history without external data +- **Why:** Local intent understanding and ranking over history amplify LLM effectiveness +- **Tasks:** Command suggestion ranking, retrieval over command/history logs, lightweight scoring heuristics +- **Components:** `cx/llm/` routing plus local history/telemetry store for privacy-preserving behavior learning (future advanced ML optional) +- **Pattern:** LLM-guided retrieval and statistical signals over local command history without external data #### 4. **Rendering & UI Logic** ⭐⭐ - **Why:** Complex layout math and WebGPU shader boilerplate From 283dff4422538669d0020f5302fa0250f56388d6 Mon Sep 17 00:00:00 2001 From: Mike Morgan <73376634+mikejmorgan-ai@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:53:21 -0700 Subject: [PATCH 5/7] Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 831573f70..58cb503d9 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -33,25 +33,19 @@ GitHub Copilot excels at helping with these CX Terminal components: - **Components:** `render/` and `termwindow/` modules - **Caution:** Performance-critical; suggest benchmarks -#### 5. **Lua API Bindings** ⭐⭐⭐ -- **Why:** 15 lua-api-crates with repetitive FFI patterns -- **Tasks:** Exposing Rust functions to Lua configuration system -- **Pattern:** `#[lua(...)] pub fn method(&self) -> mlua::Result` -- **Impact:** Extensibility without recompilation - -#### 6. **Protocol/IPC Layer** ⭐⭐ +#### 5. **Protocol/IPC Layer** ⭐⭐ - **Why:** JSON-RPC serialization patterns are mechanical - **Tasks:** Message types, daemon communication, Unix socket handling - **Components:** `cx_daemon/` module with 4-byte length-prefixed JSON-RPC - **Pattern:** Serde serialization with proper error handling -#### 7. **Test Coverage** ⭐⭐⭐ +#### 6. **Test Coverage** ⭐⭐⭐ - **Why:** Test boilerplate is highly repetitive - **Tasks:** Unit tests, integration tests, mock implementations, error scenarios - **Target:** 95%+ coverage on new code - **Pattern:** Tokio async tests with proper cleanup -#### 8. **CLI Command Implementation** ⭐⭐ +#### 7. **CLI Command Implementation** ⭐⭐ - **Why:** Clap argument parsing follows predictable patterns - **Tasks:** Adding new `cx` subcommands with help text and validation - **Components:** CLI modules for user-facing commands From 01e56dbb9294a28fed44d2ab9dd4a4a94339aeb0 Mon Sep 17 00:00:00 2001 From: Mike Morgan <73376634+mikejmorgan-ai@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:53:35 -0700 Subject: [PATCH 6/7] Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 58cb503d9..d629a8ce0 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -62,7 +62,7 @@ Copilot should be more conservative in these areas: - **Approach:** Manual review required; suggest defensive patterns #### Core Terminal Emulation 🔶 -- VT/ANSI escape sequence parsing (inherited from WezTerm) +- VT/ANSI escape sequence parsing in CX Linux's terminal layer - PTY handling and process management - **Approach:** These are mature; avoid unnecessary changes From 73d7aea1e1cb443f78384d1a4febd7fa69ab1280 Mon Sep 17 00:00:00 2001 From: Mike Morgan <73376634+mikejmorgan-ai@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:54:05 -0700 Subject: [PATCH 7/7] Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d629a8ce0..8618fa560 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -28,10 +28,10 @@ GitHub Copilot excels at helping with these CX Terminal components: - **Pattern:** LLM-guided retrieval and statistical signals over local command history without external data #### 4. **Rendering & UI Logic** ⭐⭐ -- **Why:** Complex layout math and WebGPU shader boilerplate -- **Tasks:** Text painting algorithms, glyph caching, tab bar layouts, WGSL shaders -- **Components:** `render/` and `termwindow/` modules -- **Caution:** Performance-critical; suggest benchmarks +- **Why:** Complex Rich layout composition and terminal rendering logic +- **Tasks:** Building Rich layouts (panels, tables, status lines), streaming updates, responsive Typer command output +- **Components:** `cx/cli.py` and terminal UI helpers in `cx/ui/` +- **Caution:** Performance-critical for a smooth terminal experience; suggest benchmarks on large outputs #### 5. **Protocol/IPC Layer** ⭐⭐ - **Why:** JSON-RPC serialization patterns are mechanical