/** * @file Runtime enforcers that keep a spawn honest against the advice * `advisor.mts` produced. Two independent checks: * * 1. Profile-floor discipline — `PROFILE_FLOOR` (`advisor.mts`) names the * MINIMUM lockdown tier a task class needs. A caller that runs a task at a * MORE capable tier than its floor is over-permissioned — not broken, but * a lockdown-rule smell worth flagging (the CLAUDE.md rule is "choose the * LEAST-capable tier that gets the job done"). ` meetsProfileFloor` * answers "is this capable enough to do the job"; `isOverProfileFloor` * answers the opposite question, "is this MORE capable than the job * needs." * 2. Ladder pairing — `AI_TIER` (`tier.mts`) pins each literal Claude tier model * to exactly one reasoning effort. `assertOnLadder` is the runtime twin of * the wheelhouse `ai-spawns-have-paired-effort` static check: it throws * when a caller pairs a known tier model with the wrong effort, or passes * a defined effort to an adaptive-only model (`isAdaptiveOnlyModel`) that * must run with `effort: undefined`. */ import type { AI_PROFILE } from './profiles.js'; import type { AiEffort } from './types.js'; /** * Assert that a `{ model, effort }` pair a caller is about to spawn is * correctly paired against the canonical ladder (`AI_TIER`). Two rules: * * - An adaptive-only model (`isAdaptiveOnlyModel` — fable/mythos) MUST be spawned * with `effort: undefined`; the effort dial does not apply to it. * - A literal `AI_TIER` model id MUST be spawned with exactly its row's pinned * effort. * * A model that is neither adaptive-only nor a literal `AI_TIER` id (a * cross-engine model like `gpt-5.5`, or a synthetic/opencode id) has nothing * on OUR ladder to check against and passes silently — this guard only * covers the Claude tier ladder, mirroring the wheelhouse * `ai-spawns-have-paired-effort` static check as a runtime twin. */ export declare function assertOnLadder(model: string, effort: AiEffort | undefined): void; /** * True when `chosen` is MORE capable than the job needs (its rank is strictly * above the floor's) — an over-permissioned spawn. This is the lockdown-risk * signal `advisor.mts`'s `PROFILE_FLOOR` exists to bound: every extra * capability above the floor is attack surface a compromised prompt could * reach for no task-shaped reason. Not a hard failure on its own — a caller * decides whether to log it, refuse it, or accept a documented exception. */ export declare function isOverProfileFloor(chosen: keyof typeof AI_PROFILE, floor: keyof typeof AI_PROFILE): boolean; /** * True when `chosen` is CAPABLE ENOUGH to do the job `floor` describes (its * rank is at or above the floor's). The affirmative half of the profile-floor * check: a `read`-floored grunt task run at `create` still meets its floor. */ export declare function meetsProfileFloor(chosen: keyof typeof AI_PROFILE, floor: keyof typeof AI_PROFILE): boolean; /** * Ladder position of a lockdown profile (`read` = 0 … `full` = 4). A thin, * exported accessor over `PROFILE_RANK` so callers compare profiles without * re-deriving the ladder order themselves. */ export declare function profileRank(profile: keyof typeof AI_PROFILE): number;