s9n-devops-agent 1.2.0 โ†’ 1.3.1

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/README.md CHANGED
@@ -1,10 +1,26 @@
1
- # CS_DevOpsAgent ๐Ÿš€
1
+ # CS_DevOpsAgent ๐Ÿš€ v1.3.1
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/s9n-devops-agent.svg)](https://badge.fury.io/js/s9n-devops-agent)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
  [![GitHub](https://img.shields.io/badge/GitHub-Repository-blue)](https://github.com/SecondBrainAICo/CS_DevOpsAgent)
6
6
 
7
- An intelligent Git automation system with multi-agent support, session management, and seamless integration with AI coding assistants like Claude, GitHub Copilot, and Cursor.
7
+ An intelligent Git automation system with multi-agent support, real-time file coordination, session management, and seamless integration with AI coding assistants like Claude, GitHub Copilot, and Cursor.
8
+
9
+ ## ๐Ÿ†• What's New in v1.3.1
10
+
11
+ ### Latest Updates (v1.3.1)
12
+ - **๐Ÿ”’ Enhanced File Locking**: Improved coordination scripts with proper empty directory handling
13
+ - **๐Ÿงช File Locking Demo**: New comprehensive test showing how multi-agent coordination prevents conflicts
14
+ - **๐Ÿ“ Better Organization**: Coordination scripts moved to `scripts/coordination/` for clarity
15
+ - **๐Ÿ› Bug Fixes**: Fixed glob expansion issues in file coordination scripts
16
+
17
+ ### Previous Features (v1.3.0)
18
+ - **๐Ÿ“š Intelligent House Rules System**: Auto-creates and updates project conventions for AI agents
19
+ - **๐ŸŸง Real-time Undeclared Edit Detection**: Instantly alerts when files are edited without declaration
20
+ - **๐Ÿ”ด File Conflict Prevention**: Detects and reports when multiple agents try to edit the same files
21
+ - **๐Ÿ”„ Smart Version Updates**: House rules sections update independently while preserving user content
22
+ - **๐Ÿš€ Streamlined Setup**: One-command setup with `npm start` - handles everything automatically
23
+ - **๐Ÿ”ง Self-Healing**: Automatically recovers if house rules are deleted
8
24
 
9
25
  ## ๐Ÿ”— Quick Links
10
26
 
@@ -15,49 +31,51 @@ An intelligent Git automation system with multi-agent support, session managemen
15
31
 
16
32
  ## Features โœจ
17
33
 
34
+ ### Core Features
18
35
  - **๐Ÿค– Multi-Agent Support**: Work with Claude, GitHub Copilot, Cursor, and other AI coding assistants
19
36
  - **๐Ÿ“ Git Worktree Management**: Isolated workspaces for each session to prevent conflicts
20
37
  - **๐Ÿ”„ Automatic Commits & Push**: Monitors changes and commits with proper messages
21
38
  - **๐Ÿ“… Daily Version Rollover**: Automatic version management with customizable increments
22
39
  - **๐ŸŽฏ Session Management**: Create, manage, and track multiple development sessions
23
40
  - **โš™๏ธ VS Code Integration**: Seamlessly integrates with VS Code tasks
24
- - **๐Ÿ” Safe Concurrent Development**: Multiple agents can work simultaneously without conflicts
25
41
  - **๐Ÿท๏ธ Smart Branching**: Automatic branch creation with configurable naming patterns
42
+
43
+ ### File Coordination (v1.3.0) ๐Ÿ†•
44
+ - **๐ŸŸง Undeclared Edit Detection**: Orange alerts when agents edit files without declaring them
45
+ - **๐Ÿ”ด Conflict Detection**: Red alerts when multiple agents try to edit the same files
46
+ - **๐Ÿ“ Declaration Protocol**: Agents must declare files before editing to prevent conflicts
47
+ - **โšก Real-time Monitoring**: Detects violations within 2 seconds
48
+ - **๐Ÿ“‹ Actionable Instructions**: Provides copy-paste commands to correct agent behavior
49
+ - **๐Ÿ”’ Advisory Locks**: File-level coordination without blocking legitimate work
50
+
51
+ ### Infrastructure
52
+ - **๐Ÿ” Safe Concurrent Development**: Multiple agents can work simultaneously without conflicts
26
53
  - **๐Ÿ‹ Docker Auto-Restart**: Automatically restart Docker containers after code push (v1.2.0)
27
54
 
28
55
  ## Installation ๐Ÿ“ฆ
29
56
 
30
- ### Option 1: NPM Package (Recommended for Users)
57
+ > **๐Ÿ“– Detailed Guide**: See [INSTALLATION_GUIDE.md](docs/INSTALLATION_GUIDE.md) for complete setup instructions
58
+
59
+ ### Quick Install (NPM Package)
31
60
 
32
- #### Global Installation
33
61
  ```bash
62
+ # Install globally (recommended)
34
63
  npm install -g s9n-devops-agent
35
- ```
36
64
 
37
- #### Local Installation
38
- ```bash
39
- npm install s9n-devops-agent --save-dev
65
+ # Verify installation
66
+ s9n-devops-agent --help
40
67
  ```
41
68
 
42
- ### Option 2: From Source (For Contributors)
43
-
44
- #### Clone the Repository
45
- ```bash
46
- # Clone the repository
47
- git clone https://github.com/SecondBrainAICo/CS_DevOpsAgent.git
48
- cd CS_DevOpsAgent
69
+ ### What Gets Installed
49
70
 
50
- # Install dependencies
51
- npm install
71
+ The NPM package installs:
72
+ - โœ… **CLI Binary**: `s9n-devops-agent` command available globally
73
+ - โœ… **Core Files**: Worker, session manager, and utilities in npm's global node_modules
74
+ - โœ… **Dependencies**: `chokidar` for file watching, `execa` for git operations
75
+ - โŒ **No Project Modifications**: Your project stays clean until you run setup
52
76
 
53
- # Link globally for development
54
- npm link
77
+ ### From Source (For Contributors)
55
78
 
56
- # Now you can use s9n-devops-agent command globally
57
- s9n-devops-agent --help
58
- ```
59
-
60
- #### Development Setup
61
79
  ```bash
62
80
  # Clone and setup for development
63
81
  git clone https://github.com/SecondBrainAICo/CS_DevOpsAgent.git
@@ -66,35 +84,42 @@ cd CS_DevOpsAgent
66
84
  # Install dependencies
67
85
  npm install
68
86
 
87
+ # Link globally for development
88
+ npm link
89
+
69
90
  # Run tests
70
91
  npm test
71
-
72
- # Start development session
73
- npm run dev
74
92
  ```
75
93
 
76
94
  ## Quick Start ๐Ÿš€
77
95
 
78
- ### First-Time Setup
96
+ ### One-Command Setup & Start
79
97
 
80
98
  ```bash
81
- # Run the interactive setup wizard
82
- s9n-devops-agent setup
83
-
84
- # This will configure:
85
- # - Your developer initials (used in branch names)
86
- # - Version numbering strategy
87
- # - Default timezone for daily rollover
99
+ # Just run npm start - it handles everything!
100
+ npm start
101
+
102
+ # On first run, it will:
103
+ # โœ… Set up house rules for AI agents
104
+ # โœ… Configure file coordination system
105
+ # โœ… Set up your developer initials
106
+ # โœ… Configure version strategy
107
+ # โœ… Start the session manager
88
108
  ```
89
109
 
90
- ### Start a DevOps Session
110
+ That's it! No separate setup commands needed.
111
+
112
+ ### Alternative Setup Methods
91
113
 
92
114
  ```bash
93
- # Start the interactive session manager
94
- s9n-devops-agent start
115
+ # Navigate to your project
116
+ cd /path/to/your/project
95
117
 
96
- # Or create a new session directly
97
- s9n-devops-agent create --task "implement-api"
118
+ # Run the interactive setup wizard (for manual setup)
119
+ s9n-devops-agent setup
120
+
121
+ # Or start a session directly
122
+ s9n-devops-agent start
98
123
  ```
99
124
 
100
125
  ### Working with AI Assistants
@@ -107,13 +132,113 @@ I'm working in a DevOps-managed session with the following setup:
107
132
  - Working Directory: /path/to/worktree
108
133
  - Task: implement-api
109
134
 
110
- Please switch to this directory before making any changes:
111
- cd "/path/to/worktree"
135
+ CRITICAL FIRST STEP:
136
+ 1. Read and follow the house rules: cat "/path/to/worktree/houserules.md"
137
+ 2. Switch to the working directory: cd "/path/to/worktree"
138
+
139
+ FILE COORDINATION PROTOCOL (from house rules):
140
+ Before editing ANY files, you MUST:
141
+ - Declare your intent in .file-coordination/active-edits/<agent>-8a3s-45b1.json
142
+ - Check for conflicts with other agents
143
+ - Only edit files you've declared
144
+ - Release files when done
112
145
 
113
146
  Write commit messages to: .devops-commit-8a3s-45b1.msg
114
147
  The DevOps agent will automatically commit and push changes.
115
148
  ```
116
149
 
150
+ ## House Rules & File Coordination System ๐Ÿ“š๐Ÿ”’
151
+
152
+ ### House Rules System (NEW!)
153
+
154
+ The DevOps Agent automatically manages "house rules" that teach AI agents your project conventions:
155
+
156
+ **Features:**
157
+ - **Auto-Creation**: Created automatically on first run
158
+ - **Smart Updates**: Updates only DevOps sections, preserves your custom rules
159
+ - **Version Tracking**: Each section independently versioned with checksums
160
+ - **Self-Healing**: Automatically recreates if deleted
161
+ - **CI/CD Ready**: Works in automated environments
162
+
163
+ **House Rules Commands:**
164
+ ```bash
165
+ # Check status
166
+ npm run house-rules:status
167
+
168
+ # Update or create
169
+ npm run house-rules:update
170
+
171
+ # Health check and repair
172
+ npm run house-rules:repair
173
+ ```
174
+
175
+ ### File Coordination System
176
+
177
+ Prevents multiple AI agents from editing the same files simultaneously:
178
+
179
+ 1. **Declaration Phase**: Agents declare which files they'll modify
180
+ 2. **Conflict Check**: System checks if files are already being edited
181
+ 3. **Real-time Monitoring**: Detects violations within 2 seconds
182
+ 4. **Alert System**:
183
+ - ๐ŸŸง **Orange Alert**: Files edited without declaration
184
+ - ๐Ÿ”ด **Red Alert**: Files being edited by another agent
185
+ 5. **Copy-Paste Instructions**: Provides exact commands to correct agent behavior
186
+
187
+ **Coordination Commands:**
188
+ ```bash
189
+ # Check if files are available
190
+ ./scripts/coordination/check-file-availability.sh src/main.js src/utils.js
191
+
192
+ # Declare intent to edit files
193
+ ./scripts/coordination/declare-file-edits.sh <agent-name> <session-id> file1.js file2.js
194
+
195
+ # Release files after editing
196
+ ./scripts/coordination/release-file-edits.sh <agent-name> <session-id>
197
+
198
+ # Run file locking demo
199
+ ./test_scripts/multi-agent/test-file-locking.sh
200
+ ```
201
+
202
+ ### For AI Agents
203
+
204
+ Agents should follow this protocol:
205
+
206
+ ```json
207
+ // Before editing, create: .file-coordination/active-edits/<agent>-<session>.json
208
+ {
209
+ "agent": "claude",
210
+ "session": "8a3s-45b1",
211
+ "files": ["src/main.js", "src/utils.js"],
212
+ "operation": "edit",
213
+ "reason": "Implementing authentication feature",
214
+ "declaredAt": "2025-09-30T12:00:00Z",
215
+ "estimatedDuration": 300
216
+ }
217
+ ```
218
+
219
+ ### Alert Examples
220
+
221
+ #### Undeclared Edit Alert (๐ŸŸง Orange)
222
+ ```
223
+ ๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง
224
+ ๐ŸŸง UNDECLARED FILE EDIT DETECTED!
225
+ ๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง
226
+
227
+ โŒ File "src/main.js" was modified WITHOUT declaration!
228
+ ๐Ÿ“‹ COPY THIS INSTRUCTION TO YOUR CODING AGENT:
229
+ [Instructions on how to declare the file]
230
+ ```
231
+
232
+ #### Conflict Alert (๐Ÿ”ด Red)
233
+ ```
234
+ ๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด
235
+ ๐Ÿ”ด FILE CONFLICT DETECTED!
236
+ ๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด
237
+
238
+ โŒ File "src/main.js" is being edited by: claude-session-abc123
239
+ [Instructions on how to resolve]
240
+ ```
241
+
117
242
  ## Commands ๐Ÿ“
118
243
 
119
244
  ### Session Management
@@ -151,6 +276,8 @@ s9n-devops-agent setup
151
276
 
152
277
  ## Configuration ๐Ÿ”ง
153
278
 
279
+ > **๐Ÿ“– Complete Configuration Guide**: See [INSTALLATION_GUIDE.md](docs/INSTALLATION_GUIDE.md#configuration-files)
280
+
154
281
  ### Environment Variables
155
282
 
156
283
  ```bash
@@ -174,9 +301,23 @@ export AC_VERSION_INCREMENT="1" # 1 = 0.01, 10 = 0.1
174
301
 
175
302
  ### Configuration Files
176
303
 
177
- Configuration is stored in:
178
- - **Global settings**: `~/.devops-agent/settings.json` (developer initials, email)
179
- - **Project settings**: `local_deploy/project-settings.json` (version strategy, auto-merge)
304
+ **Global Configuration** (`~/.devops-agent/settings.json`):
305
+ - Developer initials and email
306
+ - Default timezone settings
307
+ - Created on first setup
308
+
309
+ **Project Configuration** (`local_deploy/project-settings.json`):
310
+ - Version numbering strategy
311
+ - Auto-merge settings
312
+ - Docker restart configuration
313
+ - Created per project
314
+
315
+ **House Rules** (`docs/houserules.md`):
316
+ - Instructions for AI assistants
317
+ - Testing requirements
318
+ - Commit message format
319
+ - Multi-agent coordination rules
320
+ - **Must be created manually** ([see template](docs/INSTALLATION_GUIDE.md#house-rules-setup))
180
321
 
181
322
  ## Workflow Example ๐Ÿ’ก
182
323
 
@@ -289,29 +430,42 @@ At midnight (configurable timezone):
289
430
 
290
431
  ## Troubleshooting ๐Ÿ”
291
432
 
433
+ > **๐Ÿ“– Detailed Troubleshooting**: See [INSTALLATION_GUIDE.md](docs/INSTALLATION_GUIDE.md#troubleshooting)
434
+
292
435
  ### Common Issues
293
436
 
294
- **Session files showing as uncommitted**:
437
+ **After npm install - command not found**:
295
438
  ```bash
296
- # Files are automatically gitignored
297
- # If issue persists, run:
298
- s9n-devops-agent cleanup
439
+ # Check npm global bin directory
440
+ npm bin -g
441
+ # Add to PATH if needed
442
+ export PATH="$PATH:$(npm bin -g)"
299
443
  ```
300
444
 
301
- **Permission denied errors**:
445
+ **Setup wizard issues**:
302
446
  ```bash
303
- # Ensure scripts are executable
304
- chmod +x $(npm root -g)/s9n-devops-agent/bin/s9n-devops-agent
447
+ # Ensure you're in a git repository
448
+ git init
449
+ # Run setup in project directory
450
+ cd /your/project && s9n-devops-agent setup
305
451
  ```
306
452
 
307
453
  **Agent not detecting changes**:
308
454
  ```bash
309
- # Check if running in correct directory
310
- pwd
311
- # Ensure message file exists
455
+ # Enable debug mode
456
+ AC_DEBUG=true s9n-devops-agent start
457
+ # Check message file exists and has content
312
458
  ls -la .devops-commit-*.msg
313
459
  ```
314
460
 
461
+ **Multi-agent conflicts**:
462
+ ```bash
463
+ # Check coordination files
464
+ ls -la .ac-prep/ .ac/ack/
465
+ # Clear if stuck
466
+ rm -rf .ac-prep .ac
467
+ ```
468
+
315
469
  ## Contributing ๐Ÿค
316
470
 
317
471
  Contributions are welcome! Please feel free to submit a Pull Request.