import type { ArtifactBundle } from "../io/artifacts.js"; import type { AnalyzerConsentTokenGrant, AnalyzerSetting, GraphEdge } from "audit-tools/shared"; import type { AnalyzerPlanEntry } from "../extractors/analyzers/types.js"; import { EXTERNAL_ANALYZER_CANDIDATES } from "audit-tools/shared"; /** * Inputs the fold-level host-input pauses depend on. These mirror the fields the * `next-step` fold reads when deciding whether to emit an interactive host step * (`analyzer_install` / `edge_reasoning_dispatch`) instead of running the deterministic * graph-enrichment executor. Single-sourcing them here keeps the drain loop and * the primary fold from drifting on WHERE the pipeline pauses for the operator. */ export interface HostInputPauseInputs { /** Repo root — the analyzer plan resolves dependencies against it. */ root?: string; /** Per-analyzer resolution policy (drives the analyzer-install consent fold). */ analyzers?: Record; /** Phase 4B gate: low-confidence edge-reasoning host turn only fires when true. */ graphLlmEdgeReasoning?: boolean; /** Item B: acquisition gate — the consent fold only fires when acquisition is live. */ externalAcquisitionEnabled?: boolean; /** Item B: recorded per-candidate consent decisions (session config). */ analyzerConsent?: Record; /** * Item B: a per-run, tool-SCOPED consent grant. Typed as the * {@link AnalyzerConsentTokenGrant} shape — never a bare string — so the * scoped consent-fold below can ask exactly which candidates the grant names: * a candidate outside the grant's `tools` is still owed its offer. A bare * string would read as "admits everything", which is precisely the unscoped * path this type retires. */ acquisitionConsentToken?: AnalyzerConsentTokenGrant; } /** * The undecided analyzer-install entries the graph-enrichment step still owes the * operator a consent decision on. This is the SINGLE source of the analyzer-install * consent fold — consumed both by the `next-step` fold (`handleGraphEnrichmentBranch`, * which relays the list as the host step) AND by the drain stop predicate below * (which stops when the list is non-empty). Absent a root / manifest there is * nothing to resolve, so nothing is owed. */ export declare function graphEnrichmentUnresolvedAnalyzers(bundle: ArtifactBundle, inputs: HostInputPauseInputs): AnalyzerPlanEntry[]; /** * Item B (consent surfacing): the consent-gated analyzer candidates that are * APPLICABLE to this repo and have NO recorded decision AND are not admitted by * this run's consent grant — the set the operator is still owed a batched offer * on. The SINGLE source of the analyzer-consent fold, consumed by BOTH the * `next-step` fold (which relays the list as the offer step) and the drain stop * predicate (which halts before the acquisition executor would silently skip * them — the silent-fail-closed defect the mechanical-analyzer-layer program * exists to fix). Nothing is owed when acquisition is off, the candidate has a * recorded decision (declined is never re-offered), the setting is `skip`, or * THIS RUN's grant names the candidate. A grant that does not name a candidate * leaves it owed — scope is honored per candidate, never widened to the run. */ export declare function pendingAnalyzerConsent(inputs: HostInputPauseInputs): typeof EXTERNAL_ANALYZER_CANDIDATES; /** * The low-confidence graph edges the graph-enrichment step still owes a host * edge-reasoning turn on. The SINGLE source of the edge-reasoning fold: the flag * must be on and the floor must carry at least one low-confidence edge candidate. * Consumed by both `handleGraphEnrichmentBranch` (relays the candidates as the host * step) and the drain stop predicate (stops when the list is non-empty). */ export declare function graphEnrichmentLowConfidenceEdges(bundle: ArtifactBundle, inputs: HostInputPauseInputs): GraphEdge[]; /** * The SINGLE fold-aware stop predicate consumed by BOTH the `advanceAudit` drain * loop AND the `next-step` fold. True when the next step derived from `bundle` * pauses for HOST INPUT and must not be resolved deterministically in-process. * * Two classes of pause: * 1. A registry-level host-delegation executor (intent / * charter checkpoints, design-review + clarification + systemic-challenge * loops, synthesis narrative, dispatch handoffs). `isHostDelegationExecutor` * already sees every one of these — they are `kind: "host_delegation"` in the * executor registry. * 2. A FOLD-LEVEL interactive pause the registry cannot see: the * `graph_enrichment_executor` is registered `deterministic`, but the fold * emits an `analyzer_install` consent step (undecided analyzer installs) or * an `edge_reasoning_dispatch` step (low-confidence edges + flag on) BEFORE running it. * A registry-only gate (`isHostDelegationExecutor`) is blind to (2), so an * unconditional drain would silently skip an operator-interactive step — * exactly the latent failure this predicate closes. It reuses the SAME * fold-detection helpers the `next-step` fold does, so the two cannot drift. * * Chain-length/index-agnostic: the decision is re-derived from `decideNextStep` * each call, never a fixed executor index. */ export declare function nextStepPausesForHostInput(bundle: ArtifactBundle, inputs?: HostInputPauseInputs): boolean; /** * True when the next step is a deterministic, runner-backed regen step the drain * loop may resolve in-process — i.e. it has a runner AND does NOT pause for host * input (neither a registry host-delegation boundary nor a fold-level interactive * pause). Callers pass the runner-presence check via `hasRunner` so this module * stays free of the executor-runner import (which would pull the whole executor * graph into the pause predicate). */ export declare function nextStepIsDrainableRegen(bundle: ArtifactBundle, hasRunner: (executor: string) => boolean, inputs?: HostInputPauseInputs): boolean; //# sourceMappingURL=hostInputPause.d.ts.map