/** * Verification gate extensions — Tier-3 `metricsImproved` gate. * * Adds the `metricsImproved` gate to the verification system. This gate * requires a `metrics-delta` evidence atom proving that an experiment's * after-metrics are equal-to or better than its before-metrics on all * tracked dimensions. * * ## When is `metricsImproved` required? * * The gate is required in two situations: * * 1. The task is a Tier-3 auto-merge experiment (detected via * `meta.sentient.tier === 3` in the task metadata JSON). * 2. The caller explicitly requests the gate via `--gate metricsImproved`. * * For Tier-1 and Tier-2 tasks (or non-sentient tasks) the gate is never * injected into the `requiredGates` list automatically. * * ## Required evidence * * | Gate | Required atom kinds | * |-------------------|---------------------| * | `metricsImproved` | `metrics-delta` | * * @see packages/core/src/verification/evidence-atoms.ts * @task T1023 */ /** * All gate names supported by the CLEO verification system. * * Extends the base set from `packages/core/src/validation/verification.ts` * with `metricsImproved` for Tier-3 merge-ritual enforcement. * * @task T1023 */ export type ExtendedGateName = 'implemented' | 'testsPassed' | 'qaPassed' | 'cleanupDone' | 'securityPassed' | 'documented' | 'metricsImproved'; /** * The ordered sequence of all gates, including `metricsImproved` appended * at the end of the standard chain. * * Standard order: implemented → testsPassed → qaPassed → cleanupDone → * securityPassed → documented → **metricsImproved** * * @task T1023 */ export declare const EXTENDED_GATE_ORDER: readonly ExtendedGateName[]; /** * Minimum evidence required for the `metricsImproved` gate. * * At least one `metrics-delta` atom MUST be present. Alternative evidence * sets follow the same format as `GATE_EVIDENCE_MINIMUMS` in * `packages/core/src/tasks/evidence.ts`. * * @task T1023 */ export declare const METRICS_IMPROVED_REQUIRED_ATOMS: ReadonlyArray>; /** * Determine whether a task requires the `metricsImproved` gate. * * Returns `true` when the task metadata JSON declares `sentient.tier === 3`, * indicating this is a Tier-3 auto-merge experiment task that must prove * metric improvements before the merge-ritual can complete. * * Non-Tier-3 tasks (Tier 1, Tier 2, or tasks with no sentient metadata) * never require this gate automatically. It can still be added manually via * `--gate metricsImproved`. * * @param metadataJson - The raw `metadata_json` column value from the task * record (may be `null`, `undefined`, or a JSON string). * @returns `true` when the task is a Tier-3 experiment. * * @example * ```ts * const isT3 = isTier3Task('{"sentient":{"tier":3}}'); // true * const isT1 = isTier3Task('{"sentient":{"tier":1}}'); // false * const none = isTier3Task(null); // false * ``` * * @task T1023 */ export declare function isTier3Task(metadataJson: string | null | undefined): boolean; /** * Compute the list of required gates for a task, optionally injecting * `metricsImproved` for Tier-3 experiments. * * This function is intended as a helper for callers who need to build the * full required-gates list dynamically (e.g. `cleo complete`, verification * UI, IVTR merge ritual). * * @param baseRequiredGates - The default required gates from project config * (typically `['implemented', 'testsPassed', 'qaPassed', 'securityPassed', * 'documented']`). * @param metadataJson - Task metadata JSON (used for Tier-3 detection). * @param explicitGates - Any gates explicitly requested by the caller via * `--gate metricsImproved` or similar CLI flags. * @returns A deduplicated list of required gate names including any Tier-3 * injected gates. * * @example * ```ts * const gates = computeRequiredGates( * ['implemented', 'testsPassed'], * '{"sentient":{"tier":3}}', * [], * ); * // gates includes 'metricsImproved' * ``` * * @task T1023 */ export declare function computeRequiredGates(baseRequiredGates: string[], metadataJson: string | null | undefined, explicitGates?: string[]): ExtendedGateName[]; /** * Type guard: returns `true` when `name` is a valid {@link ExtendedGateName}. * * @param name - String to test. * * @task T1023 */ export declare function isExtendedGateName(name: string): name is ExtendedGateName; //# sourceMappingURL=gates.d.ts.map