spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / hooks / held-verdict / verdicts / ranking / is-over-ceiling.ts
19 lines · 673 BRaw
1import type { EventResult } from 'claude-code'
2
3import { ceilingVerdict } from './ceiling-verdict'
4import { LENIENCY } from './leniency'
5
6/**
7 * Whether a `tool.check` verdict is more permissive than the ceiling the
8 * organization set on the tool: never where it set none.
9 *
10 * @param verdict what a run of the chain settled on
11 * @param ceiling the question's `ceiling`, which the engine pins
12 * @returns true when the verdict lets the call go further than the ceiling
13 */
14export const isOverCeiling = (
15 verdict: EventResult<'tool.check'>,
16 ceiling: string | undefined,
17) =>
18 ceiling !== undefined &&
19 LENIENCY[verdict.decision] > LENIENCY[ceilingVerdict(ceiling)]