@stupify/cli 0.0.10 → 0.0.11

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/analysis.js CHANGED
@@ -73,6 +73,7 @@ function uncheckedSearchMatches(value, contexts) {
73
73
  patternId: context.checkId,
74
74
  reason: match.reason ?? "",
75
75
  proof: sourcePointer(context),
76
+ snapshot: sourceSnapshot(context),
76
77
  }];
77
78
  });
78
79
  }
@@ -80,6 +81,32 @@ function sourcePointer(context) {
80
81
  const file = context.filePath ?? "(unknown)";
81
82
  return `${file}::${context.entityKind || "entity"}::${context.entityName || context.entityId}`;
82
83
  }
84
+ function sourceSnapshot(context) {
85
+ try {
86
+ const parsed = JSON.parse(context.text);
87
+ const snapshot = stringSnapshot(parsed.after) ?? stringSnapshot(parsed.before);
88
+ return snapshot ? limitSnapshot(snapshot) : undefined;
89
+ }
90
+ catch {
91
+ return undefined;
92
+ }
93
+ }
94
+ function stringSnapshot(value) {
95
+ if (typeof value !== "string")
96
+ return undefined;
97
+ const trimmed = value.trim();
98
+ if (!trimmed || trimmed === "(none)")
99
+ return undefined;
100
+ return trimmed;
101
+ }
102
+ function limitSnapshot(value) {
103
+ const lines = value.split(/\r?\n/);
104
+ const limit = 24;
105
+ if (lines.length <= limit)
106
+ return value;
107
+ return `${lines.slice(0, limit).join("\n")}
108
+ [stupify: snapshot shortened after ${limit} lines]`;
109
+ }
83
110
  async function runJsonPrompt(model, prompt, schema, temperature) {
84
111
  return cachedJson("model-json", fingerprint({
85
112
  version: 1,
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "0.0.10";
1
+ export declare const VERSION = "0.0.11";
2
2
  import type { ModelConfig, ModelId } from "./types.ts";
3
3
  export declare const DEFAULT_MODEL_ID: ModelId;
4
4
  export declare const MODEL_REGISTRY: Record<ModelId, ModelConfig>;
package/dist/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.0.10";
1
+ export const VERSION = "0.0.11";
2
2
  export const DEFAULT_MODEL_ID = "gemma-4-e2b";
3
3
  export const MODEL_REGISTRY = {
4
4
  "gemma-4-e2b": {
package/dist/render.js CHANGED
@@ -24,13 +24,18 @@ ${format.success("No search targets found.")}`;
24
24
  ${format.label("Patterns:")} ${run.patterns.join(", ")}
25
25
  ${format.success("No judgment-offload signals found.")}`;
26
26
  }
27
- return `${format.warn("AI SLOP DETECTED")}
28
- ${run.matches.map((match, index) => `${index + 1}.
29
- ${format.muted("who:")} ${committerLabel(run)}
30
- ${format.muted("what:")} ${match.patternId} - ${match.reason}
31
- ${format.muted("when:")} ${sourceLabel(command)}
32
- ${format.muted("where:")} ${match.proof}
33
- ${format.muted("why:")} ${match.checkWhy ?? "This pattern may indicate judgment-offload."}`).join("\n")}
27
+ return `${slopHeading()}
28
+ ${run.matches.map((match, index) => `${index + 1}. ${format.label(match.patternId)}
29
+ ${committerLabel(run)} (${sourceLabel(command)})
30
+
31
+ ${match.reason}
32
+
33
+ \`\`\`
34
+ ${match.snapshot ?? match.proof}
35
+ \`\`\`
36
+ ${format.muted(match.proof)}
37
+
38
+ ${match.checkWhy ?? "This pattern may indicate judgment-offload."}`).join("\n\n")}
34
39
  ${format.muted("Search mode is warn-only.")}`;
35
40
  }
36
41
  export function helpText() {
@@ -103,10 +108,18 @@ function sourceLabel(command) {
103
108
  return "stdin diff";
104
109
  }
105
110
  function committerLabel(run) {
106
- const committers = (run.stats.committers ?? []).filter(Boolean);
111
+ const committers = (run.stats.committers ?? []).filter(Boolean).map(committerDisplayName);
107
112
  if (committers.length === 0)
108
113
  return "unknown committer";
109
114
  if (committers.length <= 3)
110
115
  return committers.join(", ");
111
116
  return `${committers.slice(0, 3).join(", ")} +${committers.length - 3} more`;
112
117
  }
118
+ function committerDisplayName(value) {
119
+ return value.replace(/\s*<[^>]+>\s*$/, "").trim() || value;
120
+ }
121
+ function slopHeading() {
122
+ const heading = "AI SLOP DETECTED";
123
+ return `${format.warn(format.heading(heading))}
124
+ ${format.warn("=".repeat(heading.length))}`;
125
+ }
package/dist/types.d.ts CHANGED
@@ -200,6 +200,7 @@ export type SearchMatch = Readonly<{
200
200
  checkWhy?: string;
201
201
  reason: string;
202
202
  proof: string;
203
+ snapshot?: string;
203
204
  }>;
204
205
  export type SearchRunJson = Readonly<{
205
206
  schemaVersion: "search.v1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stupify/cli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Local-only diagnostic CLI for checking whether AI is making you dumber.",
5
5
  "private": false,
6
6
  "type": "module",
package/src/analysis.ts CHANGED
@@ -106,6 +106,7 @@ function uncheckedSearchMatches(value: unknown, contexts: readonly SemContext[])
106
106
  patternId: context.checkId,
107
107
  reason: match.reason ?? "",
108
108
  proof: sourcePointer(context),
109
+ snapshot: sourceSnapshot(context),
109
110
  }];
110
111
  });
111
112
  }
@@ -115,6 +116,31 @@ function sourcePointer(context: SemContext): string {
115
116
  return `${file}::${context.entityKind || "entity"}::${context.entityName || context.entityId}`;
116
117
  }
117
118
 
119
+ function sourceSnapshot(context: SemContext): string | undefined {
120
+ try {
121
+ const parsed = JSON.parse(context.text) as { after?: unknown; before?: unknown };
122
+ const snapshot = stringSnapshot(parsed.after) ?? stringSnapshot(parsed.before);
123
+ return snapshot ? limitSnapshot(snapshot) : undefined;
124
+ } catch {
125
+ return undefined;
126
+ }
127
+ }
128
+
129
+ function stringSnapshot(value: unknown): string | undefined {
130
+ if (typeof value !== "string") return undefined;
131
+ const trimmed = value.trim();
132
+ if (!trimmed || trimmed === "(none)") return undefined;
133
+ return trimmed;
134
+ }
135
+
136
+ function limitSnapshot(value: string): string {
137
+ const lines = value.split(/\r?\n/);
138
+ const limit = 24;
139
+ if (lines.length <= limit) return value;
140
+ return `${lines.slice(0, limit).join("\n")}
141
+ [stupify: snapshot shortened after ${limit} lines]`;
142
+ }
143
+
118
144
  async function runJsonPrompt(
119
145
  model: LocalModel,
120
146
  prompt: string,
package/src/constants.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.0.10";
1
+ export const VERSION = "0.0.11";
2
2
  import type { ModelConfig, ModelId } from "./types.ts";
3
3
 
4
4
  export const DEFAULT_MODEL_ID: ModelId = "gemma-4-e2b";
package/src/render.ts CHANGED
@@ -29,13 +29,18 @@ ${format.label("Patterns:")} ${run.patterns.join(", ")}
29
29
  ${format.success("No judgment-offload signals found.")}`;
30
30
  }
31
31
 
32
- return `${format.warn("AI SLOP DETECTED")}
33
- ${run.matches.map((match, index) => `${index + 1}.
34
- ${format.muted("who:")} ${committerLabel(run)}
35
- ${format.muted("what:")} ${match.patternId} - ${match.reason}
36
- ${format.muted("when:")} ${sourceLabel(command)}
37
- ${format.muted("where:")} ${match.proof}
38
- ${format.muted("why:")} ${match.checkWhy ?? "This pattern may indicate judgment-offload."}`).join("\n")}
32
+ return `${slopHeading()}
33
+ ${run.matches.map((match, index) => `${index + 1}. ${format.label(match.patternId)}
34
+ ${committerLabel(run)} (${sourceLabel(command)})
35
+
36
+ ${match.reason}
37
+
38
+ \`\`\`
39
+ ${match.snapshot ?? match.proof}
40
+ \`\`\`
41
+ ${format.muted(match.proof)}
42
+
43
+ ${match.checkWhy ?? "This pattern may indicate judgment-offload."}`).join("\n\n")}
39
44
  ${format.muted("Search mode is warn-only.")}`;
40
45
  }
41
46
 
@@ -104,8 +109,18 @@ function sourceLabel(command: SearchCommand): string {
104
109
  }
105
110
 
106
111
  function committerLabel(run: SearchRunJson): string {
107
- const committers = (run.stats.committers ?? []).filter(Boolean);
112
+ const committers = (run.stats.committers ?? []).filter(Boolean).map(committerDisplayName);
108
113
  if (committers.length === 0) return "unknown committer";
109
114
  if (committers.length <= 3) return committers.join(", ");
110
115
  return `${committers.slice(0, 3).join(", ")} +${committers.length - 3} more`;
111
116
  }
117
+
118
+ function committerDisplayName(value: string): string {
119
+ return value.replace(/\s*<[^>]+>\s*$/, "").trim() || value;
120
+ }
121
+
122
+ function slopHeading(): string {
123
+ const heading = "AI SLOP DETECTED";
124
+ return `${format.warn(format.heading(heading))}
125
+ ${format.warn("=".repeat(heading.length))}`;
126
+ }
package/src/types.ts CHANGED
@@ -198,6 +198,7 @@ export type SearchMatch = Readonly<{
198
198
  checkWhy?: string;
199
199
  reason: string;
200
200
  proof: string;
201
+ snapshot?: string;
201
202
  }>;
202
203
 
203
204
  export type SearchRunJson = Readonly<{