/** * Required-increment guard (opt-in, `planning.requireIncrement`). * * An Edit or Write inside the project, outside `.specweave/`, is planned work * when the agent session has a work marker (`~/.specweave/sessions/.json`, * written by any ledger append, `create-increment`, `verify`, `complete` or * `small-fix`, keyed `studio-` for a SpecWithCode thread) for this * project, naming an open increment or a small fix, or its SpecWithCode thread * is bound to an open increment here. * Otherwise: * * off → nothing (the default) * remind → one additionalContext note per session * enforce → deny, naming the commands that unblock the edit * * Offline, a few file reads, fail-open: any error passes. * * @module core/hooks/handlers/require-increment */ import type { HookContext, HookInput, HookResult } from './types.js'; export declare const REQUIRE_INCREMENT_MODES: readonly ["off", "remind", "enforce"]; export type RequireIncrementMode = (typeof REQUIRE_INCREMENT_MODES)[number]; export declare const EDIT_TOOLS: ReadonlySet; export declare function readRequireIncrementMode(configPath: string): RequireIncrementMode; /** Marker `specweave require-increment` leaves so the hook launcher's fast path knows to run the guard. */ export declare const REQUIRE_INCREMENT_MARKER = "require-increment.enabled"; /** * Same project: one root contains the other (an umbrella and its nested repos * count as one). A Git worktree also counts as its main checkout, so a * SpecWithCode worktree matches the project it came from. */ export declare function sameProject(a: string, b: string): boolean; /** * Is this session already working, in this project, on an open increment or a * declared small fix? Markers from another project or a closed increment do not count. */ export declare function hasPlannedWork(input: HookInput, projectRoot: string, opts?: { env?: NodeJS.ProcessEnv; home?: string; }): boolean; export declare function requireIncrementMessage(mode: RequireIncrementMode): string; export declare function checkRequireIncrement(input: HookInput, context: HookContext, opts?: { env?: NodeJS.ProcessEnv; home?: string; }): HookResult; //# sourceMappingURL=require-increment.d.ts.map