@codeledger/cli 0.6.3 → 0.6.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.
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +78 -2
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/policy/schema.d.ts.map +1 -1
- package/dist/policy/schema.js +1 -0
- package/dist/policy/schema.js.map +1 -1
- package/dist/review-intelligence/companion-check.d.ts +28 -0
- package/dist/review-intelligence/companion-check.d.ts.map +1 -0
- package/dist/review-intelligence/companion-check.js +71 -0
- package/dist/review-intelligence/companion-check.js.map +1 -0
- package/dist/review-intelligence/detectors/outbound-io.d.ts +14 -0
- package/dist/review-intelligence/detectors/outbound-io.d.ts.map +1 -0
- package/dist/review-intelligence/detectors/outbound-io.js +122 -0
- package/dist/review-intelligence/detectors/outbound-io.js.map +1 -0
- package/dist/review-intelligence/detectors/platform-helpers.d.ts +15 -0
- package/dist/review-intelligence/detectors/platform-helpers.d.ts.map +1 -0
- package/dist/review-intelligence/detectors/platform-helpers.js +171 -0
- package/dist/review-intelligence/detectors/platform-helpers.js.map +1 -0
- package/dist/review-intelligence/detectors/runtime-validation.d.ts +10 -0
- package/dist/review-intelligence/detectors/runtime-validation.d.ts.map +1 -0
- package/dist/review-intelligence/detectors/runtime-validation.js +109 -0
- package/dist/review-intelligence/detectors/runtime-validation.js.map +1 -0
- package/dist/review-intelligence/index.d.ts +17 -0
- package/dist/review-intelligence/index.d.ts.map +1 -0
- package/dist/review-intelligence/index.js +90 -0
- package/dist/review-intelligence/index.js.map +1 -0
- package/dist/review-intelligence/invariants.d.ts +10 -0
- package/dist/review-intelligence/invariants.d.ts.map +1 -0
- package/dist/review-intelligence/invariants.js +29 -0
- package/dist/review-intelligence/invariants.js.map +1 -0
- package/dist/review-intelligence/output.d.ts +25 -0
- package/dist/review-intelligence/output.d.ts.map +1 -0
- package/dist/review-intelligence/output.js +116 -0
- package/dist/review-intelligence/output.js.map +1 -0
- package/dist/review-intelligence/repair-guidance.d.ts +11 -0
- package/dist/review-intelligence/repair-guidance.d.ts.map +1 -0
- package/dist/review-intelligence/repair-guidance.js +91 -0
- package/dist/review-intelligence/repair-guidance.js.map +1 -0
- package/dist/review-intelligence/severity.d.ts +10 -0
- package/dist/review-intelligence/severity.d.ts.map +1 -0
- package/dist/review-intelligence/severity.js +36 -0
- package/dist/review-intelligence/severity.js.map +1 -0
- package/dist/review-intelligence/standards-discovery.d.ts +12 -0
- package/dist/review-intelligence/standards-discovery.d.ts.map +1 -0
- package/dist/review-intelligence/standards-discovery.js +221 -0
- package/dist/review-intelligence/standards-discovery.js.map +1 -0
- package/dist/review-intelligence/triggers.d.ts +15 -0
- package/dist/review-intelligence/triggers.d.ts.map +1 -0
- package/dist/review-intelligence/triggers.js +104 -0
- package/dist/review-intelligence/triggers.js.map +1 -0
- package/dist/review-intelligence/types.d.ts +137 -0
- package/dist/review-intelligence/types.d.ts.map +1 -0
- package/dist/review-intelligence/types.js +3 -0
- package/dist/review-intelligence/types.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/** Severity levels for review intelligence findings */
|
|
2
|
+
export type ReviewSeverity = 'P0' | 'P1' | 'P2' | 'P3';
|
|
3
|
+
/** Categories of review intelligence findings */
|
|
4
|
+
export type FindingCategory = 'runtime_validation' | 'outbound_io' | 'platform_helpers';
|
|
5
|
+
/** Confidence level of a finding */
|
|
6
|
+
export type FindingConfidence = 'high' | 'medium' | 'low';
|
|
7
|
+
/** A trigger detected in source code */
|
|
8
|
+
export interface DetectedTrigger {
|
|
9
|
+
/** Type of trigger pattern found */
|
|
10
|
+
type: TriggerType;
|
|
11
|
+
/** File where trigger was found */
|
|
12
|
+
file: string;
|
|
13
|
+
/** Line number (1-based) */
|
|
14
|
+
line: number;
|
|
15
|
+
/** The matched source text */
|
|
16
|
+
matched_text: string;
|
|
17
|
+
/** Additional context about the trigger */
|
|
18
|
+
context?: string;
|
|
19
|
+
}
|
|
20
|
+
export type TriggerType = 'fastify_route' | 'typed_route_body' | 'typed_route_params' | 'typed_route_query' | 'fetch_call' | 'axios_call' | 'http_request' | 'raw_error_response' | 'redis_cache_key' | 'circuit_breaker';
|
|
21
|
+
/** A companion safeguard expected alongside a trigger */
|
|
22
|
+
export interface ExpectedCompanion {
|
|
23
|
+
/** What kind of companion is expected */
|
|
24
|
+
type: CompanionType;
|
|
25
|
+
/** Human-readable description of what is expected */
|
|
26
|
+
description: string;
|
|
27
|
+
/** Whether the companion was found */
|
|
28
|
+
found: boolean;
|
|
29
|
+
/** Where the companion was found, if present */
|
|
30
|
+
evidence?: string;
|
|
31
|
+
}
|
|
32
|
+
export type CompanionType = 'zod_validation' | 'ajv_validation' | 'fastify_schema' | 'abort_controller' | 'timeout_config' | 'sanctioned_wrapper' | 'shared_error_helper' | 'shared_cache_helper' | 'shared_middleware';
|
|
33
|
+
/** A discovered repository standard (helper, wrapper, pattern) */
|
|
34
|
+
export interface RepoStandard {
|
|
35
|
+
/** Name of the helper/wrapper/pattern */
|
|
36
|
+
helper_name: string;
|
|
37
|
+
/** File paths where this standard is defined or commonly used */
|
|
38
|
+
example_paths: string[];
|
|
39
|
+
/** Short recommendation text */
|
|
40
|
+
recommendation: string;
|
|
41
|
+
/** How many times this pattern is used in the repo */
|
|
42
|
+
usage_count: number;
|
|
43
|
+
}
|
|
44
|
+
/** A review intelligence finding */
|
|
45
|
+
export interface ReviewFinding {
|
|
46
|
+
/** Unique rule identifier */
|
|
47
|
+
rule_id: string;
|
|
48
|
+
/** Human-readable title */
|
|
49
|
+
title: string;
|
|
50
|
+
/** Severity level */
|
|
51
|
+
severity: ReviewSeverity;
|
|
52
|
+
/** Finding category */
|
|
53
|
+
category: FindingCategory;
|
|
54
|
+
/** File where the issue was found */
|
|
55
|
+
file: string;
|
|
56
|
+
/** Line number (1-based) */
|
|
57
|
+
line: number;
|
|
58
|
+
/** What triggered the finding */
|
|
59
|
+
trigger: string;
|
|
60
|
+
/** Missing companion safeguards */
|
|
61
|
+
missing_companions: string[];
|
|
62
|
+
/** Why this matters */
|
|
63
|
+
why_it_matters: string;
|
|
64
|
+
/** Repository standard that should be used, if discovered */
|
|
65
|
+
repo_standard?: RepoStandard;
|
|
66
|
+
/** Confidence level */
|
|
67
|
+
confidence: FindingConfidence;
|
|
68
|
+
}
|
|
69
|
+
/** Configuration for an individual invariant module */
|
|
70
|
+
export interface InvariantConfig {
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** Policy configuration for Review Intelligence */
|
|
74
|
+
export interface ReviewIntelligencePolicy {
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
severity_threshold: ReviewSeverity;
|
|
77
|
+
invariants: {
|
|
78
|
+
runtime_validation: InvariantConfig;
|
|
79
|
+
outbound_io: InvariantConfig;
|
|
80
|
+
platform_helpers: InvariantConfig;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Result of running the review intelligence engine */
|
|
84
|
+
export interface ReviewIntelligenceResult {
|
|
85
|
+
/** All findings, sorted by severity then file */
|
|
86
|
+
findings: ReviewFinding[];
|
|
87
|
+
/** Discovered repo standards */
|
|
88
|
+
repo_standards: RepoStandard[];
|
|
89
|
+
/** Summary counts by severity */
|
|
90
|
+
summary: {
|
|
91
|
+
p0: number;
|
|
92
|
+
p1: number;
|
|
93
|
+
p2: number;
|
|
94
|
+
p3: number;
|
|
95
|
+
total: number;
|
|
96
|
+
};
|
|
97
|
+
/** Overall status */
|
|
98
|
+
status: 'PASS' | 'WARN' | 'FAIL';
|
|
99
|
+
/** Duration in milliseconds */
|
|
100
|
+
duration_ms: number;
|
|
101
|
+
}
|
|
102
|
+
/** Options for running the review intelligence engine */
|
|
103
|
+
export interface ReviewIntelligenceOptions {
|
|
104
|
+
/** Root directory of the repository */
|
|
105
|
+
cwd: string;
|
|
106
|
+
/** Files to analyze (changed/relevant files) */
|
|
107
|
+
files: string[];
|
|
108
|
+
/** Policy configuration */
|
|
109
|
+
policy: ReviewIntelligencePolicy;
|
|
110
|
+
/** Whether to include verbose reasoning */
|
|
111
|
+
explain: boolean;
|
|
112
|
+
/** Whether to include debug details */
|
|
113
|
+
debug: boolean;
|
|
114
|
+
/** Narrow to specific invariant module */
|
|
115
|
+
invariant?: string;
|
|
116
|
+
}
|
|
117
|
+
/** Interface that detector modules implement */
|
|
118
|
+
export interface InvariantDetector {
|
|
119
|
+
/** Unique module name */
|
|
120
|
+
name: FindingCategory;
|
|
121
|
+
/** Detect triggers and check invariants for a set of files */
|
|
122
|
+
analyze(ctx: DetectorContext): ReviewFinding[];
|
|
123
|
+
}
|
|
124
|
+
/** Context passed to each detector */
|
|
125
|
+
export interface DetectorContext {
|
|
126
|
+
/** Root directory of the repository */
|
|
127
|
+
cwd: string;
|
|
128
|
+
/** Files to analyze (paths relative to cwd) */
|
|
129
|
+
files: string[];
|
|
130
|
+
/** File contents map (path → content) */
|
|
131
|
+
fileContents: Map<string, string>;
|
|
132
|
+
/** Discovered repo standards */
|
|
133
|
+
repoStandards: RepoStandard[];
|
|
134
|
+
/** Whether to include verbose reasoning */
|
|
135
|
+
explain: boolean;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/review-intelligence/types.ts"],"names":[],"mappings":"AAEA,uDAAuD;AACvD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvD,iDAAiD;AACjD,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,CAAC;AAEvB,oCAAoC;AACpC,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE1D,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IAC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2B;IAC3B,MAAM,EAAE,wBAAwB,CAAC;IACjC,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,8DAA8D;IAC9D,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,aAAa,EAAE,CAAC;CAChD;AAED,sCAAsC;AACtC,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yCAAyC;IACzC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,gCAAgC;IAChC,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/review-intelligence/types.ts"],"names":[],"mappings":"AAAA,+EAA+E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeledger/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI for CodeLedger — deterministic context selection for AI coding agents",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@codeledger/types": "0.6.
|
|
31
|
-
"@codeledger/core
|
|
32
|
-
"@codeledger/core": "0.6.
|
|
33
|
-
"@codeledger/repo": "0.6.
|
|
34
|
-
"@codeledger/
|
|
35
|
-
"@codeledger/
|
|
36
|
-
"@codeledger/
|
|
37
|
-
"@codeledger/
|
|
30
|
+
"@codeledger/types": "0.6.4",
|
|
31
|
+
"@codeledger/core": "0.6.4",
|
|
32
|
+
"@codeledger/core-engine": "0.6.4",
|
|
33
|
+
"@codeledger/repo": "0.6.4",
|
|
34
|
+
"@codeledger/instrument": "0.6.4",
|
|
35
|
+
"@codeledger/cowork": "0.6.4",
|
|
36
|
+
"@codeledger/selector": "0.6.4",
|
|
37
|
+
"@codeledger/harness": "0.6.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"typescript": "^5.4.0"
|