no-mistakes 0.94.0 → 0.96.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.
@@ -45,26 +45,28 @@ import type {
45
45
  TraversePathsOptions,
46
46
  } from "./traversal-types";
47
47
 
48
- type BatchedProjectOptions = Omit<ProjectOptions, "root" | "tsconfig" | "config">;
49
- type BatchedFlowOptions = Omit<FlowOptions, "root" | "tsconfig" | "config">;
50
- type BatchedTraverseOptions = TraverseOptions & Pick<ProjectOptions, "config">;
51
- type BatchedDependencyTraverseOptions = (TraverseGraphOptions | TraversePathsOptions) &
48
+ /** Shared `analyzeProject()` options after the request-level `root`/`tsconfig`/`config`. */
49
+ export type BatchedProjectOptions = Omit<ProjectOptions, "root" | "tsconfig" | "config">;
50
+ export type BatchedFlowOptions = Omit<FlowOptions, "root" | "tsconfig" | "config">;
51
+ export type BatchedTraverseOptions = TraverseOptions & Pick<ProjectOptions, "config">;
52
+ export type BatchedDependencyTraverseOptions = (TraverseGraphOptions | TraversePathsOptions) &
52
53
  Pick<ProjectOptions, "config">;
53
- type BatchedQueueRelatedOptions = BatchedProjectOptions & { files: string[] };
54
- type BatchedServerRouteRelatedOptions = BatchedProjectOptions &
54
+ export type BatchedQueueRelatedOptions = BatchedProjectOptions & { files: string[] };
55
+ export type BatchedServerRouteRelatedOptions = BatchedProjectOptions &
55
56
  ({ files: string[] } | { roots: string[] });
56
- type BatchedReactUsagesOptions = Pick<
57
+ export type BatchedReactUsagesOptions = Pick<
57
58
  ProjectOptions,
58
- "root" | "tsconfig" | "config" | "targets" | "include"
59
+ "root" | "tsconfig" | "config" | "targets" | "include" | "effort"
59
60
  > &
60
61
  Required<Pick<ProjectOptions, "target">>;
61
- type BatchedCheckOptions = Pick<
62
+ export type BatchedCheckOptions = Pick<
62
63
  CheckOptions,
63
- "root" | "tsconfig" | "config" | "includeSuppressed" | "includeRunnerConfigDeadlines"
64
- >;
65
- type BatchedQueryFileOptions<T> = Omit<T, "root" | "tsconfig">;
66
- type BatchedRootConfigOptions<T> = Omit<T, "root" | "config">;
67
- type BatchedRootTsConfigOptions<T> = Omit<T, "root" | "tsconfig" | "config">;
64
+ "root" | "tsconfig" | "config" | "includeSuppressed" | "effort"
65
+ > &
66
+ Pick<CheckOptions, "includeRunnerConfigDeadlines" | "includeSqlVerdicts">;
67
+ export type BatchedQueryFileOptions<T> = Omit<T, "root" | "tsconfig">;
68
+ export type BatchedRootConfigOptions<T> = Omit<T, "root" | "config">;
69
+ export type BatchedRootTsConfigOptions<T> = Omit<T, "root" | "tsconfig" | "config">;
68
70
 
69
71
  export type AnalyzeProjectReportRequest =
70
72
  | ({ type: "dependencies"; id?: string } & BatchedDependencyTraverseOptions)
@@ -84,7 +86,7 @@ export type AnalyzeProjectReportRequest =
84
86
  | ({ type: "serverRouteRelated"; id?: string } & BatchedServerRouteRelatedOptions)
85
87
  | ({ type: "reactAnalyze" | "reactCheck"; id?: string } & Pick<
86
88
  ProjectOptions,
87
- "targets" | "depth" | "assertNoFetch"
89
+ "targets" | "depth" | "assertNoFetch" | "effort"
88
90
  >)
89
91
  | ({ type: "reactUsages"; id?: string } & BatchedReactUsagesOptions)
