Skip to content

expertGuidance

and fail-open helpers.

Types

ExpertGuidance

What an expert consult returns.

  • rules are for the solver to read;
  • checklist are concrete, checkable acceptance criteria. Empty rules and checklist means "nothing domain-specific here".
ts
/** What an expert consult returns.
- `rules` are for the solver to read;
- `checklist` are concrete, checkable acceptance criteria.
Empty rules and checklist means "nothing domain-specific here". */
export type ExpertGuidance = {
  domain: string;
  rules: string[];
  checklist: string[]
}

(source)

Constants

emptyGuidance

ts
export static const emptyGuidance: ExpertGuidance = {
  domain: "",
  rules: [],
  checklist: []
}

Type: ExpertGuidance

(source)

Functions

renderGuidance

ts
renderGuidance(guidance: ExpertGuidance): string

Fold expert guidance into a context block the coding agent reads before it starts. Empty guidance yields an empty string.

Parameters:

NameTypeDefault
guidanceExpertGuidance

Returns: string

(source)

guidanceOrEmpty

ts
guidanceOrEmpty(result: Result<ExpertGuidance>): ExpertGuidance

Unwrap a consult Result, failing open: a consult that errored yields empty guidance, so the caller proceeds as if no consult happened.

Parameters:

NameTypeDefault
resultResult<ExpertGuidance>

Returns: ExpertGuidance

(source)