/**
 * Pipeline step: Mirror repo-based tasks to the Content Lake.
 *
 * When --repo-tasks-path is provided, this step upserts mirror documents
 * in the Sanity Content Lake for all repo-sourced tasks. This makes
 * repo tasks visible in Studio with full provenance tracking.
 *
 * Two paths reach this step:
 *
 *   - **Dogfood** (`taskSourceType` unset): the framework mirroring its own
 *     `.ailf/tasks/` suite. Best-effort and non-blocking — a write failure
 *     never fails the eval.
 *   - **External registration** (`taskSourceType: "repo"` + `registerTasks`):
 *     a cross-repo consumer opting in to register its submitted suite. Here a
 *     gate refusal is NOT a silent skip — the caller explicitly asked to
 *     register, so a refusal aborts the run with a structured, caller-actionable
 *     error (the same `code` / `message` / `remediation` the gateway pre-flight
 *     returns). This replaces the W0145 blanket skip, which turned the external
 *     path off entirely because it wrote false provenance and had no governance.
 *
 * The step is therefore non-optional (like `ProvenanceGateStep`): the orchestrator
 * only aborts on a *non-optional* step returning `status: "failed"`. It returns
 * `failed` ONLY on a registration refusal; every other failure mode (dogfood
 * mirror errors, transient I/O) is downgraded to a non-blocking `skipped` /
 * `success` so the long-standing "mirror failure does not block the eval"
 * contract holds for the dogfood path.
 *
 * It runs after validate and before fetch-docs so mirror documents exist
 * before evaluation begins — which is also why a registration refusal aborts
 * before any compute is spent.
 *
 * @see packages/eval/src/pipeline/mirror-repo-tasks.ts
 * @see docs/superpowers/specs/2026-06-15-external-task-registration-design.md (§1, §3, §4, §6)
 * @see docs/decisions/D0037-run-classification-and-ownership-taxonomy.md
 */
import type { SanityClient } from "@sanity/client";
import { type AppContext, type LiteracyTaskDefinition, type PipelineStep, type ResolveActiveTeamResult, type StepResult, type TeamLookupClient, type ValidationIssue } from "../../_vendor/ailf-core/index.d.ts";
import { type MirrorOptions, type MirrorResult } from "../../pipeline/mirror-repo-tasks.js";
/**
 * Collaborators the step delegates to, injectable for testing. Each defaults to
 * the real implementation; tests pass fakes so the gate truth table runs with
 * no Content Lake I/O and no composition-root wiring (testing rule: ports for
 * test doubles, not mocked composition roots).
 */
export interface MirrorStepDeps {
    /** Load the full submitted suite from the repo-tasks directory. */
    loadRepoTasks?: (repoTasksPath: string) => Promise<LiteracyTaskDefinition[]>;
    /** Resolve `owner.team` to an active/archived/absent verdict. */
    resolveTeam?: (slug: string, client: TeamLookupClient) => Promise<ResolveActiveTeamResult>;
    /** Find in-scope areas already owned by a different team (registration conflict). */
    findConflicts?: (client: SanityClient, areas: string[], ownerTeamId: string) => Promise<{
        area: string;
        existingTeam: string;
    }[]>;
    /** Run the mirror write. */
    runMirror?: (options: MirrorOptions) => Promise<MirrorResult>;
    /** Build the AILF-scoped write client. */
    createWriteClient?: (token: string) => SanityClient;
    /** Build the editorial read client (for canonical-doc slug resolution). */
    createEditorialClient?: () => SanityClient;
}
export declare class MirrorRepoTasksStep implements PipelineStep {
    readonly name = "mirror-repo-tasks";
    readonly optional = false;
    private readonly loadRepoTasks;
    private readonly resolveTeam;
    private readonly findConflicts;
    private readonly runMirror;
    private readonly createWriteClient;
    private readonly createEditorialClient;
    constructor(deps?: MirrorStepDeps);
    check(_ctx: AppContext): ValidationIssue[];
    execute(ctx: AppContext): Promise<StepResult>;
    /**
     * Turn a refused registration into a failed StepResult. The orchestrator
     * lifts a failed non-optional step into the run's
     * `failureReason { type: "step-failed", step, message }`, which
     * external-eval.yml's safety-net writes to the job `error` field and the
     * HMAC callback returns. The single string channel carries the same `code`,
     * `message`, and `remediation` the gateway pre-flight surfaces (both compose
     * the error via the shared `buildRegistrationError`).
     */
    private refuse;
    /**
     * Resolve a non-fatal mirror obstacle (couldn't build the client, couldn't
     * load tasks). On the dogfood path it is a non-blocking `skipped`; when
     * registering it aborts (`failed`) so the caller learns their explicit
     * registration request did not happen. The single place the
     * "dogfood never fails" invariant for setup failures lives.
     */
    private obstacle;
}
