@kevinrabun/judges 3.115.3 → 3.115.4

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.
@@ -1,17 +1,62 @@
1
1
  /**
2
- * Judge registry bootstrap (agent-native).
2
+ * Judge registry bootstrap.
3
3
  *
4
- * Judges are now sourced from `.judge.md` files in the `agents/` folder (legacy
5
- * `.agent.md` still supported). Each agent frontmatter references an evaluator
6
- * script (in `src/evaluators/`), and the agent loader registers them with the
7
- * unified `JudgeRegistry`.
4
+ * Judges are dual-registered:
5
+ * 1. Static side-effect imports below each module calls
6
+ * `defaultRegistry.register()` at load time. These are inlined by
7
+ * esbuild and work in both ESM and CJS bundles.
8
+ * 2. Agent-native `.judge.md` files loaded at runtime from the `agents/`
9
+ * directory (when available). This enriches / overrides metadata.
8
10
  *
9
- * Legacy side-effect imports have been removed. If you need to add a judge, add
10
- * an agent file and (optionally) an evaluator script, then run:
11
- * - `npm run generate:agents` (to sync)
12
- * - `npm run validate:agents`
11
+ * The static imports guarantee that judges are always available, even in
12
+ * bundled environments (VS Code extension) where `agents/` is absent.
13
13
  */
14
14
  import type { JudgeDefinition } from "../types.js";
15
+ import "./accessibility.js";
16
+ import "./agent-instructions.js";
17
+ import "./ai-code-safety.js";
18
+ import "./api-contract.js";
19
+ import "./api-design.js";
20
+ import "./authentication.js";
21
+ import "./backwards-compatibility.js";
22
+ import "./caching.js";
23
+ import "./ci-cd.js";
24
+ import "./cloud-readiness.js";
25
+ import "./code-structure.js";
26
+ import "./compliance.js";
27
+ import "./concurrency.js";
28
+ import "./configuration-management.js";
29
+ import "./cost-effectiveness.js";
30
+ import "./cybersecurity.js";
31
+ import "./data-security.js";
32
+ import "./data-sovereignty.js";
33
+ import "./database.js";
34
+ import "./dependency-health.js";
35
+ import "./documentation.js";
36
+ import "./error-handling.js";
37
+ import "./ethics-bias.js";
38
+ import "./false-positive-review.js";
39
+ import "./framework-safety.js";
40
+ import "./hallucination-detection.js";
41
+ import "./iac-security.js";
42
+ import "./intent-alignment.js";
43
+ import "./internationalization.js";
44
+ import "./logging-privacy.js";
45
+ import "./logic-review.js";
46
+ import "./maintainability.js";
47
+ import "./model-fingerprint.js";
48
+ import "./multi-turn-coherence.js";
49
+ import "./observability.js";
50
+ import "./over-engineering.js";
51
+ import "./performance.js";
52
+ import "./portability.js";
53
+ import "./rate-limiting.js";
54
+ import "./reliability.js";
55
+ import "./scalability.js";
56
+ import "./security.js";
57
+ import "./software-practices.js";
58
+ import "./testing.js";
59
+ import "./ux.js";
15
60
  /**
16
61
  * Load judges (agent-native). Loads agents from the default `agents/` folder
17
62
  * and returns the current registry snapshot.
@@ -1,30 +1,85 @@
1
1
  /**
2
- * Judge registry bootstrap (agent-native).
2
+ * Judge registry bootstrap.
3
3
  *
4
- * Judges are now sourced from `.judge.md` files in the `agents/` folder (legacy
5
- * `.agent.md` still supported). Each agent frontmatter references an evaluator
6
- * script (in `src/evaluators/`), and the agent loader registers them with the
7
- * unified `JudgeRegistry`.
4
+ * Judges are dual-registered:
5
+ * 1. Static side-effect imports below each module calls
6
+ * `defaultRegistry.register()` at load time. These are inlined by
7
+ * esbuild and work in both ESM and CJS bundles.
8
+ * 2. Agent-native `.judge.md` files loaded at runtime from the `agents/`
9
+ * directory (when available). This enriches / overrides metadata.
8
10
  *
9
- * Legacy side-effect imports have been removed. If you need to add a judge, add
10
- * an agent file and (optionally) an evaluator script, then run:
11
- * - `npm run generate:agents` (to sync)
12
- * - `npm run validate:agents`
11
+ * The static imports guarantee that judges are always available, even in
12
+ * bundled environments (VS Code extension) where `agents/` is absent.
13
13
  */
14
14
  import { defaultRegistry } from "../judge-registry.js";
15
15
  import { loadAndRegisterAgents } from "../agent-loader.js";
16
16
  import { resolve, dirname } from "node:path";
