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 / is-ceiling-held.ts
21 lines · 828 BRaw
1import type { EventResult } from 'claude-code'
2
3import Ranking from './ranking'
4
5/**
6 * Whether the run past the user tier holds over the chain's answer for the
7 * organization's ceiling: the answer is over it, and that run is stricter.
8 *
9 * A run as permissive as the answer holds nothing, so the verdict returned
10 * in the answer's place is never the looser of the two.
11 *
12 * @param answer what the whole chain settled on
13 * @param held what the run past the user tier settled on
14 * @param ceiling the question's `ceiling`, which the engine pins
15 * @returns true when the run past the user tier is the answer
16 */
17export const isCeilingHeld = (
18 answer: EventResult<'tool.check'>,
19 held: EventResult<'tool.check'>,
20 ceiling: string | undefined,
21) => Ranking.isOverCeiling(answer, ceiling) && Ranking.isLooser(answer, held)