sequant 2.1.1 → 2.1.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/src/commands/init.js +4 -3
- package/dist/src/commands/run-compat.d.ts +14 -0
- package/dist/src/commands/run-compat.js +12 -0
- package/dist/src/commands/run.d.ts +4 -26
- package/dist/src/commands/run.js +92 -765
- package/dist/src/commands/status.js +9 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.js +9 -0
- package/dist/src/lib/errors.d.ts +93 -0
- package/dist/src/lib/errors.js +97 -0
- package/dist/src/lib/settings.d.ts +236 -0
- package/dist/src/lib/settings.js +482 -37
- package/dist/src/lib/workflow/batch-executor.js +12 -4
- package/dist/src/lib/workflow/config-resolver.d.ts +50 -0
- package/dist/src/lib/workflow/config-resolver.js +167 -0
- package/dist/src/lib/workflow/error-classifier.d.ts +17 -7
- package/dist/src/lib/workflow/error-classifier.js +113 -15
- package/dist/src/lib/workflow/phase-executor.js +14 -2
- package/dist/src/lib/workflow/run-log-schema.d.ts +12 -0
- package/dist/src/lib/workflow/run-log-schema.js +7 -1
- package/dist/src/lib/workflow/run-orchestrator.d.ts +124 -0
- package/dist/src/lib/workflow/run-orchestrator.js +482 -0
- package/package.json +1 -1
- package/templates/skills/assess/SKILL.md +84 -35
- package/templates/skills/exec/SKILL.md +7 -27
- package/templates/skills/fullsolve/SKILL.md +329 -137
- package/templates/skills/qa/SKILL.md +23 -46
|
@@ -9,6 +9,7 @@ import { readdir } from "fs/promises";
|
|
|
9
9
|
import { StateManager } from "../lib/workflow/state-manager.js";
|
|
10
10
|
import { rebuildStateFromLogs, cleanupStaleEntries, } from "../lib/workflow/state-utils.js";
|
|
11
11
|
import { reconcileState, getNextActionHint, formatRelativeTime, } from "../lib/workflow/reconcile.js";
|
|
12
|
+
import { getSettingsWithWarnings } from "../lib/settings.js";
|
|
12
13
|
/**
|
|
13
14
|
* Run reconciliation and display warnings.
|
|
14
15
|
* Returns the reconcile result for use in display.
|
|
@@ -254,6 +255,14 @@ export async function statusCommand(options = {}) {
|
|
|
254
255
|
if (manifest.updatedAt) {
|
|
255
256
|
console.log(chalk.gray(`Last updated: ${manifest.updatedAt}`));
|
|
256
257
|
}
|
|
258
|
+
// Show settings validation warnings (AC-3)
|
|
259
|
+
const { warnings: settingsWarnings } = await getSettingsWithWarnings();
|
|
260
|
+
if (settingsWarnings.length > 0) {
|
|
261
|
+
console.log(chalk.yellow("\n Settings Warnings:"));
|
|
262
|
+
for (const w of settingsWarnings) {
|
|
263
|
+
console.log(chalk.yellow(` ${w.message}`));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
257
266
|
// Count skills
|
|
258
267
|
const skillsDir = ".claude/skills";
|
|
259
268
|
if (await fileExists(skillsDir)) {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -30,3 +30,14 @@ export { mergePhaseSignals, signalFromLabel, signalsFromLabels, formatMergedPhas
|
|
|
30
30
|
export type { SignalSource, SignalConfidence, PhaseSignal, MergedPhaseResult, } from "./lib/phase-signal.js";
|
|
31
31
|
export { isAssessComment, findAssessComment, parseAssessMarkers, parseAssessWorkflow, assessWorkflowToSignals, assessCoversIssue, isSolveComment, findSolveComment, parseSolveMarkers, parseSolveWorkflow, solveWorkflowToSignals, solveCoversIssue, } from "./lib/assess-comment-parser.js";
|
|
32
32
|
export type { AssessWorkflowResult, AssessMarkers, AssessAction, SolveWorkflowResult, SolveMarkers, IssueComment, } from "./lib/assess-comment-parser.js";
|
|
33
|
+
export { SettingsSchema, validateSettings, getSettingsWithWarnings, generateSettingsReference, generateSettingsJsonc, stripJsoncComments, } from "./lib/settings.js";
|
|
34
|
+
export type { SequantSettings, RunSettings, AgentSettings, ValidationResult, SettingsWarning, } from "./lib/settings.js";
|
|
35
|
+
export { SequantError, ContextOverflowError, ApiError, HookFailureError, BuildError, TimeoutError, SubprocessError, ERROR_TYPE_MAP, } from "./lib/errors.js";
|
|
36
|
+
export type { ContextOverflowMetadata, ApiErrorMetadata, HookFailureMetadata, BuildErrorMetadata, TimeoutErrorMetadata, SubprocessErrorMetadata, } from "./lib/errors.js";
|
|
37
|
+
export { classifyError, errorTypeToCategory, ERROR_CATEGORIES, } from "./lib/workflow/error-classifier.js";
|
|
38
|
+
export type { ErrorCategory } from "./lib/workflow/error-classifier.js";
|
|
39
|
+
export { RunOrchestrator } from "./lib/workflow/run-orchestrator.js";
|
|
40
|
+
export type { OrchestratorConfig, OrchestratorServices, RunInit, RunResult, } from "./lib/workflow/run-orchestrator.js";
|
|
41
|
+
export { ConfigResolver, resolveRunOptions, buildExecutionConfig, normalizeCommanderOptions, } from "./lib/workflow/config-resolver.js";
|
|
42
|
+
export type { ConfigLayers } from "./lib/workflow/config-resolver.js";
|
|
43
|
+
export type { ExecutionConfig, RunOptions, IssueResult, PhaseResult, ProgressCallback, } from "./lib/workflow/types.js";
|
package/dist/src/index.js
CHANGED
|
@@ -25,3 +25,12 @@ export { mergePhaseSignals, signalFromLabel, signalsFromLabels, formatMergedPhas
|
|
|
25
25
|
export { isAssessComment, findAssessComment, parseAssessMarkers, parseAssessWorkflow, assessWorkflowToSignals, assessCoversIssue,
|
|
26
26
|
// Backward-compatible aliases (deprecated)
|
|
27
27
|
isSolveComment, findSolveComment, parseSolveMarkers, parseSolveWorkflow, solveWorkflowToSignals, solveCoversIssue, } from "./lib/assess-comment-parser.js";
|
|
28
|
+
// Settings schema exports (AC-5)
|
|
29
|
+
export { SettingsSchema, validateSettings, getSettingsWithWarnings, generateSettingsReference, generateSettingsJsonc, stripJsoncComments, } from "./lib/settings.js";
|
|
30
|
+
// Structured error types (AC-10)
|
|
31
|
+
export { SequantError, ContextOverflowError, ApiError, HookFailureError, BuildError, TimeoutError, SubprocessError, ERROR_TYPE_MAP, } from "./lib/errors.js";
|
|
32
|
+
// Error classifier (AC-7)
|
|
33
|
+
export { classifyError, errorTypeToCategory, ERROR_CATEGORIES, } from "./lib/workflow/error-classifier.js";
|
|
34
|
+
// Run orchestrator exports (AC-4: importable without CLI context)
|
|
35
|
+
export { RunOrchestrator } from "./lib/workflow/run-orchestrator.js";
|
|
36
|
+
export { ConfigResolver, resolveRunOptions, buildExecutionConfig, normalizeCommanderOptions, } from "./lib/workflow/config-resolver.js";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error types for Sequant workflow failures (AC-6, AC-10).
|
|
3
|
+
*
|
|
4
|
+
* Provides typed error subclasses with metadata instead of string categories,
|
|
5
|
+
* enabling `instanceof` checks and `isRetryable` property for retry decisions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base error class for all Sequant errors.
|
|
9
|
+
*
|
|
10
|
+
* Subclasses set `isRetryable` to indicate whether the error is generally
|
|
11
|
+
* recoverable. The executor still decides based on config + attempt count.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SequantError extends Error {
|
|
14
|
+
/** Whether this error type is generally retryable */
|
|
15
|
+
readonly isRetryable: boolean;
|
|
16
|
+
/** Structured metadata for diagnostics */
|
|
17
|
+
readonly metadata: Record<string, unknown>;
|
|
18
|
+
constructor(message: string, options?: {
|
|
19
|
+
isRetryable?: boolean;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
cause?: Error;
|
|
22
|
+
});
|
|
23
|
+
/** Serialize to a plain object for JSON logging */
|
|
24
|
+
toJSON(): Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
export interface ContextOverflowMetadata {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
maxTokens?: number;
|
|
29
|
+
usedTokens?: number;
|
|
30
|
+
}
|
|
31
|
+
/** Token/context limit exceeded */
|
|
32
|
+
export declare class ContextOverflowError extends SequantError {
|
|
33
|
+
readonly metadata: ContextOverflowMetadata;
|
|
34
|
+
constructor(message: string, metadata?: ContextOverflowMetadata, cause?: Error);
|
|
35
|
+
}
|
|
36
|
+
export interface ApiErrorMetadata {
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
statusCode?: number;
|
|
39
|
+
endpoint?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Rate limits, 503, auth failures (with HTTP status code if available) */
|
|
42
|
+
export declare class ApiError extends SequantError {
|
|
43
|
+
readonly metadata: ApiErrorMetadata;
|
|
44
|
+
constructor(message: string, metadata?: ApiErrorMetadata, cause?: Error);
|
|
45
|
+
}
|
|
46
|
+
export interface HookFailureMetadata {
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
hook?: string;
|
|
49
|
+
reason?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Pre-commit hook failure (with hook name) */
|
|
52
|
+
export declare class HookFailureError extends SequantError {
|
|
53
|
+
readonly metadata: HookFailureMetadata;
|
|
54
|
+
constructor(message: string, metadata?: HookFailureMetadata, cause?: Error);
|
|
55
|
+
}
|
|
56
|
+
export interface BuildErrorMetadata {
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
toolchain?: string;
|
|
59
|
+
errorCode?: string;
|
|
60
|
+
file?: string;
|
|
61
|
+
line?: number;
|
|
62
|
+
}
|
|
63
|
+
/** TypeScript, ESLint, npm errors (with file/line if parseable) */
|
|
64
|
+
export declare class BuildError extends SequantError {
|
|
65
|
+
readonly metadata: BuildErrorMetadata;
|
|
66
|
+
constructor(message: string, metadata?: BuildErrorMetadata, cause?: Error);
|
|
67
|
+
}
|
|
68
|
+
export interface TimeoutErrorMetadata {
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
timeoutMs?: number;
|
|
71
|
+
phase?: string;
|
|
72
|
+
}
|
|
73
|
+
/** Phase exceeded time limit (with configured timeout value) */
|
|
74
|
+
export declare class TimeoutError extends SequantError {
|
|
75
|
+
readonly metadata: TimeoutErrorMetadata;
|
|
76
|
+
constructor(message: string, metadata?: TimeoutErrorMetadata, cause?: Error);
|
|
77
|
+
}
|
|
78
|
+
export interface SubprocessErrorMetadata {
|
|
79
|
+
[key: string]: unknown;
|
|
80
|
+
command?: string;
|
|
81
|
+
exitCode?: number;
|
|
82
|
+
stderr?: string;
|
|
83
|
+
}
|
|
84
|
+
/** git/gh command failed (with command, exit code, stderr) */
|
|
85
|
+
export declare class SubprocessError extends SequantError {
|
|
86
|
+
readonly metadata: SubprocessErrorMetadata;
|
|
87
|
+
constructor(message: string, metadata?: SubprocessErrorMetadata, cause?: Error);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Map of error type names to their constructors.
|
|
91
|
+
* Used for deserialization from logs.
|
|
92
|
+
*/
|
|
93
|
+
export declare const ERROR_TYPE_MAP: Record<string, new (message: string, metadata?: Record<string, unknown>, cause?: Error) => SequantError>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error types for Sequant workflow failures (AC-6, AC-10).
|
|
3
|
+
*
|
|
4
|
+
* Provides typed error subclasses with metadata instead of string categories,
|
|
5
|
+
* enabling `instanceof` checks and `isRetryable` property for retry decisions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base error class for all Sequant errors.
|
|
9
|
+
*
|
|
10
|
+
* Subclasses set `isRetryable` to indicate whether the error is generally
|
|
11
|
+
* recoverable. The executor still decides based on config + attempt count.
|
|
12
|
+
*/
|
|
13
|
+
export class SequantError extends Error {
|
|
14
|
+
/** Whether this error type is generally retryable */
|
|
15
|
+
isRetryable;
|
|
16
|
+
/** Structured metadata for diagnostics */
|
|
17
|
+
metadata;
|
|
18
|
+
constructor(message, options) {
|
|
19
|
+
super(message, { cause: options?.cause });
|
|
20
|
+
this.name = "SequantError";
|
|
21
|
+
this.isRetryable = options?.isRetryable ?? false;
|
|
22
|
+
this.metadata = options?.metadata ?? {};
|
|
23
|
+
}
|
|
24
|
+
/** Serialize to a plain object for JSON logging */
|
|
25
|
+
toJSON() {
|
|
26
|
+
return {
|
|
27
|
+
name: this.name,
|
|
28
|
+
message: this.message,
|
|
29
|
+
isRetryable: this.isRetryable,
|
|
30
|
+
metadata: this.metadata,
|
|
31
|
+
stack: this.stack,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Token/context limit exceeded */
|
|
36
|
+
export class ContextOverflowError extends SequantError {
|
|
37
|
+
constructor(message, metadata = {}, cause) {
|
|
38
|
+
super(message, { isRetryable: true, metadata, cause });
|
|
39
|
+
this.name = "ContextOverflowError";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Rate limits, 503, auth failures (with HTTP status code if available) */
|
|
43
|
+
export class ApiError extends SequantError {
|
|
44
|
+
constructor(message, metadata = {}, cause) {
|
|
45
|
+
// Retryable for transient errors (429, 502, 503), not for auth (401, 403)
|
|
46
|
+
const retryableStatuses = new Set([429, 502, 503]);
|
|
47
|
+
const isRetryable = metadata.statusCode
|
|
48
|
+
? retryableStatuses.has(metadata.statusCode)
|
|
49
|
+
: false;
|
|
50
|
+
super(message, { isRetryable, metadata, cause });
|
|
51
|
+
this.name = "ApiError";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** Pre-commit hook failure (with hook name) */
|
|
55
|
+
export class HookFailureError extends SequantError {
|
|
56
|
+
constructor(message, metadata = {}, cause) {
|
|
57
|
+
super(message, { isRetryable: false, metadata, cause });
|
|
58
|
+
this.name = "HookFailureError";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** TypeScript, ESLint, npm errors (with file/line if parseable) */
|
|
62
|
+
export class BuildError extends SequantError {
|
|
63
|
+
constructor(message, metadata = {}, cause) {
|
|
64
|
+
super(message, { isRetryable: false, metadata, cause });
|
|
65
|
+
this.name = "BuildError";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** Phase exceeded time limit (with configured timeout value) */
|
|
69
|
+
export class TimeoutError extends SequantError {
|
|
70
|
+
constructor(message, metadata = {}, cause) {
|
|
71
|
+
super(message, { isRetryable: false, metadata, cause });
|
|
72
|
+
this.name = "TimeoutError";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** git/gh command failed (with command, exit code, stderr) */
|
|
76
|
+
export class SubprocessError extends SequantError {
|
|
77
|
+
constructor(message, metadata = {}, cause) {
|
|
78
|
+
// Signal-based exits (128+signal) are generally retryable (e.g., 143 = SIGTERM)
|
|
79
|
+
const exitCode = metadata.exitCode;
|
|
80
|
+
const isRetryable = exitCode !== undefined && exitCode >= 128 && exitCode <= 192;
|
|
81
|
+
super(message, { isRetryable, metadata, cause });
|
|
82
|
+
this.name = "SubprocessError";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Map of error type names to their constructors.
|
|
87
|
+
* Used for deserialization from logs.
|
|
88
|
+
*/
|
|
89
|
+
export const ERROR_TYPE_MAP = {
|
|
90
|
+
SequantError: SequantError,
|
|
91
|
+
ContextOverflowError: ContextOverflowError,
|
|
92
|
+
ApiError: ApiError,
|
|
93
|
+
HookFailureError: HookFailureError,
|
|
94
|
+
BuildError: BuildError,
|
|
95
|
+
TimeoutError: TimeoutError,
|
|
96
|
+
SubprocessError: SubprocessError,
|
|
97
|
+
};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* 3. Project-level (.sequant/settings.json)
|
|
11
11
|
* 4. CLI flags (highest priority)
|
|
12
12
|
*/
|
|
13
|
+
import { z } from "zod";
|
|
13
14
|
/** Path to project-level settings file */
|
|
14
15
|
export declare const SETTINGS_PATH = ".sequant/settings.json";
|
|
15
16
|
/** Current settings schema version */
|
|
@@ -124,6 +125,16 @@ export interface RunSettings {
|
|
|
124
125
|
* - -1: Prune immediately (resolved issues never shown)
|
|
125
126
|
*/
|
|
126
127
|
resolvedIssueTTL: number;
|
|
128
|
+
/**
|
|
129
|
+
* Package manager run command (e.g., "npm run", "yarn", "pnpm run").
|
|
130
|
+
* Set during `sequant init` based on detected package manager.
|
|
131
|
+
*/
|
|
132
|
+
pmRun?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Development server URL (e.g., "http://localhost:3000").
|
|
135
|
+
* Set during `sequant init` based on detected stack.
|
|
136
|
+
*/
|
|
137
|
+
devUrl?: string;
|
|
127
138
|
/**
|
|
128
139
|
* Agent driver for phase execution.
|
|
129
140
|
* Default: "claude-code". Set to "aider" to use Aider CLI.
|
|
@@ -215,6 +226,201 @@ export interface SequantSettings {
|
|
|
215
226
|
/** QA skill settings */
|
|
216
227
|
qa: QASettings;
|
|
217
228
|
}
|
|
229
|
+
/** Zod schema for RotationSettings */
|
|
230
|
+
export declare const RotationSettingsSchema: z.ZodObject<{
|
|
231
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
232
|
+
maxSizeMB: z.ZodDefault<z.ZodNumber>;
|
|
233
|
+
maxFiles: z.ZodDefault<z.ZodNumber>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
/** Zod schema for AiderSettings */
|
|
236
|
+
export declare const AiderSettingsSchema: z.ZodObject<{
|
|
237
|
+
model: z.ZodOptional<z.ZodString>;
|
|
238
|
+
editFormat: z.ZodOptional<z.ZodString>;
|
|
239
|
+
extraArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
/** Zod schema for AgentSettings */
|
|
242
|
+
export declare const AgentSettingsSchema: z.ZodObject<{
|
|
243
|
+
parallel: z.ZodDefault<z.ZodBoolean>;
|
|
244
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
245
|
+
haiku: "haiku";
|
|
246
|
+
sonnet: "sonnet";
|
|
247
|
+
opus: "opus";
|
|
248
|
+
}>>;
|
|
249
|
+
isolateParallel: z.ZodDefault<z.ZodBoolean>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
/** Zod schema for RunSettings */
|
|
252
|
+
export declare const RunSettingsSchema: z.ZodObject<{
|
|
253
|
+
logJson: z.ZodDefault<z.ZodBoolean>;
|
|
254
|
+
logPath: z.ZodDefault<z.ZodString>;
|
|
255
|
+
autoDetectPhases: z.ZodDefault<z.ZodBoolean>;
|
|
256
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
257
|
+
sequential: z.ZodDefault<z.ZodBoolean>;
|
|
258
|
+
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
259
|
+
qualityLoop: z.ZodDefault<z.ZodBoolean>;
|
|
260
|
+
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
261
|
+
smartTests: z.ZodDefault<z.ZodBoolean>;
|
|
262
|
+
rotation: z.ZodDefault<z.ZodObject<{
|
|
263
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
264
|
+
maxSizeMB: z.ZodDefault<z.ZodNumber>;
|
|
265
|
+
maxFiles: z.ZodDefault<z.ZodNumber>;
|
|
266
|
+
}, z.core.$strip>>;
|
|
267
|
+
defaultBase: z.ZodOptional<z.ZodString>;
|
|
268
|
+
mcp: z.ZodDefault<z.ZodBoolean>;
|
|
269
|
+
retry: z.ZodDefault<z.ZodBoolean>;
|
|
270
|
+
staleBranchThreshold: z.ZodDefault<z.ZodNumber>;
|
|
271
|
+
resolvedIssueTTL: z.ZodDefault<z.ZodNumber>;
|
|
272
|
+
pmRun: z.ZodOptional<z.ZodString>;
|
|
273
|
+
devUrl: z.ZodOptional<z.ZodString>;
|
|
274
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
275
|
+
aider: z.ZodOptional<z.ZodObject<{
|
|
276
|
+
model: z.ZodOptional<z.ZodString>;
|
|
277
|
+
editFormat: z.ZodOptional<z.ZodString>;
|
|
278
|
+
extraArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
279
|
+
}, z.core.$strip>>;
|
|
280
|
+
}, z.core.$strip>;
|
|
281
|
+
/** Zod schema for ScopeThreshold (base — fields required, no defaults) */
|
|
282
|
+
export declare const ScopeThresholdSchema: z.ZodObject<{
|
|
283
|
+
yellow: z.ZodNumber;
|
|
284
|
+
red: z.ZodNumber;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
/** Zod schema for TrivialThresholds */
|
|
287
|
+
export declare const TrivialThresholdsSchema: z.ZodObject<{
|
|
288
|
+
maxACItems: z.ZodDefault<z.ZodNumber>;
|
|
289
|
+
maxDirectories: z.ZodDefault<z.ZodNumber>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
/** Zod schema for ScopeAssessmentSettings */
|
|
292
|
+
export declare const ScopeAssessmentSettingsSchema: z.ZodObject<{
|
|
293
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
294
|
+
skipIfSimple: z.ZodDefault<z.ZodBoolean>;
|
|
295
|
+
trivialThresholds: z.ZodDefault<z.ZodObject<{
|
|
296
|
+
maxACItems: z.ZodDefault<z.ZodNumber>;
|
|
297
|
+
maxDirectories: z.ZodDefault<z.ZodNumber>;
|
|
298
|
+
}, z.core.$strip>>;
|
|
299
|
+
thresholds: z.ZodDefault<z.ZodObject<{
|
|
300
|
+
featureCount: z.ZodDefault<z.ZodObject<{
|
|
301
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
302
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
303
|
+
}, z.core.$strip>>;
|
|
304
|
+
acItems: z.ZodDefault<z.ZodObject<{
|
|
305
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
306
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
fileEstimate: z.ZodDefault<z.ZodObject<{
|
|
309
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
310
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
311
|
+
}, z.core.$strip>>;
|
|
312
|
+
directorySpread: z.ZodDefault<z.ZodObject<{
|
|
313
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
314
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
315
|
+
}, z.core.$strip>>;
|
|
316
|
+
}, z.core.$strip>>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
/** Zod schema for QASettings */
|
|
319
|
+
export declare const QASettingsSchema: z.ZodObject<{
|
|
320
|
+
smallDiffThreshold: z.ZodDefault<z.ZodNumber>;
|
|
321
|
+
}, z.core.$strip>;
|
|
322
|
+
/**
|
|
323
|
+
* Zod schema for the full SequantSettings (AC-1, AC-5).
|
|
324
|
+
*
|
|
325
|
+
* Top-level uses `.passthrough()` to allow forward-compatible fields from
|
|
326
|
+
* newer Sequant versions. Unknown keys are preserved in parse output and
|
|
327
|
+
* reported as warnings via `validateSettings()`.
|
|
328
|
+
*
|
|
329
|
+
* Nested schemas don't use `.passthrough()` because unknown key detection
|
|
330
|
+
* is handled by `detectUnknownKeys()` at validation time.
|
|
331
|
+
*/
|
|
332
|
+
export declare const SettingsSchema: z.ZodObject<{
|
|
333
|
+
version: z.ZodDefault<z.ZodString>;
|
|
334
|
+
run: z.ZodDefault<z.ZodObject<{
|
|
335
|
+
logJson: z.ZodDefault<z.ZodBoolean>;
|
|
336
|
+
logPath: z.ZodDefault<z.ZodString>;
|
|
337
|
+
autoDetectPhases: z.ZodDefault<z.ZodBoolean>;
|
|
338
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
339
|
+
sequential: z.ZodDefault<z.ZodBoolean>;
|
|
340
|
+
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
341
|
+
qualityLoop: z.ZodDefault<z.ZodBoolean>;
|
|
342
|
+
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
343
|
+
smartTests: z.ZodDefault<z.ZodBoolean>;
|
|
344
|
+
rotation: z.ZodDefault<z.ZodObject<{
|
|
345
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
346
|
+
maxSizeMB: z.ZodDefault<z.ZodNumber>;
|
|
347
|
+
maxFiles: z.ZodDefault<z.ZodNumber>;
|
|
348
|
+
}, z.core.$strip>>;
|
|
349
|
+
defaultBase: z.ZodOptional<z.ZodString>;
|
|
350
|
+
mcp: z.ZodDefault<z.ZodBoolean>;
|
|
351
|
+
retry: z.ZodDefault<z.ZodBoolean>;
|
|
352
|
+
staleBranchThreshold: z.ZodDefault<z.ZodNumber>;
|
|
353
|
+
resolvedIssueTTL: z.ZodDefault<z.ZodNumber>;
|
|
354
|
+
pmRun: z.ZodOptional<z.ZodString>;
|
|
355
|
+
devUrl: z.ZodOptional<z.ZodString>;
|
|
356
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
357
|
+
aider: z.ZodOptional<z.ZodObject<{
|
|
358
|
+
model: z.ZodOptional<z.ZodString>;
|
|
359
|
+
editFormat: z.ZodOptional<z.ZodString>;
|
|
360
|
+
extraArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
361
|
+
}, z.core.$strip>>;
|
|
362
|
+
}, z.core.$strip>>;
|
|
363
|
+
agents: z.ZodDefault<z.ZodObject<{
|
|
364
|
+
parallel: z.ZodDefault<z.ZodBoolean>;
|
|
365
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
366
|
+
haiku: "haiku";
|
|
367
|
+
sonnet: "sonnet";
|
|
368
|
+
opus: "opus";
|
|
369
|
+
}>>;
|
|
370
|
+
isolateParallel: z.ZodDefault<z.ZodBoolean>;
|
|
371
|
+
}, z.core.$strip>>;
|
|
372
|
+
scopeAssessment: z.ZodDefault<z.ZodObject<{
|
|
373
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
374
|
+
skipIfSimple: z.ZodDefault<z.ZodBoolean>;
|
|
375
|
+
trivialThresholds: z.ZodDefault<z.ZodObject<{
|
|
376
|
+
maxACItems: z.ZodDefault<z.ZodNumber>;
|
|
377
|
+
maxDirectories: z.ZodDefault<z.ZodNumber>;
|
|
378
|
+
}, z.core.$strip>>;
|
|
379
|
+
thresholds: z.ZodDefault<z.ZodObject<{
|
|
380
|
+
featureCount: z.ZodDefault<z.ZodObject<{
|
|
381
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
382
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
383
|
+
}, z.core.$strip>>;
|
|
384
|
+
acItems: z.ZodDefault<z.ZodObject<{
|
|
385
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
386
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
387
|
+
}, z.core.$strip>>;
|
|
388
|
+
fileEstimate: z.ZodDefault<z.ZodObject<{
|
|
389
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
390
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
directorySpread: z.ZodDefault<z.ZodObject<{
|
|
393
|
+
yellow: z.ZodDefault<z.ZodNumber>;
|
|
394
|
+
red: z.ZodDefault<z.ZodNumber>;
|
|
395
|
+
}, z.core.$strip>>;
|
|
396
|
+
}, z.core.$strip>>;
|
|
397
|
+
}, z.core.$strip>>;
|
|
398
|
+
qa: z.ZodDefault<z.ZodObject<{
|
|
399
|
+
smallDiffThreshold: z.ZodDefault<z.ZodNumber>;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
}, z.core.$loose>;
|
|
402
|
+
/** A single validation warning about an unknown or invalid setting */
|
|
403
|
+
export interface SettingsWarning {
|
|
404
|
+
/** Dot-separated path to the problematic key, e.g. "run.timoeut" */
|
|
405
|
+
path: string;
|
|
406
|
+
/** Human-readable message */
|
|
407
|
+
message: string;
|
|
408
|
+
}
|
|
409
|
+
/** Result of settings validation */
|
|
410
|
+
export interface ValidationResult {
|
|
411
|
+
/** The merged settings (always returned — invalid fields use defaults) */
|
|
412
|
+
settings: SequantSettings;
|
|
413
|
+
/** Validation warnings (unknown keys, type mismatches that were coerced) */
|
|
414
|
+
warnings: SettingsWarning[];
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Validate a raw settings object against the Zod schema (AC-2).
|
|
418
|
+
*
|
|
419
|
+
* Returns validated settings (with defaults filled in) and any warnings.
|
|
420
|
+
* On type errors, falls back to defaults for the invalid fields and
|
|
421
|
+
* reports warnings — never throws.
|
|
422
|
+
*/
|
|
423
|
+
export declare function validateSettings(raw: unknown): ValidationResult;
|
|
218
424
|
/**
|
|
219
425
|
* Default rotation settings
|
|
220
426
|
*/
|
|
@@ -250,10 +456,18 @@ export declare const DEFAULT_SETTINGS: SequantSettings;
|
|
|
250
456
|
* Throws on invalid types to catch config errors at load time.
|
|
251
457
|
*/
|
|
252
458
|
export declare function validateAiderSettings(aider: unknown): AiderSettings | undefined;
|
|
459
|
+
/**
|
|
460
|
+
* Get the current project settings with validation warnings (AC-2, AC-3).
|
|
461
|
+
*
|
|
462
|
+
* Returns settings merged with defaults and any validation warnings.
|
|
463
|
+
* Use this when you need to display warnings to the user (e.g., status command).
|
|
464
|
+
*/
|
|
465
|
+
export declare function getSettingsWithWarnings(): Promise<ValidationResult>;
|
|
253
466
|
/**
|
|
254
467
|
* Get the current project settings
|
|
255
468
|
*
|
|
256
469
|
* Returns default settings if no settings file exists.
|
|
470
|
+
* Validates against Zod schema (AC-2) — warnings are logged to stderr.
|
|
257
471
|
*/
|
|
258
472
|
export declare function getSettings(): Promise<SequantSettings>;
|
|
259
473
|
/**
|
|
@@ -267,4 +481,26 @@ export declare function settingsExist(): Promise<boolean>;
|
|
|
267
481
|
/**
|
|
268
482
|
* Create default settings file
|
|
269
483
|
*/
|
|
484
|
+
/**
|
|
485
|
+
* Create default settings file with JSONC inline comments (AC-4).
|
|
486
|
+
*
|
|
487
|
+
* Generates a JSONC file (.json with // comments) documenting each field
|
|
488
|
+
* and its default value. The loadSettings path strips comments before parsing.
|
|
489
|
+
*/
|
|
270
490
|
export declare function createDefaultSettings(): Promise<void>;
|
|
491
|
+
/**
|
|
492
|
+
* Generate JSONC content with inline comments for each settings field (AC-4).
|
|
493
|
+
*/
|
|
494
|
+
export declare function generateSettingsJsonc(settings: SequantSettings): string;
|
|
495
|
+
/**
|
|
496
|
+
* Strip single-line // comments from JSONC content for JSON.parse compatibility.
|
|
497
|
+
* Handles comments on their own line and trailing comments after values.
|
|
498
|
+
* Preserves strings containing // (e.g., URLs).
|
|
499
|
+
*/
|
|
500
|
+
export declare function stripJsoncComments(content: string): string;
|
|
501
|
+
/**
|
|
502
|
+
* Generate settings.reference.md companion document (AC-4).
|
|
503
|
+
*
|
|
504
|
+
* Supplements the inline JSONC comments with a structured Markdown reference.
|
|
505
|
+
*/
|
|
506
|
+
export declare function generateSettingsReference(): string;
|