Line

You are reading docs for v0.8. See latest (v0.9)

packages/engine/prHealth

PR health: what a change between two commits MEANS, computed deterministically.

Engine, v0.8. Source: packages/engine/prHealth.mjs.

Variables#

FLOW_SCENARIO_MAX#

const FLOW_SCENARIO_MAX: 100 = 100

Defined in: packages/engine/prHealth.mjs:41

Scenario cap per machine when diffing flows (the narrator's default of 25 would hide differences).


MAX_LISTED#

const MAX_LISTED: 200 = 200

Defined in: packages/engine/prHealth.mjs:42


MECHANICAL_RULES#

const MECHANICAL_RULES: Readonly<{ READ-001: { available: boolean; via: string; when: (v) => boolean; why: string; }; SLICE-002: { available: boolean; via: string; when: () => true; why: string; }; SLICE-003: { available: boolean; via: string; when: () => true; why: string; }; }>

Defined in: packages/engine/prHealth.mjs:46

Rules whose violation a Construct block can resolve with no model. Everything else is a conversation. available:false means the fix is mechanical in kind but no command performs it yet.


SCHEMA_VERSION#

const SCHEMA_VERSION: 1 = 1

Defined in: packages/engine/prHealth.mjs:39

Functions#

prHealth()#

prHealth(root, request?, opts?): any

Defined in: packages/engine/prHealth.mjs:497

Compute the PR-health indicators for the change from base to head.

Parameters#

root

string

project root (inside a git repository)

request?
base

string

expected?

any

head

string

mergeBase?

boolean

opts?

forwarded to the impact analysis

depth?

number

limits?

any

Returns#

any

pr-health v1 report, or {ok:false, error}. Never throws, never writes.


prHealthApiManifest()#

prHealthApiManifest(): any

Defined in: packages/engine/prHealth.mjs:553

Machine-readable description of the API, mirroring impactApiManifest.

Returns#

any

The usage note for prHealth: signature, CLI, indicators, resolutions and schema.


renderPrHealthMarkdown()#

renderPrHealthMarkdown(report): string

Defined in: packages/engine/prHealth.mjs:534

A short markdown rendering for the CLI. The JSON is the contract; this is a convenience.

Parameters#

report

any

A prHealth() result.

Returns#

string

Markdown with one section per indicator, or a one-line failure.