@svatah/yam-healer
Failure selection, model-free repair, verification and diff
- Source:
packages/healer· README:packages/healer/README.md - Install:
npm install @svatah/yam-healer - Version 0.1.0 · Apache-2.0
Exports
| Export | Kind | Signature | |
|---|---|---|---|
clearRegrounder | function | export function clearRegrounder(): void | Put the default back. For tests, and for a CLI that ran without a gateway. |
clearReplayer | function | export function clearReplayer(): void | Put the default back. For tests, and for a CLI running without the runtime. |
currentRegrounder | function | export function currentRegrounder(): Regrounder | The registered Regrounder, or the no-op default. |
currentReplayer | function | export function currentReplayer(): Replayer | |
entryFrom | function | export function entryFrom( | An entry a heal proposal would write, built from a relocalization. |
EvalBinding | interface | export interface EvalBinding | A binding recorded at variant 0. |
EvalCase | interface | export interface EvalCase | One binding on one variant. |
FileChange | interface | export interface FileChange | One file's before and after, as text. |
hasRegrounder | function | export function hasRegrounder(): boolean | Whether anything but the no-op is registered — the report says so. |
hasReplayer | function | export function hasReplayer(): boolean | Whether anything but the session-state default is registered. |
heal | function | export async function heal(options: HealOptions): Promise<HealReport> | Run the heal job. Nothing is written; the caller decides what to do with the diff. |
HealingEvalOptions | interface | export interface HealingEvalOptions | |
HealingEvalReport | interface | export interface HealingEvalReport | |
HealInput | interface | export interface HealInput | One failure to repair. |
HealOptions | interface | export interface HealOptions | |
HealReport | interface | export interface HealReport | |
HealResult | interface | export interface HealResult | What happened to one failure. |
METHOD | variable | METHOD = [ | |
MODEL_THRESHOLD | variable | MODEL_THRESHOLD = 0.85 | REQ-HEAL-5: "with one model call at least 85 percent". |
NO_REGROUNDER | variable | NO_REGROUNDER: Regrounder | The default: no model, no grounding, no pretence. |
reachedRecordedPage | function | export async function reachedRecordedPage( | Did the session actually land on the page the failure was recorded on? |
readBindFailures | function | export function readBindFailures(outputDir: string): HealInput[] | Read .yam/bind-failures.jsonl. |
readRunFailures | function | export function readRunFailures(runDir: string): HealInput[] | Read the locator failures out of a run directory (runs/<id>/results.jsonl). |
reasonOf | function | export function reasonOf(outcome: ReplayOutcome): string | undefined | The explanation a replayer gave, when it gave one. |
recordBaseline | function | export async function recordBaseline( | Record bindings for every interactive element on every page, at variant 0. |
registerRegrounder | function | export function registerRegrounder(regrounder: Regrounder): void | Register the implementation module (b) provides. The CLI does this at start |
registerReplayer | function | export function registerReplayer(replayer: Replayer): void | Register module (b)'s runtime-backed replayer. @svatah/yam does this when |
Regrounder | interface | export interface Regrounder | The model half of REQ-HEAL-1, as an interface the healer depends on and module |
RegroundRequest | interface | export interface RegroundRequest | What the healer knows about the element it is trying to re-find. |
RELOCALIZE_THRESHOLD | variable | RELOCALIZE_THRESHOLD = 0.6 | REQ-HEAL-5: "relocalization alone at least 60 percent". |
renderHealingEvalMarkdown | function | export function renderHealingEvalMarkdown( | |
renderHealingEvalSummary | function | export function renderHealingEvalSummary(report: HealingEvalReport): string | The same numbers as one line, for a terminal. |
renderHealMarkdown | function | export function renderHealMarkdown(report: HealReport): string | A Markdown report, for a pull request or the release notes (REQ-PKG-4). |
renderHealReport | function | export function renderHealReport(report: HealReport): string | A plain-text report for a terminal. |
ReplayContext | interface | export interface ReplayContext | What a replayer needs beyond the failure itself (Draft 2.6, LLD §10). |
Replayer | interface | export interface Replayer | |
ReplayOutcome | typealias | export type ReplayOutcome | Whether the replayer got back to the failing step, and if not, why. |
runHealingEval | function | export async function runHealingEval(options: HealingEvalOptions): Promise<HealingEvalReport> | The eval (REQ-HEAL-5). |
samePath | function | export function samePath(a: string, b: string): boolean | Two URLs naming the same path, whatever their origin or query. |
SESSION_STATE_REPLAYER | variable | SESSION_STATE_REPLAYER: Replayer | The default: restore the session state recorded with the failure. |
unifiedDiff | function | export function unifiedDiff(change: FileChange, context = CONTEXT): string | A unified diff for one file, or "" when nothing changed. |
unifiedDiffFor | function | export function unifiedDiffFor(changes: readonly FileChange[], context = CONTEXT): string | One diff for a set of changed files, in path order. |
unreached | function | export function unreached(outcome: ReplayOutcome): boolean | unreachable in either spelling. |
VariantResult | interface | export interface VariantResult |