/**
 * Learning format validator (Karpathy-lite / Entity-Centric)
 *
 * Implements the 4-rule preflight defined by ARCHIVIST-V2.f1
 * (`.crewly/tasks/autonomy_v1/follow-up/archivist-v2-record-learning-preflight.md`).
 *
 * Rules:
 *   1. Entity opener — text MUST start with `[[Entity Name]]` (one bracketed token).
 *   2. Sentence count — 1..3 sentences (split on `[.!?]+\s+`, filter empties).
 *   3. Linked or sourced — at minimum one of:
 *        - a second `[[Entity]]` link, OR
 *        - a `PR #...`, `Task #...`, `Issue #...`, `#NNN`, `Ref:`, `See:`, `Log:` source citation.
 *   4. No log-style anti-pattern — soft check: warn (don't reject) if text begins
 *      with a personal pronoun ("I fixed", "I tried", "We added", etc.).
 *
 * Default mode (`strict: false`):
 *   - Rule 1 → hard error (the entity opener is the joinability hook for
 *     Archivist v2 cross-doc synthesis; without it the learning has no anchor).
 *   - Rules 2..4 → soft warnings (accept the learning, surface the violation).
 *
 * Strict mode (`strict: true`):
 *   - All 4 rules emit hard errors. Used by CI / Archivist v2 callers that
 *     enforce full conformance.
 *
 * Lax-by-controller policy (v1.5 / convention-only):
 *   The controller wiring is deferred. The validator is shipped as a
 *   reusable utility so callers (CLI, tests, future Archivist v2 synthesizer,
 *   future controller integration) can opt into enforcement as needed.
 *   See `archivist-v2-record-learning-preflight.md` § Validator behavior and
 *   the orc note ("Convention-only enforcement is OK in v1.5").
 *
 * @module services/memory/learning-format.validator
 */
/** A single rule violation produced by {@link validateLearningFormat}. */
export interface LearningValidationIssue {
    /** Numeric rule id (1..4) */
    rule: 1 | 2 | 3 | 4;
    /** Stable machine-readable rule name */
    ruleName: 'entity_opener' | 'sentence_count' | 'linked_or_sourced' | 'no_log_style';
    /** Human-readable description of the violation */
    message: string;
    /** Optional suggested fix (entity opener / shortening / link insertion) */
    suggestion?: string;
    /** Pointer to the SKILL.md mandate section */
    skillRef: string;
}
/** Result returned by {@link validateLearningFormat}. */
export interface LearningValidationResult {
    /** True when no errors (warnings are not failure). */
    pass: boolean;
    /** Hard violations — caller MUST reject when `pass === false`. */
    errors: LearningValidationIssue[];
    /** Soft violations — caller SHOULD log/surface but MAY accept. */
    warnings: LearningValidationIssue[];
}
/** Options for {@link validateLearningFormat}. */
export interface LearningValidationOptions {
    /**
     * When true, escalate all soft warnings (rules 2..4) to hard errors.
     * Rule 1 is always a hard error regardless of this flag.
     * @default false
     */
    strict?: boolean;
}
/**
 * Validate a learning text against the Karpathy-lite format rules.
 *
 * @param rawText - The learning text submitted to `record-learning`.
 * @param options - Validator options ({@link LearningValidationOptions}).
 * @returns A {@link LearningValidationResult} with errors and warnings split.
 *
 * @example
 * ```typescript
 * const result = validateLearningFormat('I fixed the bug today', { strict: false });
 * // → { pass: false, errors: [<rule 1>], warnings: [<rule 3>, <rule 4>] }
 * ```
 *
 * @example
 * ```typescript
 * const result = validateLearningFormat(
 *   '[[Fts5IndexService]] FTS5 rank is negative; invert. PR #320',
 *   { strict: true }
 * );
 * // → { pass: true, errors: [], warnings: [] }
 * ```
 */
export declare function validateLearningFormat(rawText: string, options?: LearningValidationOptions): LearningValidationResult;
/**
 * Format a {@link LearningValidationIssue} as a multi-line string suitable
 * for stderr / log output. Includes the offending text snippet and SKILL ref.
 *
 * @param issue - The issue to format.
 * @param rawText - The full learning text (for snippet context).
 * @returns A multi-line formatted string.
 */
export declare function formatValidationMessage(issue: LearningValidationIssue, rawText: string): string;
//# sourceMappingURL=learning-format.validator.d.ts.map