@rigour-labs/core 1.7.0 → 2.1.0
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/context.test.d.ts +1 -0
- package/dist/context.test.js +61 -0
- package/dist/discovery.js +12 -19
- package/dist/environment.test.d.ts +1 -0
- package/dist/environment.test.js +97 -0
- package/dist/gates/ast-handlers/base.d.ts +12 -0
- package/dist/gates/ast-handlers/base.js +6 -0
- package/dist/gates/ast-handlers/python.d.ts +6 -0
- package/dist/gates/ast-handlers/python.js +64 -0
- package/dist/gates/ast-handlers/typescript.d.ts +9 -0
- package/dist/gates/ast-handlers/typescript.js +110 -0
- package/dist/gates/ast-handlers/universal.d.ts +8 -0
- package/dist/gates/ast-handlers/universal.js +156 -0
- package/dist/gates/ast.d.ts +1 -3
- package/dist/gates/ast.js +34 -110
- package/dist/gates/base.d.ts +4 -0
- package/dist/gates/base.js +1 -5
- package/dist/gates/content.js +9 -9
- package/dist/gates/context.d.ts +8 -0
- package/dist/gates/context.js +43 -0
- package/dist/gates/coverage.d.ts +8 -0
- package/dist/gates/coverage.js +62 -0
- package/dist/gates/dependency.js +7 -14
- package/dist/gates/environment.d.ts +8 -0
- package/dist/gates/environment.js +73 -0
- package/dist/gates/file.js +9 -9
- package/dist/gates/runner.d.ts +1 -1
- package/dist/gates/runner.js +41 -24
- package/dist/gates/safety.js +4 -8
- package/dist/gates/structure.js +6 -13
- package/dist/index.js +8 -26
- package/dist/services/context-engine.d.ts +22 -0
- package/dist/services/context-engine.js +78 -0
- package/dist/services/fix-packet-service.js +3 -7
- package/dist/services/state-service.js +9 -16
- package/dist/smoke.test.js +6 -8
- package/dist/templates/index.js +16 -6
- package/dist/types/fix-packet.js +22 -25
- package/dist/types/index.d.ts +151 -4
- package/dist/types/index.js +67 -56
- package/dist/utils/logger.js +8 -15
- package/dist/utils/scanner.js +13 -16
- package/package.json +6 -2
- package/src/context.test.ts +73 -0
- package/src/environment.test.ts +115 -0
- package/src/gates/ast-handlers/base.ts +13 -0
- package/src/gates/ast-handlers/python.ts +71 -0
- package/src/gates/ast-handlers/python_parser.py +60 -0
- package/src/gates/ast-handlers/typescript.ts +125 -0
- package/src/gates/ast-handlers/universal.ts +184 -0
- package/src/gates/ast.ts +32 -128
- package/src/gates/base.ts +4 -0
- package/src/gates/content.ts +5 -1
- package/src/gates/context.ts +55 -0
- package/src/gates/coverage.ts +70 -0
- package/src/gates/environment.ts +94 -0
- package/src/gates/file.ts +5 -1
- package/src/gates/runner.ts +27 -2
- package/src/services/context-engine.ts +104 -0
- package/src/templates/index.ts +13 -0
- package/src/types/index.ts +18 -0
- package/src/utils/scanner.ts +9 -4
package/dist/gates/safety.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const base_js_1 = require("./base.js");
|
|
5
|
-
const execa_1 = require("execa");
|
|
6
|
-
class SafetyGate extends base_js_1.Gate {
|
|
1
|
+
import { Gate } from './base.js';
|
|
2
|
+
import { execa } from 'execa';
|
|
3
|
+
export class SafetyGate extends Gate {
|
|
7
4
|
config;
|
|
8
5
|
constructor(config) {
|
|
9
6
|
super('safety-rail', 'Safety & Protection Rails');
|
|
@@ -18,7 +15,7 @@ class SafetyGate extends base_js_1.Gate {
|
|
|
18
15
|
try {
|
|
19
16
|
// Check for modified files in protected paths using git
|
|
20
17
|
// This is a "Safety Rail" - if an agent touched these, we fail.
|
|
21
|
-
const { stdout } = await
|
|
18
|
+
const { stdout } = await execa('git', ['status', '--porcelain'], { cwd: context.cwd });
|
|
22
19
|
const modifiedFiles = stdout.split('\n')
|
|
23
20
|
.filter(line => line.trim().length > 0)
|
|
24
21
|
.map(line => line.slice(3));
|
|
@@ -44,4 +41,3 @@ class SafetyGate extends base_js_1.Gate {
|
|
|
44
41
|
});
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
exports.SafetyGate = SafetyGate;
|
package/dist/gates/structure.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StructureGate = void 0;
|
|
7
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const base_js_1 = require("./base.js");
|
|
10
|
-
class StructureGate extends base_js_1.Gate {
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { Gate } from './base.js';
|
|
4
|
+
export class StructureGate extends Gate {
|
|
11
5
|
config;
|
|
12
6
|
constructor(config) {
|
|
13
7
|
super('structure-check', 'Project Structure');
|
|
@@ -16,8 +10,8 @@ class StructureGate extends base_js_1.Gate {
|
|
|
16
10
|
async run(context) {
|
|
17
11
|
const missing = [];
|
|
18
12
|
for (const file of this.config.requiredFiles) {
|
|
19
|
-
const filePath =
|
|
20
|
-
if (!(await
|
|
13
|
+
const filePath = path.join(context.cwd, file);
|
|
14
|
+
if (!(await fs.pathExists(filePath))) {
|
|
21
15
|
missing.push(file);
|
|
22
16
|
}
|
|
23
17
|
}
|
|
@@ -29,4 +23,3 @@ class StructureGate extends base_js_1.Gate {
|
|
|
29
23
|
return [];
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
|
-
exports.StructureGate = StructureGate;
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Gate = void 0;
|
|
18
|
-
__exportStar(require("./types/index.js"), exports);
|
|
19
|
-
__exportStar(require("./gates/runner.js"), exports);
|
|
20
|
-
__exportStar(require("./discovery.js"), exports);
|
|
21
|
-
__exportStar(require("./services/fix-packet-service.js"), exports);
|
|
22
|
-
__exportStar(require("./templates/index.js"), exports);
|
|
23
|
-
__exportStar(require("./types/fix-packet.js"), exports);
|
|
24
|
-
var base_js_1 = require("./gates/base.js");
|
|
25
|
-
Object.defineProperty(exports, "Gate", { enumerable: true, get: function () { return base_js_1.Gate; } });
|
|
26
|
-
__exportStar(require("./utils/logger.js"), exports);
|
|
1
|
+
export * from './types/index.js';
|
|
2
|
+
export * from './gates/runner.js';
|
|
3
|
+
export * from './discovery.js';
|
|
4
|
+
export * from './services/fix-packet-service.js';
|
|
5
|
+
export * from './templates/index.js';
|
|
6
|
+
export * from './types/fix-packet.js';
|
|
7
|
+
export { Gate } from './gates/base.js';
|
|
8
|
+
export * from './utils/logger.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Config } from '../types/index.js';
|
|
2
|
+
export interface ProjectAnchor {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'env' | 'naming' | 'import';
|
|
5
|
+
pattern: string;
|
|
6
|
+
confidence: number;
|
|
7
|
+
occurrences: number;
|
|
8
|
+
}
|
|
9
|
+
export interface GoldenRecord {
|
|
10
|
+
anchors: ProjectAnchor[];
|
|
11
|
+
metadata: {
|
|
12
|
+
scannedFiles: number;
|
|
13
|
+
detectedCasing: 'camelCase' | 'snake_case' | 'PascalCase' | 'unknown';
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare class ContextEngine {
|
|
17
|
+
private config;
|
|
18
|
+
constructor(config: Config);
|
|
19
|
+
discover(cwd: string): Promise<GoldenRecord>;
|
|
20
|
+
private mineEnvVars;
|
|
21
|
+
private incrementRegistry;
|
|
22
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { FileScanner } from '../utils/scanner.js';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
export class ContextEngine {
|
|
5
|
+
config;
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
async discover(cwd) {
|
|
10
|
+
const anchors = [];
|
|
11
|
+
const files = await FileScanner.findFiles({
|
|
12
|
+
cwd,
|
|
13
|
+
patterns: [
|
|
14
|
+
'**/*.{ts,js,py,yaml,yml,json}',
|
|
15
|
+
'.env*',
|
|
16
|
+
'**/.env*',
|
|
17
|
+
'**/package.json',
|
|
18
|
+
'**/Dockerfile',
|
|
19
|
+
'**/*.tf'
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
const limit = this.config.gates.context?.mining_depth || 100;
|
|
23
|
+
const samples = files.slice(0, limit);
|
|
24
|
+
const envVars = new Map();
|
|
25
|
+
let scannedFiles = 0;
|
|
26
|
+
for (const file of samples) {
|
|
27
|
+
try {
|
|
28
|
+
const content = await fs.readFile(path.join(cwd, file), 'utf-8');
|
|
29
|
+
scannedFiles++;
|
|
30
|
+
this.mineEnvVars(content, file, envVars);
|
|
31
|
+
}
|
|
32
|
+
catch (e) { }
|
|
33
|
+
}
|
|
34
|
+
console.log(`[ContextEngine] Discovered ${envVars.size} env anchors`);
|
|
35
|
+
// Convert envVars to anchors
|
|
36
|
+
for (const [name, count] of envVars.entries()) {
|
|
37
|
+
const confidence = count >= 2 ? 1 : 0.5;
|
|
38
|
+
anchors.push({
|
|
39
|
+
id: name,
|
|
40
|
+
type: 'env',
|
|
41
|
+
pattern: name,
|
|
42
|
+
occurrences: count,
|
|
43
|
+
confidence
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
anchors,
|
|
48
|
+
metadata: {
|
|
49
|
+
scannedFiles,
|
|
50
|
+
detectedCasing: 'unknown', // TODO: Implement casing discovery
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
mineEnvVars(content, file, registry) {
|
|
55
|
+
const isAnchorSource = file.includes('.env') || file.includes('yml') || file.includes('yaml');
|
|
56
|
+
if (isAnchorSource) {
|
|
57
|
+
const matches = content.matchAll(/^\s*([A-Z0-9_]+)\s*=/gm);
|
|
58
|
+
for (const match of matches) {
|
|
59
|
+
// Anchors from .env count for more initially
|
|
60
|
+
registry.set(match[1], (registry.get(match[1]) || 0) + 2);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Source code matches (process.env.VAR or process.env['VAR'])
|
|
64
|
+
const tsJsMatches = content.matchAll(/process\.env(?:\.([A-Z0-9_]+)|\[['"]([A-Z0-9_]+)['"]\])/g);
|
|
65
|
+
for (const match of tsJsMatches) {
|
|
66
|
+
const name = match[1] || match[2];
|
|
67
|
+
this.incrementRegistry(registry, name);
|
|
68
|
+
}
|
|
69
|
+
// Python matches (os.environ.get('VAR') or os.environ['VAR'])
|
|
70
|
+
const pyMatches = content.matchAll(/os\.environ(?:\.get\(|\[)['"]([A-Z0-9_]+)['"]/g);
|
|
71
|
+
for (const match of pyMatches) {
|
|
72
|
+
this.incrementRegistry(registry, match[1]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
incrementRegistry(registry, key) {
|
|
76
|
+
registry.set(key, (registry.get(key) || 0) + 1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FixPacketService = void 0;
|
|
4
|
-
const fix_packet_js_1 = require("../types/fix-packet.js");
|
|
5
|
-
class FixPacketService {
|
|
1
|
+
import { FixPacketV2Schema } from '../types/fix-packet.js';
|
|
2
|
+
export class FixPacketService {
|
|
6
3
|
generate(report, config) {
|
|
7
4
|
const violations = report.failures.map(f => ({
|
|
8
5
|
id: f.id,
|
|
@@ -27,7 +24,7 @@ class FixPacketService {
|
|
|
27
24
|
no_new_deps: true,
|
|
28
25
|
},
|
|
29
26
|
};
|
|
30
|
-
return
|
|
27
|
+
return FixPacketV2Schema.parse(packet);
|
|
31
28
|
}
|
|
32
29
|
inferSeverity(f) {
|
|
33
30
|
// High complexity or God objects are usually High severity
|
|
@@ -40,4 +37,3 @@ class FixPacketService {
|
|
|
40
37
|
return 'medium';
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
exports.FixPacketService = FixPacketService;
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StateService = void 0;
|
|
7
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
9
3
|
const STATE_DIR = '.rigour';
|
|
10
4
|
const STATE_FILE = 'state.json';
|
|
11
5
|
const CURRENT_VERSION = 1;
|
|
12
|
-
class StateService {
|
|
6
|
+
export class StateService {
|
|
13
7
|
statePath;
|
|
14
8
|
state;
|
|
15
9
|
constructor(cwd) {
|
|
16
|
-
this.statePath =
|
|
10
|
+
this.statePath = path.join(cwd, STATE_DIR, STATE_FILE);
|
|
17
11
|
this.state = this.load();
|
|
18
12
|
}
|
|
19
13
|
load() {
|
|
20
14
|
try {
|
|
21
|
-
if (
|
|
22
|
-
const content =
|
|
15
|
+
if (fs.existsSync(this.statePath)) {
|
|
16
|
+
const content = fs.readFileSync(this.statePath, 'utf-8');
|
|
23
17
|
return JSON.parse(content);
|
|
24
18
|
}
|
|
25
19
|
}
|
|
@@ -89,8 +83,8 @@ class StateService {
|
|
|
89
83
|
}
|
|
90
84
|
save() {
|
|
91
85
|
try {
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
fs.ensureDirSync(path.dirname(this.statePath));
|
|
87
|
+
fs.writeFileSync(this.statePath, JSON.stringify(this.state, null, 2));
|
|
94
88
|
}
|
|
95
89
|
catch {
|
|
96
90
|
// Silent fail - state is optional
|
|
@@ -102,11 +96,10 @@ class StateService {
|
|
|
102
96
|
clear() {
|
|
103
97
|
this.state = this.createEmpty();
|
|
104
98
|
try {
|
|
105
|
-
|
|
99
|
+
fs.removeSync(this.statePath);
|
|
106
100
|
}
|
|
107
101
|
catch {
|
|
108
102
|
// Silent fail
|
|
109
103
|
}
|
|
110
104
|
}
|
|
111
105
|
}
|
|
112
|
-
exports.StateService = StateService;
|
package/dist/smoke.test.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(0, vitest_1.describe)('GateRunner Smoke Test', () => {
|
|
6
|
-
(0, vitest_1.it)('should initialize with empty config', async () => {
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { GateRunner } from '../src/gates/runner.js';
|
|
3
|
+
describe('GateRunner Smoke Test', () => {
|
|
4
|
+
it('should initialize with empty config', async () => {
|
|
7
5
|
const config = {
|
|
8
6
|
version: 1,
|
|
9
7
|
commands: {},
|
|
@@ -13,7 +11,7 @@ const runner_js_1 = require("../src/gates/runner.js");
|
|
|
13
11
|
forbid_fixme: true,
|
|
14
12
|
},
|
|
15
13
|
};
|
|
16
|
-
const runner = new
|
|
17
|
-
|
|
14
|
+
const runner = new GateRunner(config);
|
|
15
|
+
expect(runner).toBeDefined();
|
|
18
16
|
});
|
|
19
17
|
});
|
package/dist/templates/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UNIVERSAL_CONFIG = exports.PARADIGM_TEMPLATES = exports.TEMPLATES = void 0;
|
|
4
|
-
exports.TEMPLATES = [
|
|
1
|
+
export const TEMPLATES = [
|
|
5
2
|
{
|
|
6
3
|
name: 'ui',
|
|
7
4
|
markers: [
|
|
@@ -92,7 +89,7 @@ exports.TEMPLATES = [
|
|
|
92
89
|
},
|
|
93
90
|
},
|
|
94
91
|
];
|
|
95
|
-
|
|
92
|
+
export const PARADIGM_TEMPLATES = [
|
|
96
93
|
{
|
|
97
94
|
name: 'oop',
|
|
98
95
|
markers: [
|
|
@@ -149,7 +146,7 @@ exports.PARADIGM_TEMPLATES = [
|
|
|
149
146
|
},
|
|
150
147
|
},
|
|
151
148
|
];
|
|
152
|
-
|
|
149
|
+
export const UNIVERSAL_CONFIG = {
|
|
153
150
|
version: 1,
|
|
154
151
|
commands: {},
|
|
155
152
|
gates: {
|
|
@@ -177,9 +174,22 @@ exports.UNIVERSAL_CONFIG = {
|
|
|
177
174
|
max_files_changed_per_cycle: 10,
|
|
178
175
|
protected_paths: ['.github/**', 'docs/**', 'rigour.yml'],
|
|
179
176
|
},
|
|
177
|
+
context: {
|
|
178
|
+
enabled: true,
|
|
179
|
+
sensitivity: 0.8,
|
|
180
|
+
mining_depth: 100,
|
|
181
|
+
ignored_patterns: [],
|
|
182
|
+
},
|
|
183
|
+
environment: {
|
|
184
|
+
enabled: true,
|
|
185
|
+
enforce_contracts: true,
|
|
186
|
+
tools: {},
|
|
187
|
+
required_env: [],
|
|
188
|
+
},
|
|
180
189
|
},
|
|
181
190
|
output: {
|
|
182
191
|
report_path: 'rigour-report.json',
|
|
183
192
|
},
|
|
184
193
|
planned: [],
|
|
194
|
+
ignore: [],
|
|
185
195
|
};
|
package/dist/types/fix-packet.js
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FixPacketV2Schema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
1
|
+
import { z } from 'zod';
|
|
5
2
|
/**
|
|
6
3
|
* Fix Packet v2 Schema
|
|
7
4
|
* Designed for high-fidelity communication with AI agents during the refinement loop.
|
|
8
5
|
*/
|
|
9
|
-
|
|
10
|
-
version:
|
|
11
|
-
goal:
|
|
12
|
-
violations:
|
|
13
|
-
id:
|
|
14
|
-
gate:
|
|
15
|
-
severity:
|
|
16
|
-
category:
|
|
17
|
-
title:
|
|
18
|
-
details:
|
|
19
|
-
files:
|
|
20
|
-
hint:
|
|
21
|
-
instructions:
|
|
22
|
-
metrics:
|
|
6
|
+
export const FixPacketV2Schema = z.object({
|
|
7
|
+
version: z.literal(2),
|
|
8
|
+
goal: z.string().default('Achieve PASS state for all quality gates'),
|
|
9
|
+
violations: z.array(z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
gate: z.string(),
|
|
12
|
+
severity: z.enum(['low', 'medium', 'high', 'critical']).default('medium'),
|
|
13
|
+
category: z.string().optional(),
|
|
14
|
+
title: z.string(),
|
|
15
|
+
details: z.string(),
|
|
16
|
+
files: z.array(z.string()).optional(),
|
|
17
|
+
hint: z.string().optional(),
|
|
18
|
+
instructions: z.array(z.string()).optional(), // Step-by-step fix instructions
|
|
19
|
+
metrics: z.record(z.any()).optional(), // e.g., { complexity: 15, max: 10 }
|
|
23
20
|
})),
|
|
24
|
-
constraints:
|
|
25
|
-
protected_paths:
|
|
26
|
-
do_not_touch:
|
|
27
|
-
max_files_changed:
|
|
28
|
-
no_new_deps:
|
|
29
|
-
allowed_dependencies:
|
|
30
|
-
paradigm:
|
|
21
|
+
constraints: z.object({
|
|
22
|
+
protected_paths: z.array(z.string()).optional(),
|
|
23
|
+
do_not_touch: z.array(z.string()).optional(), // Alias for protected_paths
|
|
24
|
+
max_files_changed: z.number().optional(),
|
|
25
|
+
no_new_deps: z.boolean().optional().default(true),
|
|
26
|
+
allowed_dependencies: z.array(z.string()).optional(),
|
|
27
|
+
paradigm: z.string().optional(), // 'oop', 'functional'
|
|
31
28
|
}).optional().default({}),
|
|
32
29
|
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -77,6 +77,38 @@ export declare const GatesSchema: z.ZodObject<{
|
|
|
77
77
|
max_files_changed_per_cycle?: number | undefined;
|
|
78
78
|
protected_paths?: string[] | undefined;
|
|
79
79
|
}>>>;
|
|
80
|
+
context: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
81
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
82
|
+
sensitivity: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
83
|
+
mining_depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
84
|
+
ignored_patterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
sensitivity: number;
|
|
88
|
+
mining_depth: number;
|
|
89
|
+
ignored_patterns: string[];
|
|
90
|
+
}, {
|
|
91
|
+
enabled?: boolean | undefined;
|
|
92
|
+
sensitivity?: number | undefined;
|
|
93
|
+
mining_depth?: number | undefined;
|
|
94
|
+
ignored_patterns?: string[] | undefined;
|
|
95
|
+
}>>>;
|
|
96
|
+
environment: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
97
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
98
|
+
enforce_contracts: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
99
|
+
tools: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
100
|
+
required_env: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
enforce_contracts: boolean;
|
|
104
|
+
tools: Record<string, string>;
|
|
105
|
+
required_env: string[];
|
|
106
|
+
}, {
|
|
107
|
+
enabled?: boolean | undefined;
|
|
108
|
+
enforce_contracts?: boolean | undefined;
|
|
109
|
+
tools?: Record<string, string> | undefined;
|
|
110
|
+
required_env?: string[] | undefined;
|
|
111
|
+
}>>>;
|
|
80
112
|
}, "strip", z.ZodTypeAny, {
|
|
81
113
|
max_file_lines: number;
|
|
82
114
|
forbid_todos: boolean;
|
|
@@ -107,6 +139,18 @@ export declare const GatesSchema: z.ZodObject<{
|
|
|
107
139
|
max_files_changed_per_cycle: number;
|
|
108
140
|
protected_paths: string[];
|
|
109
141
|
};
|
|
142
|
+
context: {
|
|
143
|
+
enabled: boolean;
|
|
144
|
+
sensitivity: number;
|
|
145
|
+
mining_depth: number;
|
|
146
|
+
ignored_patterns: string[];
|
|
147
|
+
};
|
|
148
|
+
environment: {
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
enforce_contracts: boolean;
|
|
151
|
+
tools: Record<string, string>;
|
|
152
|
+
required_env: string[];
|
|
153
|
+
};
|
|
110
154
|
}, {
|
|
111
155
|
max_file_lines?: number | undefined;
|
|
112
156
|
forbid_todos?: boolean | undefined;
|
|
@@ -137,6 +181,18 @@ export declare const GatesSchema: z.ZodObject<{
|
|
|
137
181
|
max_files_changed_per_cycle?: number | undefined;
|
|
138
182
|
protected_paths?: string[] | undefined;
|
|
139
183
|
} | undefined;
|
|
184
|
+
context?: {
|
|
185
|
+
enabled?: boolean | undefined;
|
|
186
|
+
sensitivity?: number | undefined;
|
|
187
|
+
mining_depth?: number | undefined;
|
|
188
|
+
ignored_patterns?: string[] | undefined;
|
|
189
|
+
} | undefined;
|
|
190
|
+
environment?: {
|
|
191
|
+
enabled?: boolean | undefined;
|
|
192
|
+
enforce_contracts?: boolean | undefined;
|
|
193
|
+
tools?: Record<string, string> | undefined;
|
|
194
|
+
required_env?: string[] | undefined;
|
|
195
|
+
} | undefined;
|
|
140
196
|
}>;
|
|
141
197
|
export declare const CommandsSchema: z.ZodObject<{
|
|
142
198
|
format: z.ZodOptional<z.ZodString>;
|
|
@@ -252,6 +308,38 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
252
308
|
max_files_changed_per_cycle?: number | undefined;
|
|
253
309
|
protected_paths?: string[] | undefined;
|
|
254
310
|
}>>>;
|
|
311
|
+
context: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
312
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
313
|
+
sensitivity: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
314
|
+
mining_depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
315
|
+
ignored_patterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
enabled: boolean;
|
|
318
|
+
sensitivity: number;
|
|
319
|
+
mining_depth: number;
|
|
320
|
+
ignored_patterns: string[];
|
|
321
|
+
}, {
|
|
322
|
+
enabled?: boolean | undefined;
|
|
323
|
+
sensitivity?: number | undefined;
|
|
324
|
+
mining_depth?: number | undefined;
|
|
325
|
+
ignored_patterns?: string[] | undefined;
|
|
326
|
+
}>>>;
|
|
327
|
+
environment: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
328
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
329
|
+
enforce_contracts: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
330
|
+
tools: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
331
|
+
required_env: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
332
|
+
}, "strip", z.ZodTypeAny, {
|
|
333
|
+
enabled: boolean;
|
|
334
|
+
enforce_contracts: boolean;
|
|
335
|
+
tools: Record<string, string>;
|
|
336
|
+
required_env: string[];
|
|
337
|
+
}, {
|
|
338
|
+
enabled?: boolean | undefined;
|
|
339
|
+
enforce_contracts?: boolean | undefined;
|
|
340
|
+
tools?: Record<string, string> | undefined;
|
|
341
|
+
required_env?: string[] | undefined;
|
|
342
|
+
}>>>;
|
|
255
343
|
}, "strip", z.ZodTypeAny, {
|
|
256
344
|
max_file_lines: number;
|
|
257
345
|
forbid_todos: boolean;
|
|
@@ -282,6 +370,18 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
282
370
|
max_files_changed_per_cycle: number;
|
|
283
371
|
protected_paths: string[];
|
|
284
372
|
};
|
|
373
|
+
context: {
|
|
374
|
+
enabled: boolean;
|
|
375
|
+
sensitivity: number;
|
|
376
|
+
mining_depth: number;
|
|
377
|
+
ignored_patterns: string[];
|
|
378
|
+
};
|
|
379
|
+
environment: {
|
|
380
|
+
enabled: boolean;
|
|
381
|
+
enforce_contracts: boolean;
|
|
382
|
+
tools: Record<string, string>;
|
|
383
|
+
required_env: string[];
|
|
384
|
+
};
|
|
285
385
|
}, {
|
|
286
386
|
max_file_lines?: number | undefined;
|
|
287
387
|
forbid_todos?: boolean | undefined;
|
|
@@ -312,6 +412,18 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
312
412
|
max_files_changed_per_cycle?: number | undefined;
|
|
313
413
|
protected_paths?: string[] | undefined;
|
|
314
414
|
} | undefined;
|
|
415
|
+
context?: {
|
|
416
|
+
enabled?: boolean | undefined;
|
|
417
|
+
sensitivity?: number | undefined;
|
|
418
|
+
mining_depth?: number | undefined;
|
|
419
|
+
ignored_patterns?: string[] | undefined;
|
|
420
|
+
} | undefined;
|
|
421
|
+
environment?: {
|
|
422
|
+
enabled?: boolean | undefined;
|
|
423
|
+
enforce_contracts?: boolean | undefined;
|
|
424
|
+
tools?: Record<string, string> | undefined;
|
|
425
|
+
required_env?: string[] | undefined;
|
|
426
|
+
} | undefined;
|
|
315
427
|
}>>>;
|
|
316
428
|
output: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
317
429
|
report_path: z.ZodDefault<z.ZodString>;
|
|
@@ -321,7 +433,9 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
321
433
|
report_path?: string | undefined;
|
|
322
434
|
}>>>;
|
|
323
435
|
planned: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
436
|
+
ignore: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
324
437
|
}, "strip", z.ZodTypeAny, {
|
|
438
|
+
ignore: string[];
|
|
325
439
|
version: number;
|
|
326
440
|
commands: {
|
|
327
441
|
format?: string | undefined;
|
|
@@ -359,6 +473,18 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
359
473
|
max_files_changed_per_cycle: number;
|
|
360
474
|
protected_paths: string[];
|
|
361
475
|
};
|
|
476
|
+
context: {
|
|
477
|
+
enabled: boolean;
|
|
478
|
+
sensitivity: number;
|
|
479
|
+
mining_depth: number;
|
|
480
|
+
ignored_patterns: string[];
|
|
481
|
+
};
|
|
482
|
+
environment: {
|
|
483
|
+
enabled: boolean;
|
|
484
|
+
enforce_contracts: boolean;
|
|
485
|
+
tools: Record<string, string>;
|
|
486
|
+
required_env: string[];
|
|
487
|
+
};
|
|
362
488
|
};
|
|
363
489
|
output: {
|
|
364
490
|
report_path: string;
|
|
@@ -367,6 +493,7 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
367
493
|
preset?: string | undefined;
|
|
368
494
|
paradigm?: string | undefined;
|
|
369
495
|
}, {
|
|
496
|
+
ignore?: string[] | undefined;
|
|
370
497
|
version?: number | undefined;
|
|
371
498
|
preset?: string | undefined;
|
|
372
499
|
paradigm?: string | undefined;
|
|
@@ -406,6 +533,18 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
406
533
|
max_files_changed_per_cycle?: number | undefined;
|
|
407
534
|
protected_paths?: string[] | undefined;
|
|
408
535
|
} | undefined;
|
|
536
|
+
context?: {
|
|
537
|
+
enabled?: boolean | undefined;
|
|
538
|
+
sensitivity?: number | undefined;
|
|
539
|
+
mining_depth?: number | undefined;
|
|
540
|
+
ignored_patterns?: string[] | undefined;
|
|
541
|
+
} | undefined;
|
|
542
|
+
environment?: {
|
|
543
|
+
enabled?: boolean | undefined;
|
|
544
|
+
enforce_contracts?: boolean | undefined;
|
|
545
|
+
tools?: Record<string, string> | undefined;
|
|
546
|
+
required_env?: string[] | undefined;
|
|
547
|
+
} | undefined;
|
|
409
548
|
} | undefined;
|
|
410
549
|
output?: {
|
|
411
550
|
report_path?: string | undefined;
|
|
@@ -415,6 +554,9 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
415
554
|
export type Gates = z.infer<typeof GatesSchema>;
|
|
416
555
|
export type Commands = z.infer<typeof CommandsSchema>;
|
|
417
556
|
export type Config = z.infer<typeof ConfigSchema>;
|
|
557
|
+
export type RawGates = z.input<typeof GatesSchema>;
|
|
558
|
+
export type RawCommands = z.input<typeof CommandsSchema>;
|
|
559
|
+
export type RawConfig = z.input<typeof ConfigSchema>;
|
|
418
560
|
export declare const StatusSchema: z.ZodEnum<["PASS", "FAIL", "SKIP", "ERROR"]>;
|
|
419
561
|
export type Status = z.infer<typeof StatusSchema>;
|
|
420
562
|
export declare const FailureSchema: z.ZodObject<{
|
|
@@ -461,12 +603,19 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
461
603
|
}>, "many">;
|
|
462
604
|
stats: z.ZodObject<{
|
|
463
605
|
duration_ms: z.ZodNumber;
|
|
606
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
464
607
|
}, "strip", z.ZodTypeAny, {
|
|
465
608
|
duration_ms: number;
|
|
609
|
+
score?: number | undefined;
|
|
466
610
|
}, {
|
|
467
611
|
duration_ms: number;
|
|
612
|
+
score?: number | undefined;
|
|
468
613
|
}>;
|
|
469
614
|
}, "strip", z.ZodTypeAny, {
|
|
615
|
+
stats: {
|
|
616
|
+
duration_ms: number;
|
|
617
|
+
score?: number | undefined;
|
|
618
|
+
};
|
|
470
619
|
status: "PASS" | "FAIL" | "SKIP" | "ERROR";
|
|
471
620
|
summary: Record<string, "PASS" | "FAIL" | "SKIP" | "ERROR">;
|
|
472
621
|
failures: {
|
|
@@ -476,10 +625,11 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
476
625
|
files?: string[] | undefined;
|
|
477
626
|
hint?: string | undefined;
|
|
478
627
|
}[];
|
|
628
|
+
}, {
|
|
479
629
|
stats: {
|
|
480
630
|
duration_ms: number;
|
|
631
|
+
score?: number | undefined;
|
|
481
632
|
};
|
|
482
|
-
}, {
|
|
483
633
|
status: "PASS" | "FAIL" | "SKIP" | "ERROR";
|
|
484
634
|
summary: Record<string, "PASS" | "FAIL" | "SKIP" | "ERROR">;
|
|
485
635
|
failures: {
|
|
@@ -489,8 +639,5 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
489
639
|
files?: string[] | undefined;
|
|
490
640
|
hint?: string | undefined;
|
|
491
641
|
}[];
|
|
492
|
-
stats: {
|
|
493
|
-
duration_ms: number;
|
|
494
|
-
};
|
|
495
642
|
}>;
|
|
496
643
|
export type Report = z.infer<typeof ReportSchema>;
|