@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/dist/index.cjs CHANGED
@@ -1757,7 +1757,7 @@ var require_package = __commonJS({
1757
1757
  "package.json"(exports2, module2) {
1758
1758
  module2.exports = {
1759
1759
  name: "@rigstate/cli",
1760
- version: "0.7.25",
1760
+ version: "0.7.26",
1761
1761
  description: "Rigstate CLI - Code audit, sync and supervision tool",
1762
1762
  type: "module",
1763
1763
  main: "./dist/index.js",
@@ -4015,6 +4015,7 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
4015
4015
  this.emit("skill:suggestion", match);
4016
4016
  }
4017
4017
  }
4018
+ violationsMap = /* @__PURE__ */ new Map();
4018
4019
  async runIntegrityCheck(filePath) {
4019
4020
  if (!this.guardianMonitor) return;
4020
4021
  if (this.interventionProtocol) this.interventionProtocol.clear(filePath);
@@ -4023,24 +4024,37 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
4023
4024
  if (result.violations.length > 0) {
4024
4025
  this.handleViolations(filePath, result.violations);
4025
4026
  } else {
4026
- await this.updateViolationReport([]);
4027
+ if (this.violationsMap.has(filePath)) {
4028
+ this.violationsMap.delete(filePath);
4029
+ this.updateViolationReport();
4030
+ }
4027
4031
  }
4028
4032
  }
4029
4033
  async updateViolationReport(violations) {
4030
4034
  const reportPath = import_path19.default.join(process.cwd(), ".rigstate", "ACTIVE_VIOLATIONS.md");
4031
- let content = `# \u{1F6E1}\uFE0F Guardian Status: ${violations.length > 0 ? "\u26A0\uFE0F ATTENTION" : "\u2705 PASS"}
4035
+ const allViolations = Array.from(this.violationsMap.entries());
4036
+ const totalCount = allViolations.reduce((acc, [, v]) => acc + v.length, 0);
4037
+ let content = `# \u{1F6E1}\uFE0F Guardian Status: ${totalCount > 0 ? "\u26A0\uFE0F ATTENTION" : "\u2705 PASS"}
4032
4038
 
4033
4039
  `;
4034
4040
  content += `*Last check: ${(/* @__PURE__ */ new Date()).toLocaleString()}*
4041
+ `;
4042
+ content += `*Files with issues: ${allViolations.length}*
4035
4043
 
4036
4044
  `;
4037
- if (violations.length === 0) {
4045
+ if (totalCount === 0) {
4038
4046
  content += "All systems within architectural limits. Frank is satisfied. \u{1F92B}\n";
4039
4047
  } else {
4040
4048
  content += "### \u{1F6A8} Active Violations\n\n";
4041
- for (const v of violations) {
4042
- content += `- **[${v.severity.toUpperCase()}]**: ${v.message}
4049
+ for (const [file, fileViolations] of allViolations) {
4050
+ const relPath = import_path19.default.relative(process.cwd(), file);
4051
+ content += `#### \u{1F4C4} ${relPath}
4043
4052
  `;
4053
+ for (const v of fileViolations) {
4054
+ content += `- **[${v.severity.toUpperCase()}]**: ${v.message}
4055
+ `;
4056
+ }
4057
+ content += "\n";
4044
4058
  }
4045
4059
  content += "\n---\n*Rigstate Daemon is watching. Fix violations to clear this report.*";
4046
4060
  }
@@ -4052,7 +4066,8 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
4052
4066
  handleViolations(filePath, violations) {
4053
4067
  this.state.violationsFound += violations.length;
4054
4068
  this.emit("violation", { file: filePath, violations });
4055
- this.updateViolationReport(violations);
4069
+ this.violationsMap.set(filePath, violations);
4070
+ this.updateViolationReport();
4056
4071
  for (const v of violations) {
4057
4072
  const level = v.severity === "critical" ? "error" : v.severity === "warning" ? "warn" : "info";
4058
4073
  Logger[level](`[${v.severity.toUpperCase()}] ${filePath}: ${v.message}`);