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-person-tightening.ts
GitHub Actions (publish-mods)chore: Update mods/ 8a8dff6 · 9 days ago History
28 lines · 806 BRaw
1import type { EventResult } from 'claude-code'
2
3import { isSameVerdict } from './is-same-verdict.js'
4
5/**
6 * Whether an answer is a host's ask with nothing changed but its `decider`,
7 * now a person: the same ask, which no classifier's allow settles.
8 *
9 * @param held what the run past the user tier settled on
10 * @param answer what the whole chain settled on
11 * @returns true when the answer only tightened the ask
12 */
13export function isPersonTightening(
14 held: EventResult<'tool.check'>,
15 answer: EventResult<'tool.check'>,
16): boolean {
17 const decider: string | undefined = answer.decider
18
19 return (
20 held.decision === 'ask' &&
21 held.decider === 'host' &&
22 decider === 'person' &&
23 isSameVerdict({ ...held, decider: undefined }, {
24 ...answer,
25 decider: undefined,
26 })
27 )
28}