90
92
  | ({
@@ -151,12 +153,21 @@ export interface AnalyzeProjectOptions {
151
153
  reports: AnalyzeProjectReportRequest[];
152
154
  }
153
155
 
156
+ /** Discriminant for `analyzeProject()` report requests and result entries. */
157
+ export type AnalyzeProjectReportType = AnalyzeProjectReportRequest["type"];
158
+
159
+ /** Payload carried on one `analyzeProject()` result entry. */
160
+ export type AnalyzeProjectReportResult = unknown | EffectsReport | RscCallersReport;
161
+
162
+ /** One entry in `analyzeProject()` `reports`. */
163
+ export interface AnalyzeProjectReport {
164
+ id?: string;
165
+ type: AnalyzeProjectReportType;
166
+ result: AnalyzeProjectReportResult;
167
+ }
168
+
154
169
  export interface AnalyzeProjectResult {
155
- reports: Array<{
156
- id?: string;
157
- type: AnalyzeProjectReportRequest["type"];
158
- result: unknown | EffectsReport | RscCallersReport;
159
- }>;
170
+ reports: AnalyzeProjectReport[];
160
171
  /**
161
172
  * Set when this call's resolved `jobs` differs from the process-wide Rayon pool.
162
173
  * Omitted when the pool was just created or the resolved count already matches.
@@ -1,11 +1,24 @@
1
1
  import type { QueueCheckFinding } from "./queue-report-types";
2
2
  import type { ReactViolation } from "./react-report-types";
3
+ import type { Effort } from "./traversal-types";
4
+
5
+ /** A low-effort rule that used maximum analysis because a required partner was unavailable. */
6
+ export interface AnalysisFallback {
7
+ /** Canonical rule identifier. */
8
+ rule: string;
9
+ /** Required partner check that could not be validated in scope. */
10
+ partner: string;
11
+ requested: Effort;
12
+ effective: Effort;
13
+ }
3
14
 
4
15
  export interface CheckReport {
5
16
  react: ReactViolation[];
6
17
  queues: QueueCheckFinding[];
7
18
  rules: RuleFinding[];
8
19
  integration: IntegrationFinding[];
20
+ /** Partner-backed low-effort rules that fell back to maximum analysis; omitted when empty. */
21
+ analysisFallbacks?: AnalysisFallback[];
9
22
  /** Present only when requested; declaration evidence, not runtime closure. */
10
23
  runnerConfigDeadlines?: RunnerConfigDeadlineEvidence[];
11
24
  codebase: UniqueExportFinding[];
@@ -16,10 +29,41 @@ export interface CheckReport {
16
29
  */
17
30
  unprovenMemberQuerySql?: number;
18
31
  advisories: RuleFinding[];
32
+ /** Present only when `includeSqlVerdicts` is requested, including an empty array. */
33
+ sqlVerdicts?: SqlObligationVerdict[];
19
34
  /** Present when `includeSuppressed` is requested; empty when no directives matched. */
20
35
  suppressed?: SuppressedFinding[];
21
36
  }
22
37
 
38
+ export type SqlVerdictStatus = "violation" | "proven-clear" | "abstain";
39
+ export type SqlEvidenceKind = "exact" | "exhaustive-union" | "verified-prefix" | "policy-exemption";
40
+ export interface SqlExecutorProfile {
41
+ importSpecifier: string;
42
+ executorNames: string[];
43
+ executorFactoryNames: string[];
44
+ executorTypeNames: string[];
45
+ trustedSqlTags: { module: string; name: string }[];
46
+ }
47
+ /** Zero-based ordinal among enabled applications of the same rule in config order. */
48
+ export interface SqlRuleApplication {
49
+ index: number;
50
+ name?: string;
51
+ }
52
+ export interface SqlObligationVerdict {
53
+ profile: SqlExecutorProfile;
54
+ rule: string;
55
+ application?: SqlRuleApplication;
56
+ subcheck: string;
57
+ file: string;
58
+ span: [number, number];
59
+ status: SqlVerdictStatus;
60
+ advisory: boolean;
61
+ evidence?: SqlEvidenceKind;
62
+ knownPrefix?: string;
63
+ helperLines?: number[];
64
+ residualReasons?: string[];
65
+ }
66
+
23
67
  export interface SuppressedFinding {
24
68
  domain: "react" | "queues" | "rules" | "filesystem" | "integration" | "codebase" | "advisories";
25
69
  rule: string;
@@ -14,7 +14,7 @@ export interface ExecutedPostgresResolvedImport {
14
14
  toFileName: string;
15
15
  }
16
16
 
17
- export interface ExecutedPostgresSqlOptions {
17
+ export interface ExecutedPostgresSqlOptions<Diagnostics extends boolean = false> {
18
18
  sources: ExecutedPostgresSource[];
19
19
  /** Module whose named imports provide the configured executors. */
20
20
  importSpecifier: string;
@@ -27,6 +27,8 @@ export interface ExecutedPostgresSqlOptions {
27
27
  resolveImports?: boolean;
28
28
  /** Explicit edges for aliases or package imports; relative supplied paths resolve automatically. */
29
29
  resolvedImports?: ExecutedPostgresResolvedImport[];
30
+ /** Include executor-type and unresolved-receiver diagnostics without treating them as SQL. */
31
+ includeDiagnostics?: Diagnostics;
30
32
  }
31
33
 
32
34
  export type ExecutedPostgresSqlKind = "inline" | "immutableLocal" | "composed" | "dynamic";
@@ -47,7 +49,31 @@ export interface ExecutedPostgresSql {
47
49
  incompleteReason: string | null;
48
50
  }
49
51
 
52
+ /** Omitted member-call sites grouped by their imported receiver type identity. */
53
+ export interface UndeclaredExecutorTypeSummary {
54
+ type: string;
55
+ module: string;
56
+ count: number;
57
+ }
58
+
59
+ /** Configured imported receiver types whose call ownership is still unresolved. */
60
+ export type UnresolvedExecutorReceiverSummary = UndeclaredExecutorTypeSummary;
61
+
62
+ export interface ExecutedPostgresSqlReport {
63
+ statements: ExecutedPostgresSql[];
64
+ /** Sorted by type, then module; empty when no undeclared receiver types were found. */
65
+ undeclaredExecutorTypes: UndeclaredExecutorTypeSummary[];
66
+ /** Configured types with unsupported receiver shapes, sorted by type and module. */
67
+ unresolvedExecutorReceivers: UnresolvedExecutorReceiverSummary[];
68
+ }
69
+
50
70
  /** Extract configured PostgreSQL executor calls from supplied TS/JS source. */
71
+ export function extractExecutedPostgresSql(
72
+ options: ExecutedPostgresSqlOptions<true> & { includeDiagnostics: true },
73
+ ): Promise<ExecutedPostgresSqlReport>;
51
74
  export function extractExecutedPostgresSql(
52
75
  options: ExecutedPostgresSqlOptions,
53
76
  ): Promise<ExecutedPostgresSql[]>;
77
+ export function extractExecutedPostgresSql(
78
+ options: ExecutedPostgresSqlOptions<boolean>,
79
+ ): Promise<ExecutedPostgresSql[] | ExecutedPostgresSqlReport>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "no-mistakes",
3
- "version": "0.94.0",
3
+ "version": "0.96.0",
4
4
  "description": "Deterministic impact maps, test plans, Playwright coverage, and repository checks for coding agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -65,9 +65,9 @@
65
65
  }
66
66
  },
67
67
  "optionalDependencies": {
68
- "no-mistakes-darwin-arm64": "0.94.0",
69
- "no-mistakes-linux-arm64-gnu": "0.94.0",
70
- "no-mistakes-linux-x64-gnu": "0.94.0",
71
- "no-mistakes-win32-x64-msvc": "0.94.0"
68
+ "no-mistakes-darwin-arm64": "0.96.0",
69
+ "no-mistakes-linux-arm64-gnu": "0.96.0",
70
+ "no-mistakes-linux-x64-gnu": "0.96.0",
71
+ "no-mistakes-win32-x64-msvc": "0.96.0"
72
72
  }
73
73
  }
@@ -1,5 +1,7 @@
1
- /** Policy for executor SQL whose leading text cannot be proven. Defaults to `report`. */
2
- export type PostgresUnanalyzableSql = "report" | "ignore";
1
+ import type { Effort, Unanalyzable } from "./traversal-types";
2
+
3
+ /** Backward-compatible SQL-specific name for the shared unanalyzable policy. */
4
+ export type PostgresUnanalyzableSql = Unanalyzable;
3
5
 
4
6
  /** Configuration options for the `postgres-require-query-annotation` check rule. */
5
7
  export interface PostgresRequireQueryAnnotationOptions {
@@ -9,6 +11,9 @@ export interface PostgresRequireQueryAnnotationOptions {
9
11
  executorNames?: string[];
10
12
  executorFactoryNames?: string[];
11
13
  executorTypeNames?: string[];
14
+ /** @deprecated At effort "low" only; ignored there and warns when configured. Still used at effort "max". */
12
15
  trustedSqlTags?: { module: string; name: string }[];
16
+ effort?: Effort;
17
+ unanalyzable?: Unanalyzable;
13
18
  unanalyzableSql?: PostgresUnanalyzableSql;
14
19
  }
@@ -0,0 +1,38 @@
1
+ export interface SymbolExport {
2
+ name: string;
3
+ kind: string;
4
+ line: number;
5
+ reExport?: {
6
+ source: string;
7
+ imported: string;
8
+ resolved?: string;
9
+ };
10
+ }
11
+
12
+ export interface SymbolImport {
13
+ source: string;
14
+ imported: string;
15
+ local: string;
16
+ line: number;
17
+ typeOnly: boolean;
18
+ resolved?: string;
19
+ }
20
+
21
+ export interface SymbolFile {
22
+ path: string;
23
+ exports?: SymbolExport[];
24
+ imports?: SymbolImport[];
25
+ }
26
+
27
+ export interface SymbolsResult {
28
+ roots: string[];
29
+ files: SymbolFile[];
30
+ }
31
+
32
+ export type {
33
+ SignatureImpactCaller,
34
+ SignatureImpactLocation,
35
+ SignatureImpactResult,
36
+ SignatureImpactTest,
37
+ SignatureImpactWarning,
38
+ } from "./signature-impact-types";
package/test-types.d.ts CHANGED
@@ -26,7 +26,8 @@ export type TestPlanFramework =
26
26
  | "dart"
27
27
  | "jest";
28
28
 
29
- interface TestsPlanOptionsBase {
29
+ /** Shared option bag for `testsPlan()`. Direct-owner plans omit incompatible fields via `TestsPlanOptions`. */
30
+ export interface TestsPlanOptionsBase {
30
31
  framework?: TestPlanFramework;
31
32
  /** Project root. Defaults to the current working directory. */
32
33
  root?: string;
@@ -143,46 +143,21 @@ export type SymbolsSignatureImpactOptions = SymbolsOptions & {
143
143
  symbol: string;
144
144
  };
145
145
 
146
- export interface SymbolExport {
147
- name: string;
148
- kind: string;
149
- line: number;
150
- reExport?: {
151
- source: string;
152
- imported: string;
153
- resolved?: string;
154
- };
155
- }
156
-
157
- export interface SymbolImport {
158
- source: string;
159
- imported: string;
160
- local: string;
161
- line: number;
162
- typeOnly: boolean;
163
- resolved?: string;
164
- }
165
-
166
- export interface SymbolFile {
167
- path: string;
168
- exports?: SymbolExport[];
169
- imports?: SymbolImport[];
170
- }
171
-
172
- export interface SymbolsResult {
173
- roots: string[];
174
- files: SymbolFile[];
175
- }
176
-
177
146
  export type {
147
+ SymbolExport,
148
+ SymbolImport,
149
+ SymbolFile,
150
+ SymbolsResult,
178
151
  SignatureImpactCaller,
179
152
  SignatureImpactLocation,
180
153
  SignatureImpactResult,
181
154
  SignatureImpactTest,
182
155
  SignatureImpactWarning,
183
- } from "./signature-impact-types";
156
+ } from "./symbol-traversal-types";
184
157
 
185
158
  export interface ProjectOptions {
159
+ /** Accepted by shared N-API options; applies to check reports and is ignored by other commands. */
160
+ effort?: Effort;
186
161
  /** Project root. Defaults to the current working directory. */
187
162
  root?: string;
188
163
  /** Path to tsconfig.json for alias resolution. Searched upward if omitted. */
@@ -202,9 +177,19 @@ export interface ProjectOptions {
202
177
  include?: string;
203
178
  }
204
179
 
180
+ /** Analysis effort for configured rules. `max` preserves the current analysis. */
181
+ export type Effort = "low" | "max";
182
+
183
+ /** Policy for rule inputs that the selected effort cannot analyze. */
184
+ export type Unanalyzable = "report" | "advise" | "ignore";
185
+
205
186
  export interface CheckOptions extends ProjectOptions {
187
+ /** Override configured rule effort for this check invocation. Defaults to `max`. */
188
+ effort?: Effort;
206
189
  /** Add deterministic accounting for findings hidden by no-mistakes directives. */
207
190
  includeSuppressed?: boolean;
208
191
  /** Add declared config evidence; absent slots never imply SDK defaults. */
209
192
  includeRunnerConfigDeadlines?: boolean;
193
+ /** Include per-obligation SQL proof and residual uncertainty in the check report. */
194
+ includeSqlVerdicts?: boolean;
210
195
  }