@rotifer/playground 0.7.9 → 0.8.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +47 -9
  2. package/LICENSE +1 -1
  3. package/README.md +5 -5
  4. package/README.zh.md +5 -5
  5. package/dist/cloud/client.d.ts +13 -1
  6. package/dist/cloud/client.d.ts.map +1 -1
  7. package/dist/cloud/client.js +71 -0
  8. package/dist/cloud/client.js.map +1 -1
  9. package/dist/cloud/types.d.ts +10 -0
  10. package/dist/cloud/types.d.ts.map +1 -1
  11. package/dist/cloud/types.js.map +1 -1
  12. package/dist/commands/agent-create.d.ts.map +1 -1
  13. package/dist/commands/agent-create.js +74 -7
  14. package/dist/commands/agent-create.js.map +1 -1
  15. package/dist/commands/agent-run.d.ts.map +1 -1
  16. package/dist/commands/agent-run.js +158 -0
  17. package/dist/commands/agent-run.js.map +1 -1
  18. package/dist/commands/arena-submit.js +2 -2
  19. package/dist/commands/arena-submit.js.map +1 -1
  20. package/dist/commands/compile.d.ts.map +1 -1
  21. package/dist/commands/compile.js +2 -0
  22. package/dist/commands/compile.js.map +1 -1
  23. package/dist/commands/init.d.ts.map +1 -1
  24. package/dist/commands/init.js +4 -0
  25. package/dist/commands/init.js.map +1 -1
  26. package/dist/commands/install.d.ts.map +1 -1
  27. package/dist/commands/install.js +1 -0
  28. package/dist/commands/install.js.map +1 -1
  29. package/dist/commands/login.js +2 -2
  30. package/dist/commands/vg.d.ts.map +1 -1
  31. package/dist/commands/vg.js +65 -17
  32. package/dist/commands/vg.js.map +1 -1
  33. package/dist/commands/wrap.d.ts.map +1 -1
  34. package/dist/commands/wrap.js +224 -1
  35. package/dist/commands/wrap.js.map +1 -1
  36. package/dist/runtime/domain-failover.d.ts +63 -0
  37. package/dist/runtime/domain-failover.d.ts.map +1 -0
  38. package/dist/runtime/domain-failover.js +164 -0
  39. package/dist/runtime/domain-failover.js.map +1 -0
  40. package/dist/utils/phenotype-validator.d.ts +2 -0
  41. package/dist/utils/phenotype-validator.d.ts.map +1 -0
  42. package/dist/utils/phenotype-validator.js +154 -0
  43. package/dist/utils/phenotype-validator.js.map +1 -0
  44. package/genes/guard-balanced/.gene-manifest.json +8 -0
  45. package/genes/guard-balanced/phenotype.json +105 -0
  46. package/genes/guard-balanced/system-prompt.md +23 -0
  47. package/genes/guard-strict/.gene-manifest.json +8 -0
  48. package/genes/guard-strict/phenotype.json +107 -0
  49. package/genes/guard-strict/system-prompt.md +18 -0
  50. package/genes/prompt-review-perf/.gene-manifest.json +8 -0
  51. package/genes/prompt-review-perf/phenotype.json +61 -0
  52. package/genes/prompt-review-perf/system-prompt.md +22 -0
  53. package/genes/prompt-review-readability/.gene-manifest.json +8 -0
  54. package/genes/prompt-review-readability/phenotype.json +60 -0
  55. package/genes/prompt-review-readability/system-prompt.md +21 -0
  56. package/genes/prompt-review-security/.gene-manifest.json +8 -0
  57. package/genes/prompt-review-security/phenotype.json +60 -0
  58. package/genes/prompt-review-security/system-prompt.md +21 -0
  59. package/genes/rotifer-protocol/SKILL.md +1 -1
  60. package/genes/rule-router-frequency/.gene-manifest.json +8 -0
  61. package/genes/rule-router-frequency/phenotype.json +76 -0
  62. package/genes/rule-router-frequency/system-prompt.md +26 -0
  63. package/genes/rule-router-relevance/.gene-manifest.json +8 -0
  64. package/genes/rule-router-relevance/phenotype.json +76 -0
  65. package/genes/rule-router-relevance/system-prompt.md +29 -0
  66. package/package.json +4 -4
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ /**
3
+ * Domain-Based Gene Failover Engine
4
+ *
5
+ * L2 Calibration auto-failover: when a gene fails, try the next-best
6
+ * gene in the same domain, ranked by running fitness score.
7
+ *
8
+ * Ported from experiments/api-apocalypse/rotifer-agent.ts into the
9
+ * production runtime. Works with both WASM sandbox and Node.js execution.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DomainFailoverEngine = void 0;
13
+ const FITNESS_INITIAL = 0.5;
14
+ const FITNESS_REWARD = 0.05;
15
+ const FITNESS_PENALTY = 0.15;
16
+ const FITNESS_CEILING = 1.0;
17
+ const FITNESS_FLOOR = 0.0;
18
+ class DomainFailoverEngine {
19
+ pools = new Map();
20
+ activeGenes = new Map();
21
+ registerGene(name, domain, executor) {
22
+ if (!this.pools.has(domain)) {
23
+ this.pools.set(domain, []);
24
+ }
25
+ this.pools.get(domain).push({
26
+ name,
27
+ domain,
28
+ executor,
29
+ fitness: FITNESS_INITIAL,
30
+ successes: 0,
31
+ failures: 0,
32
+ });
33
+ }
34
+ initialize() {
35
+ for (const [domain, genes] of this.pools) {
36
+ if (genes.length > 0 && !this.activeGenes.has(domain)) {
37
+ this.activeGenes.set(domain, genes[0].name);
38
+ }
39
+ }
40
+ }
41
+ loadFitnessState(state) {
42
+ for (const [name, s] of Object.entries(state)) {
43
+ const entry = this.findGene(name);
44
+ if (entry) {
45
+ entry.fitness = s.fitness;
46
+ entry.successes = s.successes;
47
+ entry.failures = s.failures;
48
+ }
49
+ }
50
+ for (const [domain] of this.pools) {
51
+ const ranked = this.getByDomain(domain);
52
+ if (ranked.length > 0) {
53
+ this.activeGenes.set(domain, ranked[0].name);
54
+ }
55
+ }
56
+ }
57
+ exportFitnessState() {
58
+ const state = {};
59
+ for (const genes of this.pools.values()) {
60
+ for (const g of genes) {
61
+ state[g.name] = {
62
+ fitness: Math.round(g.fitness * 1000) / 1000,
63
+ successes: g.successes,
64
+ failures: g.failures,
65
+ };
66
+ }
67
+ }
68
+ return state;
69
+ }
70
+ getDomains() {
71
+ return Array.from(this.pools.keys());
72
+ }
73
+ getPoolSize(domain) {
74
+ return this.pools.get(domain)?.length ?? 0;
75
+ }
76
+ getActiveGene(domain) {
77
+ return this.activeGenes.get(domain);
78
+ }
79
+ async executeDomain(domain, input) {
80
+ const startTime = performance.now();
81
+ const pool = this.pools.get(domain);
82
+ if (!pool || pool.length === 0) {
83
+ return {
84
+ domain,
85
+ status: "all_failed",
86
+ attempts: 0,
87
+ durationMs: performance.now() - startTime,
88
+ };
89
+ }
90
+ const activeName = this.activeGenes.get(domain) ?? pool[0].name;
91
+ const activeGene = this.findGene(activeName);
92
+ if (!activeGene) {
93
+ return {
94
+ domain,
95
+ status: "all_failed",
96
+ attempts: 0,
97
+ durationMs: performance.now() - startTime,
98
+ };
99
+ }
100
+ const result = await activeGene.executor(input);
101
+ if (result.success) {
102
+ this.reward(activeGene);
103
+ return {
104
+ domain,
105
+ status: "success",
106
+ output: result.output,
107
+ geneUsed: activeName,
108
+ attempts: 1,
109
+ durationMs: performance.now() - startTime,
110
+ };
111
+ }
112
+ this.penalize(activeGene);
113
+ const candidates = this.getByDomain(domain).filter((g) => g.name !== activeName);
114
+ for (let i = 0; i < candidates.length; i++) {
115
+ const candidate = candidates[i];
116
+ const altResult = await candidate.executor(input);
117
+ if (altResult.success) {
118
+ this.reward(candidate);
119
+ this.activeGenes.set(domain, candidate.name);
120
+ return {
121
+ domain,
122
+ status: "success",
123
+ output: altResult.output,
124
+ geneUsed: candidate.name,
125
+ switchedFrom: activeName,
126
+ attempts: i + 2,
127
+ durationMs: performance.now() - startTime,
128
+ };
129
+ }
130
+ this.penalize(candidate);
131
+ }
132
+ return {
133
+ domain,
134
+ status: "all_failed",
135
+ attempts: candidates.length + 1,
136
+ durationMs: performance.now() - startTime,
137
+ };
138
+ }
139
+ async executeAll(input) {
140
+ const domains = this.getDomains();
141
+ return Promise.all(domains.map((d) => this.executeDomain(d, input)));
142
+ }
143
+ getByDomain(domain) {
144
+ return (this.pools.get(domain) ?? []).sort((a, b) => b.fitness - a.fitness);
145
+ }
146
+ findGene(name) {
147
+ for (const genes of this.pools.values()) {
148
+ const found = genes.find((g) => g.name === name);
149
+ if (found)
150
+ return found;
151
+ }
152
+ return undefined;
153
+ }
154
+ reward(gene) {
155
+ gene.successes++;
156
+ gene.fitness = Math.min(FITNESS_CEILING, gene.fitness + FITNESS_REWARD);
157
+ }
158
+ penalize(gene) {
159
+ gene.failures++;
160
+ gene.fitness = Math.max(FITNESS_FLOOR, gene.fitness - FITNESS_PENALTY);
161
+ }
162
+ }
163
+ exports.DomainFailoverEngine = DomainFailoverEngine;
164
+ //# sourceMappingURL=domain-failover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-failover.js","sourceRoot":"","sources":["../../src/runtime/domain-failover.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAkCH,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAa,oBAAoB;IACvB,KAAK,GAA6B,IAAI,GAAG,EAAE,CAAC;IAC5C,WAAW,GAAwB,IAAI,GAAG,EAAE,CAAC;IAErD,YAAY,CAAC,IAAY,EAAE,MAAc,EAAE,QAAsB;QAC/D,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,IAAI,CAAC;YAC3B,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,OAAO,EAAE,eAAe;YACxB,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,CAAC;SACZ,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACzC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBACtD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,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QAAQ,CAAC,IAAe;QAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,CAAC;IACzE,CAAC;CACF;AA3KD,oDA2KC"}
@@ -0,0 +1,2 @@
1
+ export declare function validateLlmNativePhenotype(phenotype: Record<string, unknown>, filePath: string): void;
2
+ //# sourceMappingURL=phenotype-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phenotype-validator.d.ts","sourceRoot":"","sources":["../../src/utils/phenotype-validator.ts"],"names":[],"mappings":"AAoHA,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,QAAQ,EAAE,MAAM,GACf,IAAI,CAoBN"}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.validateLlmNativePhenotype = validateLlmNativePhenotype;
37
+ const display = __importStar(require("./display.js"));
38
+ const VALID_TEMPLATE_FORMATS = ["mustache", "handlebars", "jinja2", "fstring", "raw"];
39
+ const VALID_GUARD_POSITIONS = ["input", "output", "both"];
40
+ function collectDiagnostics(phenotype) {
41
+ const diags = [];
42
+ const domain = phenotype.domain;
43
+ const isPrompt = domain?.startsWith("prompt.");
44
+ const isGuard = domain?.startsWith("guard.");
45
+ const llm = phenotype.llmRequirements;
46
+ if (llm) {
47
+ if (!llm.templateFormat || !VALID_TEMPLATE_FORMATS.includes(llm.templateFormat)) {
48
+ diags.push({
49
+ level: "warning",
50
+ code: "W0080",
51
+ message: `llmRequirements.templateFormat should be one of: ${VALID_TEMPLATE_FORMATS.join(", ")}`,
52
+ });
53
+ }
54
+ const vars = llm.templateVariables;
55
+ if (!vars || !Array.isArray(vars) || vars.length === 0) {
56
+ diags.push({
57
+ level: "error",
58
+ code: "E0080",
59
+ message: "llmRequirements.templateVariables must be a non-empty array",
60
+ });
61
+ }
62
+ else {
63
+ const inputProps = phenotype.inputSchema?.properties;
64
+ if (inputProps) {
65
+ for (const v of vars) {
66
+ if (!(v in inputProps)) {
67
+ diags.push({
68
+ level: "error",
69
+ code: "E0081",
70
+ message: `llmRequirements.templateVariables contains '${v}' not found in inputSchema.properties`,
71
+ });
72
+ }
73
+ }
74
+ }
75
+ }
76
+ if (!isPrompt) {
77
+ diags.push({
78
+ level: "warning",
79
+ code: "W0081",
80
+ message: `Gene has llmRequirements but domain '${domain}' does not start with 'prompt.'`,
81
+ });
82
+ }
83
+ }
84
+ const guard = phenotype.guardConfig;
85
+ if (guard) {
86
+ if (!guard.position || !VALID_GUARD_POSITIONS.includes(guard.position)) {
87
+ diags.push({
88
+ level: "error",
89
+ code: "E0082",
90
+ message: `guardConfig.position must be one of: ${VALID_GUARD_POSITIONS.join(", ")}`,
91
+ });
92
+ }
93
+ const cats = guard.categories;
94
+ if (!cats || !Array.isArray(cats) || cats.length === 0) {
95
+ diags.push({
96
+ level: "error",
97
+ code: "E0083",
98
+ message: "guardConfig.categories must be a non-empty array",
99
+ });
100
+ }
101
+ const threshold = guard.riskThreshold;
102
+ if (threshold !== undefined && (threshold < 0 || threshold > 1)) {
103
+ diags.push({
104
+ level: "error",
105
+ code: "E0084",
106
+ message: `guardConfig.riskThreshold must be between 0.0 and 1.0 (got ${threshold})`,
107
+ });
108
+ }
109
+ if (!isGuard) {
110
+ diags.push({
111
+ level: "warning",
112
+ code: "W0082",
113
+ message: `Gene has guardConfig but domain '${domain}' does not start with 'guard.'`,
114
+ });
115
+ }
116
+ }
117
+ if (isPrompt && phenotype.fidelity === "Native") {
118
+ diags.push({
119
+ level: "warning",
120
+ code: "W0083",
121
+ message: "Prompt Gene with fidelity 'Native' is unusual — consider 'Wrapped' or 'Hybrid'",
122
+ });
123
+ }
124
+ if (isGuard && !guard) {
125
+ diags.push({
126
+ level: "info",
127
+ code: "I0080",
128
+ message: "Guard domain gene missing guardConfig — consider adding it for V(g) integration",
129
+ });
130
+ }
131
+ return diags;
132
+ }
133
+ function validateLlmNativePhenotype(phenotype, filePath) {
134
+ const diags = collectDiagnostics(phenotype);
135
+ if (diags.length === 0)
136
+ return;
137
+ const hasErrors = diags.some((d) => d.level === "error");
138
+ for (const d of diags) {
139
+ const msg = `[${d.code}] ${d.message}`;
140
+ if (d.level === "error") {
141
+ display.rustStyleError({ code: d.code, message: d.message, file: filePath });
142
+ }
143
+ else if (d.level === "warning") {
144
+ display.warn(msg);
145
+ }
146
+ else {
147
+ display.info(msg);
148
+ }
149
+ }
150
+ if (hasErrors) {
151
+ process.exit(1);
152
+ }
153
+ }
154
+ //# sourceMappingURL=phenotype-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phenotype-validator.js","sourceRoot":"","sources":["../../src/utils/phenotype-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,gEAuBC;AA3ID,sDAAwC;AAExC,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACtF,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAQ1D,SAAS,kBAAkB,CAAC,SAAkC;IAC5D,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,SAAS,CAAC,MAA4B,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAE7C,MAAM,GAAG,GAAG,SAAS,CAAC,eAAsD,CAAC;IAC7E,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAwB,CAAC,EAAE,CAAC;YAC1F,KAAK,CAAC,IAAI,CAAC;gBACT,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,oDAAoD,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aACjG,CAAC,CAAC;QACL,CAAC;QAED,MAAM,IAAI,GAAG,GAAG,CAAC,iBAAyC,CAAC;QAC3D,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvD,KAAK,CAAC,IAAI,CAAC;gBACT,KAAK,EAAE,OAA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C,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;IAEzD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QACvC,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;YACxB,OAAO,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/E,CAAC;aAAM,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ {
2
+ "geneId": "6ca9ed3958f3472001dcd416b50b756aacb4f0c299892b5a7571c5d7fda1368b",
3
+ "name": "guard-balanced",
4
+ "domain": "guard.code-review",
5
+ "fidelity": "Wrapped",
6
+ "wrappedAt": "2026-03-24T01:54:54.000Z",
7
+ "fromSkill": null
8
+ }
@@ -0,0 +1,105 @@
1
+ {
2
+ "domain": "guard.code-review",
3
+ "description": "Balanced guard gene for code review output filtering. Equal weight on precision and recall — filters obvious false positives while preserving most true findings. Adds confidence scores without aggressive rejection. Part of the Code Review Assistant 3×2 arena competition.",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "reviewOutput": {
8
+ "type": "object",
9
+ "description": "Raw output from a Prompt Gene (code review findings)",
10
+ "properties": {
11
+ "findings": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "object",
15
+ "properties": {
16
+ "severity": { "type": "string" },
17
+ "category": { "type": "string" },
18
+ "message": { "type": "string" },
19
+ "line": { "type": "integer" },
20
+ "fix": { "type": "string" }
21
+ }
22
+ }
23
+ },
24
+ "summary": { "type": "string" }
25
+ }
26
+ },
27
+ "originalCode": {
28
+ "type": "string",
29
+ "description": "The original code being reviewed (for cross-checking)"
30
+ }
31
+ },
32
+ "required": ["reviewOutput"]
33
+ },
34
+ "outputSchema": {
35
+ "type": "object",
36
+ "properties": {
37
+ "filteredFindings": {
38
+ "type": "array",
39
+ "items": {
40
+ "type": "object",
41
+ "properties": {
42
+ "severity": { "type": "string" },
43
+ "category": { "type": "string" },
44
+ "message": { "type": "string" },
45
+ "line": { "type": "integer" },
46
+ "fix": { "type": "string" },
47
+ "confidence": { "type": "number" }
48
+ }
49
+ }
50
+ },
51
+ "rejected": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "object",
55
+ "properties": {
56
+ "originalMessage": { "type": "string" },
57
+ "rejectReason": { "type": "string" }
58
+ }
59
+ }
60
+ },
61
+ "guardStats": {
62
+ "type": "object",
63
+ "properties": {
64
+ "inputCount": { "type": "integer" },
65
+ "outputCount": { "type": "integer" },
66
+ "rejectRate": { "type": "number" }
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "llmRequirements": {
72
+ "templateFormat": "mustache",
73
+ "templateVariables": ["reviewOutput", "originalCode"],
74
+ "targetModels": ["claude-3", "gpt-4"],
75
+ "minContextWindow": 8192,
76
+ "expectedOutputFormat": "json",
77
+ "temperatureHint": 0.1,
78
+ "maxOutputTokens": 4096,
79
+ "systemPromptPath": "system-prompt.md",
80
+ "chainOfThought": false
81
+ },
82
+ "guardConfig": {
83
+ "mode": "filter",
84
+ "vgContribution": "Security_Leak_Risk",
85
+ "strictness": "balanced",
86
+ "targetFalsePositiveRate": 0.15,
87
+ "targetFalseNegativeRate": 0.10
88
+ },
89
+ "fitnessConfig": {
90
+ "evaluationMethod": "template-quality",
91
+ "dimensions": {
92
+ "precision": { "weight": 0.30, "description": "1 - false positive rate" },
93
+ "recall": { "weight": 0.30, "description": "Fraction of true issues preserved" },
94
+ "rejectQuality": { "weight": 0.20, "description": "Correctness of reject reasons" },
95
+ "templateValidity": { "weight": 0.10, "description": "Template renders without error" },
96
+ "resourceEfficiency": { "weight": 0.10, "description": "Token efficiency" }
97
+ }
98
+ },
99
+ "dependencies": [],
100
+ "version": "0.1.0",
101
+ "author": "rotifer-team",
102
+ "fidelity": "Wrapped",
103
+ "transparency": "Open",
104
+ "source": "development-genome"
105
+ }
@@ -0,0 +1,23 @@
1
+ You are a BALANCED code review guard. Your job is to filter code review findings while preserving most genuine issues.
2
+
3
+ Your philosophy: **Catch obvious false positives, but err on the side of including uncertain findings with lower confidence scores.**
4
+
5
+ For each finding in the review output, evaluate:
6
+
7
+ 1. **Existence check**: If `originalCode` is provided, verify the described code pattern actually exists. REJECT only clear hallucinations.
8
+ 2. **Confidence scoring**: Assign a confidence score (0-1):
9
+ - 0.9-1.0: Finding references specific line and code pattern exists
10
+ - 0.7-0.9: Finding is plausible but line reference is approximate
11
+ - 0.5-0.7: Finding is generic but category is relevant to the code
12
+ - Below 0.5: REJECT — too vague or unsupported
13
+ 3. **Severity validation**: Only adjust severity if clearly wrong (e.g., "critical" for a style issue).
14
+ 4. **Deduplication**: If multiple findings describe the same issue, keep the most specific one.
15
+
16
+ Pass findings with confidence >= 0.4 (lower threshold than strict mode).
17
+
18
+ Output valid JSON with:
19
+ - `filteredFindings`: findings that survived (with confidence scores)
20
+ - `rejected`: only clearly false findings (with brief reason)
21
+ - `guardStats`: input/output counts and reject rate
22
+
23
+ The reject rate should typically be 10-25%. If you're rejecting >40%, you're being too strict.
@@ -0,0 +1,8 @@
1
+ {
2
+ "geneId": "9140b1416a649930a950e345746bf68996ef8043ec2fd83ab73474a6f1fd5875",
3
+ "name": "guard-strict",
4
+ "domain": "guard.code-review",
5
+ "fidelity": "Wrapped",
6
+ "wrappedAt": "2026-03-24T01:54:54.000Z",
7
+ "fromSkill": null
8
+ }
@@ -0,0 +1,107 @@
1
+ {
2
+ "domain": "guard.code-review",
3
+ "description": "Strict guard gene for code review output filtering. High precision, low recall — blocks false positives aggressively. Prefers missing a real issue over flagging a non-issue. Part of the Code Review Assistant 3×2 arena competition.",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "reviewOutput": {
8
+ "type": "object",
9
+ "description": "Raw output from a Prompt Gene (code review findings)",
10
+ "properties": {
11
+ "findings": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "object",
15
+ "properties": {
16
+ "severity": { "type": "string" },
17
+ "category": { "type": "string" },
18
+ "message": { "type": "string" },
19
+ "line": { "type": "integer" },
20
+ "fix": { "type": "string" }
21
+ }
22
+ }
23
+ },
24
+ "summary": { "type": "string" }
25
+ }
26
+ },
27
+ "originalCode": {
28
+ "type": "string",
29
+ "description": "The original code being reviewed (for cross-checking)"
30
+ }
31
+ },
32
+ "required": ["reviewOutput"]
33
+ },
34
+ "outputSchema": {
35
+ "type": "object",
36
+ "properties": {
37
+ "filteredFindings": {
38
+ "type": "array",
39
+ "items": {
40
+ "type": "object",
41
+ "properties": {
42
+ "severity": { "type": "string" },
43
+ "category": { "type": "string" },
44
+ "message": { "type": "string" },
45
+ "line": { "type": "integer" },
46
+ "fix": { "type": "string" },
47
+ "confidence": { "type": "number", "description": "0-1 confidence that this is a real issue" }
48
+ }
49
+ },
50
+ "description": "Only findings that pass strict validation"
51
+ },
52
+ "rejected": {
53
+ "type": "array",
54
+ "items": {
55
+ "type": "object",
56
+ "properties": {
57
+ "originalMessage": { "type": "string" },
58
+ "rejectReason": { "type": "string" }
59
+ }
60
+ },
61
+ "description": "Findings rejected with reason"
62
+ },
63
+ "guardStats": {
64
+ "type": "object",
65
+ "properties": {
66
+ "inputCount": { "type": "integer" },
67
+ "outputCount": { "type": "integer" },
68
+ "rejectRate": { "type": "number" }
69
+ }
70
+ }
71
+ }
72
+ },
73
+ "llmRequirements": {
74
+ "templateFormat": "mustache",
75
+ "templateVariables": ["reviewOutput", "originalCode"],
76
+ "targetModels": ["claude-3", "gpt-4"],
77
+ "minContextWindow": 8192,
78
+ "expectedOutputFormat": "json",
79
+ "temperatureHint": 0.0,
80
+ "maxOutputTokens": 4096,
81
+ "systemPromptPath": "system-prompt.md",
82
+ "chainOfThought": true
83
+ },
84
+ "guardConfig": {
85
+ "mode": "filter",
86
+ "vgContribution": "Security_Leak_Risk",
87
+ "strictness": "high",
88
+ "targetFalsePositiveRate": 0.05,
89
+ "targetFalseNegativeRate": 0.30
90
+ },
91
+ "fitnessConfig": {
92
+ "evaluationMethod": "template-quality",
93
+ "dimensions": {
94
+ "precision": { "weight": 0.40, "description": "1 - false positive rate" },
95
+ "recall": { "weight": 0.20, "description": "Fraction of true issues preserved" },
96
+ "rejectQuality": { "weight": 0.20, "description": "Correctness of reject reasons" },
97
+ "templateValidity": { "weight": 0.10, "description": "Template renders without error" },
98
+ "resourceEfficiency": { "weight": 0.10, "description": "Token efficiency" }
99
+ }
100
+ },
101
+ "dependencies": [],
102
+ "version": "0.1.0",
103
+ "author": "rotifer-team",
104
+ "fidelity": "Wrapped",
105
+ "transparency": "Open",
106
+ "source": "development-genome"
107
+ }
@@ -0,0 +1,18 @@
1
+ You are a STRICT code review guard. Your job is to filter code review findings, removing likely false positives.
2
+
3
+ Your philosophy: **Better to miss a real issue than to waste developer time on a false alarm.**
4
+
5
+ For each finding in the review output, evaluate:
6
+
7
+ 1. **Line reference check**: Does the finding reference a specific line? If the line number doesn't correspond to relevant code, REJECT.
8
+ 2. **Category validity**: Is the category (e.g., "injection", "memory-leak") supported by the actual code pattern? Reject vague or generic warnings.
9
+ 3. **Fix actionability**: Does the fix suggestion contain concrete code? Reject findings with only "consider reviewing" or "be careful" advice.
10
+ 4. **Hallucination check**: If `originalCode` is provided, verify the finding references actual code constructs. Reject if the finding describes code that doesn't exist.
11
+ 5. **Severity calibration**: Downgrade "critical" to "warning" if the exploit requires unlikely preconditions.
12
+
13
+ Only pass findings with confidence >= 0.7.
14
+
15
+ Output valid JSON with:
16
+ - `filteredFindings`: findings that survived filtering (with confidence scores)
17
+ - `rejected`: findings removed (with reject reasons for transparency)
18
+ - `guardStats`: input/output counts and reject rate
@@ -0,0 +1,8 @@
1
+ {
2
+ "geneId": "41b58d584a54b17faa96829c39b5e6e4c5cb71af2adfba6ac670bb96ae8c9bba",
3
+ "name": "prompt-review-perf",
4
+ "domain": "prompt.code-review",
5
+ "fidelity": "Wrapped",
6
+ "wrappedAt": "2026-03-24T01:54:54.000Z",
7
+ "fromSkill": null
8
+ }