import type { Effect, IntentInvariant } from "../ast/nodes.js"; import type { TypeExpr } from "../ast/types.js"; import type { FixSuggestion } from "../errors/structured-errors.js"; export type LintWarning = UnusedVariableWarning | UnusedImportWarning | MissingContractWarning | OversizedFunctionWarning | EmptyBodyWarning | RedundantEffectWarning | DecompositionSuggestedWarning | IntentUnverifiedInvariantWarning | ConfidenceBelowThresholdWarning | LowConfidenceOutputWarning | LiteralProvenanceWarning | StaleDataWarning | ApprovalMissingOnIoWarning | ToolCallNoRetryWarning | ToolCallNoTimeoutWarning | UnsupportedContainerWarning; export interface UnusedVariableWarning { warning: "unused_variable"; severity: "warning"; nodeId: string; name: string; suggestion?: FixSuggestion; } export interface UnusedImportWarning { warning: "unused_import"; severity: "warning"; nodeId: string; importModule: string; unusedNames: string[]; suggestion?: FixSuggestion; } export interface MissingContractWarning { warning: "missing_contract"; severity: "warning"; nodeId: string; functionName: string; } export interface OversizedFunctionWarning { warning: "oversized_function"; severity: "warning"; nodeId: string; functionName: string; expressionCount: number; threshold: number; } export interface EmptyBodyWarning { warning: "empty_body"; severity: "warning"; nodeId: string; functionName: string; } export interface SuggestedSplit { name: string; nodeRange: [string, string]; nodeCount: number; } export interface DecompositionSuggestedWarning { warning: "decomposition_suggested"; severity: "warning"; nodeId: string; functionName: string; reason: string; suggestedSplit: SuggestedSplit[]; } export interface RedundantEffectWarning { warning: "redundant_effect"; severity: "warning"; nodeId: string; functionName: string; redundantEffects: Effect[]; requiredEffects: Effect[]; suggestion?: FixSuggestion; } export interface IntentUnverifiedInvariantWarning { warning: "intent_unverified_invariant"; severity: "warning"; nodeId: string; functionName: string; unverifiedInvariant: IntentInvariant; } export interface ConfidenceBelowThresholdWarning { warning: "confidence_below_threshold"; severity: "warning"; nodeId: string; name: string; actual: number; required: number; } export interface LowConfidenceOutputWarning { warning: "low_confidence_output"; severity: "warning"; nodeId: string; functionName: string; returnConfidence: number; minConfidence: number; } export interface LiteralProvenanceWarning { warning: "literal_provenance"; severity: "warning"; nodeId: string; functionName: string; declaredSource: string; } export interface StaleDataWarning { warning: "stale_data_used"; severity: "warning"; nodeId: string; functionName: string; paramName: string; declaredMaxAge: string; } export interface ApprovalMissingOnIoWarning { warning: "approval_missing_on_io"; severity: "warning"; nodeId: string; functionName: string; effects: Effect[]; } export interface ToolCallNoRetryWarning { warning: "tool_call_no_retry"; severity: "warning"; nodeId: string; toolName: string; } export interface UnsupportedContainerWarning { warning: "unsupported_container"; severity: "warning"; nodeId: string; location: string; containerKind: "array" | "option" | "result"; actualType: TypeExpr; supportedTypes: TypeExpr[]; suggestion?: FixSuggestion; } export interface ToolCallNoTimeoutWarning { warning: "tool_call_no_timeout"; severity: "warning"; nodeId: string; toolName: string; } /** Create a warning for an unused `let` binding that is never referenced. */ export declare function unusedVariable(nodeId: string, name: string): UnusedVariableWarning; /** Create a warning for imported names that are never referenced in the module. */ export declare function unusedImport(nodeId: string, importModule: string, unusedNames: string[]): UnusedImportWarning; /** Create a warning for a function (non-main) that has no pre/post contracts. */ export declare function missingContract(nodeId: string, functionName: string): MissingContractWarning; /** Create a warning for a function whose body exceeds the expression node threshold. */ export declare function oversizedFunction(nodeId: string, functionName: string, expressionCount: number, threshold: number): OversizedFunctionWarning; /** Create a warning for a function with an empty body. */ export declare function emptyBody(nodeId: string, functionName: string): EmptyBodyWarning; /** Create a warning for effects declared on a function that are not required by its call graph. */ export declare function redundantEffect(nodeId: string, functionName: string, redundantEffects: Effect[], requiredEffects: Effect[]): RedundantEffectWarning; /** Create a warning suggesting decomposition of an oversized function into independent segments. */ export declare function decompositionSuggested(nodeId: string, functionName: string, suggestedSplit: SuggestedSplit[]): DecompositionSuggestedWarning; /** Create a warning for an intent invariant that has no matching postcondition contract. */ export declare function intentUnverifiedInvariant(nodeId: string, functionName: string, unverifiedInvariant: IntentInvariant): IntentUnverifiedInvariantWarning; /** Create a warning when a blame annotation's confidence is below the module's minConfidence threshold. */ export declare function confidenceBelowThreshold(nodeId: string, name: string, actual: number, required: number): ConfidenceBelowThresholdWarning; /** Create a warning when a function's return type confidence is below the module's minConfidence threshold. */ export declare function lowConfidenceOutput(nodeId: string, functionName: string, returnConfidence: number, minConfidence: number): LowConfidenceOutputWarning; /** Create a warning when a function claims non-literal provenance but returns a hardcoded literal. */ export declare function literalProvenance(nodeId: string, functionName: string, declaredSource: string): LiteralProvenanceWarning; /** Create a warning when a pure function accepts a fresh-typed parameter — pure functions cannot re-fetch stale data. */ export declare function staleDataUsed(nodeId: string, functionName: string, paramName: string, declaredMaxAge: string): StaleDataWarning; /** Create a warning when an IO-effectful function lacks an approval gate. */ export declare function approvalMissingOnIo(nodeId: string, functionName: string, effects: Effect[]): ApprovalMissingOnIoWarning; /** Create a warning when a tool_call expression is missing a retry policy. */ export declare function toolCallNoRetry(nodeId: string, toolName: string): ToolCallNoRetryWarning; /** Create a warning when a tool_call expression is missing a timeout. */ export declare function toolCallNoTimeout(nodeId: string, toolName: string): ToolCallNoTimeoutWarning; /** Create a warning when a container type (array/option/result) uses an element type not supported by any builtin. */ export declare function unsupportedContainer(nodeId: string, location: string, containerKind: "array" | "option" | "result", actualType: TypeExpr, supportedTypes: TypeExpr[], suggestion?: FixSuggestion): UnsupportedContainerWarning; //# sourceMappingURL=warnings.d.ts.map