17
17
  import { fileURLToPath } from "node:url";
18
+ // ─── Static side-effect imports (self-registering) ──────────────────────────
19
+ import "./accessibility.js";
20
+ import "./agent-instructions.js";
21
+ import "./ai-code-safety.js";
22
+ import "./api-contract.js";
23
+ import "./api-design.js";
24
+ import "./authentication.js";
25
+ import "./backwards-compatibility.js";
26
+ import "./caching.js";
27
+ import "./ci-cd.js";
28
+ import "./cloud-readiness.js";
29
+ import "./code-structure.js";
30
+ import "./compliance.js";
31
+ import "./concurrency.js";
32
+ import "./configuration-management.js";
33
+ import "./cost-effectiveness.js";
34
+ import "./cybersecurity.js";
35
+ import "./data-security.js";
36
+ import "./data-sovereignty.js";
37
+ import "./database.js";
38
+ import "./dependency-health.js";
39
+ import "./documentation.js";
40
+ import "./error-handling.js";
41
+ import "./ethics-bias.js";
42
+ import "./false-positive-review.js";
43
+ import "./framework-safety.js";
44
+ import "./hallucination-detection.js";
45
+ import "./iac-security.js";
46
+ import "./intent-alignment.js";
47
+ import "./internationalization.js";
48
+ import "./logging-privacy.js";
49
+ import "./logic-review.js";
50
+ import "./maintainability.js";
51
+ import "./model-fingerprint.js";
52
+ import "./multi-turn-coherence.js";
53
+ import "./observability.js";
54
+ import "./over-engineering.js";
55
+ import "./performance.js";
56
+ import "./portability.js";
57
+ import "./rate-limiting.js";
58
+ import "./reliability.js";
59
+ import "./scalability.js";
60
+ import "./security.js";
61
+ import "./software-practices.js";
62
+ import "./testing.js";
63
+ import "./ux.js";
18
64
  // Support both ESM (import.meta.url) and CJS (esbuild bundle) environments.
19
65
  const _importMetaUrl = typeof import.meta?.url === "string" ? import.meta.url : undefined;
20
66
  const __filename = _importMetaUrl ? fileURLToPath(_importMetaUrl) : "";
21
- const __dirname = __filename ? dirname(__filename) : process.cwd();
67
+ const __dirname = __filename ? dirname(__filename) : "";
22
68
  let agentsLoaded = false;
23
69
  function loadDefaultAgents() {
24
70
  if (agentsLoaded)
25
71
  return;
26
- const agentsDir = resolve(__dirname, "..", "..", "agents");
27
- loadAndRegisterAgents(agentsDir, defaultRegistry);
72
+ // Static side-effect imports above already registered all built-in judges.
73
+ // In ESM mode, also load from agents/ directory for metadata enrichment.
74
+ if (__dirname) {
75
+ try {
76
+ const agentsDir = resolve(__dirname, "..", "..", "agents");
77
+ loadAndRegisterAgents(agentsDir, defaultRegistry);
78
+ }
79
+ catch {
80
+ // agents/ directory may not exist — built-in judges are already loaded
81
+ }
82
+ }
28
83
  agentsLoaded = true;
29
84
  }
30
85
  // ─── Optional Agent Loader Integration ──────────────────────────────────────
@@ -42,9 +97,12 @@ export async function loadJudges() {
42
97
  * agents can augment or replace built-in judges. If a judge is already
43
98
  * registered, it is skipped.
44
99
  */
45
- export function loadAgentJudges(dir = resolve(__dirname, "..", "..", "agents")) {
100
+ export function loadAgentJudges(dir) {
101
+ const agentsDir = dir ?? (__dirname ? resolve(__dirname, "..", "..", "agents") : "");
102
+ if (!agentsDir)
103
+ return 0; // CJS bundle — no agents directory available
46
104
  agentsLoaded = false; // allow re-run to pick up new agents if dir changes
47
- const count = loadAndRegisterAgents(dir, defaultRegistry);
105
+ const count = loadAndRegisterAgents(agentsDir, defaultRegistry);
48
106
  agentsLoaded = true;
49
107
  return count;
50
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevinrabun/judges",
3
- "version": "3.115.3",
3
+ "version": "3.115.4",
4
4
  "description": "45 specialized judges that evaluate AI-generated code for security, cost, and quality.",
5
5
  "mcpName": "io.github.KevinRabun/judges",
6
6
  "type": "module",
package/server.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "url": "https://github.com/kevinrabun/judges",
8
8
  "source": "github"
9
9
  },
10
- "version": "3.115.3",
10
+ "version": "3.115.4",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "@kevinrabun/judges",
15
- "version": "3.115.3",
15
+ "version": "3.115.4",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }