/**
 * Versioning gate — pre-commit check enforcing per-commit patch bumps
 * (v0.6.3). Wired into the PreToolUse hook for `git commit` commands.
 *
 * Problem this fixes: I keep batching multiple fixes into one commit
 * and bumping the minor (or no bump at all) instead of one patch per
 * fix. The discipline rule was memorized (`mem-d2cc0e78`) but rules
 * I can ignore aren't structural protection. This gate makes the
 * discipline mechanical — if your commit touches source code AND
 * doesn't include a manifest version bump in the same commit, it
 * gets rejected before `git commit` runs.
 *
 * Detection:
 *   1. `git diff --cached --name-only` → list of staged files
 *   2. If no `src/**` files staged → allow (docs/CI/config commits
 *      don't need version bumps)
 *   3. If `src/**` files staged → require a manifest (Cargo.toml or
 *      package.json) to also be staged with a `version` line diff
 *   4. Otherwise → block with actionable message
 *
 * Fail-open invariant: any error running git or parsing output →
 * allow with a stderr warning (per the honesty-ledger + workflow-gate
 * precedent — never block on opensquid's own bug).
 *
 * Emergency override: `OPENSQUID_SKIP_VERSION_GATE=1` bypasses with a
 * loud stderr warning. For genuine emergencies (revert commits,
 * generated-code-only diffs, etc.) where the discipline doesn't
 * apply.
 */
export interface VersioningGateInput {
    /** Working directory (the repo root). Defaults to process.cwd(). */
    cwd?: string;
}
export interface VersioningGateResult {
    /** True when the commit should be blocked. */
    block: boolean;
    /** Stderr message — always present when stderr should be written.
     * Non-blocking warnings also use this. */
    stderr: string;
}
export declare function evaluateVersioningGate(input?: VersioningGateInput): Promise<VersioningGateResult>;
/**
 * Is this a source file that should trigger version-bump enforcement?
 * Generous definition: anything under `src/` for any language we support.
 */
export declare function isSourceFile(p: string): boolean;
/** Is this the repo's version manifest? */
export declare function isManifestFile(p: string): boolean;
/**
 * Parsed version jump from a manifest's staged diff.
 *
 * 0.7.23 / D5 — added so the gate can surface multi-patch catch-up
 * jumps (e.g. 0.7.10 → 0.7.14) which indicate previous src commits
 * shipped without bumps.
 */
export interface VersionJump {
    from: string;
    to: string;
}
/**
 * Look at the staged diff of a manifest and return the version jump
 * (from → to). Returns null when the diff doesn't touch a `version`
 * line at all.
 *
 * Exported for direct testing.
 */
export declare function readManifestVersionBump(cwd: string, manifestPath: string): Promise<VersionJump | null>;
/**
 * Parse `+`/`-` lines from a manifest diff and extract the version
 * jump. Cargo: `version = "..."`. package.json: `"version": "..."`.
 *
 * Anchor discipline:
 *   - Cargo (TOML, line-oriented) → anchor `^version` so we don't
 *     match a dep with `version = "..."` in `[dependencies.foo]`.
 *   - package.json (JSON, can be MINIFIED single-line) → do NOT
 *     anchor; `"version"` can appear mid-line in minified JSON.
 *
 * Exported for direct testing.
 */
export declare function parseVersionJumpFromDiff(diff: string): VersionJump | null;
/**
 * Detect a multi-patch jump: same major.minor, but patch advances by
 * more than 1 (catch-up bump).
 *
 * Returns false for:
 *   - First-time bumps (from === "")
 *   - Same-patch (no actual jump, shouldn't happen with proper diff)
 *   - Minor/major bumps (those are user-authorized; PATCH-ONLY rule
 *     forbids the agent from naming them but doesn't make them "drift")
 *   - Non-SemVer version strings (best-effort parse)
 *
 * Exported for direct testing.
 */
export declare function isMultiPatchJump(jump: VersionJump): boolean;
/**
 * Emergency-override env var. Loud stderr warning on bypass so it
 * always shows up in scrollback / CI logs. Exported for the test
 * suite.
 */
export declare function checkOverrideEnv(): boolean;
//# sourceMappingURL=versioning-gate.d.ts.map