Skip to content

Governed Rules

A governed rule connects the readable source to a specific compiled artifact, test report, release decision, and execution record.

Add a Rule: section at the top of the source:

Rule:
id: lending.dti_check
version: 1.2.0
author: Risk Operations
effective from 2026-01-01
effective until 2026-12-31
debt_ratio equals monthly_debt divided by monthly_income
If debt_ratio is greater than 0.43:
Respond with "declined"
Respond with "approved"

id and version are required. The compiler includes the rule metadata in the manifest and bytecode, so the identity travels with the executable artifact instead of living only in surrounding documentation.

Pass candidate versions with an as-of date:

Terminal window
devlish run lending-v1.dvl lending-v2.dvl --as-of 2026-07-01

Devlish selects the version whose effective window contains the date and rejects gaps, overlaps, or mismatched rule identifiers.

The JavaScript runtime exposes the selected identity without running the rule:

const tool = await loadTool({ bytecode });
console.log(tool.info.rule);
// {
// id: "lending.dti_check",
// version: "1.2.0",
// author: "Risk Operations",
// effectiveFrom: "2026-01-01",
// effectiveUntil: "2026-12-31"
// }

tool.info.rule is null for an ungoverned artifact.

Rule identity is the starting point:

  1. Evidence bundles bind golden-case results to the compiled artifact hash.
  2. Controlled releases allow only an approved, published artifact to run under --governed.
  3. Audit and replay record which artifact ran and reproduce it against the captured effects.