@rigstate/cli 0.7.25 → 0.7.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigstate/cli",
3
- "version": "0.7.25",
3
+ "version": "0.7.26",
4
4
  "description": "Rigstate CLI - Code audit, sync and supervision tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -160,6 +160,8 @@ export class GuardianDaemon extends EventEmitter {
160
160
  }
161
161
  }
162
162
 
163
+ private violationsMap = new Map<string, any[]>();
164
+
163
165
  private async runIntegrityCheck(filePath: string) {
164
166
  if (!this.guardianMonitor) return;
165
167
 
@@ -170,25 +172,37 @@ export class GuardianDaemon extends EventEmitter {
170
172
  if (result.violations.length > 0) {
171
173
  this.handleViolations(filePath, result.violations);
172
174
  } else {
173
- // Success - might need to clear previous violations for this file
174
- await this.updateViolationReport([]);
175
+ // Success - clear violations for this file
176
+ if (this.violationsMap.has(filePath)) {
177
+ this.violationsMap.delete(filePath);
178
+ this.updateViolationReport(); // Update the aggregate report
179
+ }
175
180
  }
176
181
  }
177
182
 
178
- private async updateViolationReport(violations: any[]) {
183
+ private async updateViolationReport(violations?: any[]) {
184
+ // If violations arg is passed (from handleViolations), update the map first
185
+ // But usually handleViolations calls this without args to just refresh
186
+
179
187
  const reportPath = path.join(process.cwd(), '.rigstate', 'ACTIVE_VIOLATIONS.md');
188
+ const allViolations = Array.from(this.violationsMap.entries());
189
+ const totalCount = allViolations.reduce((acc, [, v]) => acc + v.length, 0);
180
190
 
181
- // This is a simplified version. In a real build, we'd aggregate across all files.
182
- // For now, let's show the most recent or active ones.
183
- let content = `# 🛡️ Guardian Status: ${violations.length > 0 ? '⚠️ ATTENTION' : '✅ PASS'}\n\n`;
184
- content += `*Last check: ${new Date().toLocaleString()}*\n\n`;
191
+ let content = `# 🛡️ Guardian Status: ${totalCount > 0 ? '⚠️ ATTENTION' : '✅ PASS'}\n\n`;
192
+ content += `*Last check: ${new Date().toLocaleString()}*\n`;
193
+ content += `*Files with issues: ${allViolations.length}*\n\n`;
185
194
 
186
- if (violations.length === 0) {
195
+ if (totalCount === 0) {
187
196
  content += "All systems within architectural limits. Frank is satisfied. 🤫\n";
188
197
  } else {
189
198
  content += "### 🚨 Active Violations\n\n";
190
- for (const v of violations) {
191
- content += `- **[${v.severity.toUpperCase()}]**: ${v.message}\n`;
199
+ for (const [file, fileViolations] of allViolations) {
200
+ const relPath = path.relative(process.cwd(), file);
201
+ content += `#### 📄 ${relPath}\n`;
202
+ for (const v of fileViolations) {
203
+ content += `- **[${v.severity.toUpperCase()}]**: ${v.message}\n`;
204
+ }
205
+ content += '\n';
192
206
  }
193
207
  content += "\n---\n*Rigstate Daemon is watching. Fix violations to clear this report.*";
194
208
  }
@@ -202,7 +216,10 @@ export class GuardianDaemon extends EventEmitter {
202
216
  this.state.violationsFound += violations.length;
203
217
  this.emit('violation', { file: filePath, violations });
204
218
 
205
- this.updateViolationReport(violations); // Push to IDE dashboard
219
+ // Update state map
220
+ this.violationsMap.set(filePath, violations);
221
+
222
+ this.updateViolationReport(); // Push to IDE dashboard
206
223
 
207
224
  for (const v of violations) {
208
225
  const level = v.severity === 'critical' ? 'error' : v.severity === 'warning' ? 'warn' : 'info';
@@ -1,8 +0,0 @@
1
- {
2
- "isRunning": true,
3
- "startedAt": "2026-01-26T13:11:14.337Z",
4
- "filesChecked": 4,
5
- "violationsFound": 83,
6
- "tasksProcessed": 0,
7
- "lastActivity": "2026-01-26T15:24:35.672Z"
8
- }