Function: commitFromState()

August 8, 2026 · View on GitHub

@plures/praxis


@plures/praxis / index / commitFromState

Function: commitFromState()

commitFromState(diff): string

Defined in: src/project/project.ts:252

Generate a conventional commit message from a behavioral delta.

Unlike file-based commit messages, this describes WHAT behavioral changes occurred — rule additions, contract changes, expectation shifts.

Parameters

diff

PraxisDiff

The behavioral diff describing added, removed, and modified rules/contracts/expectations

Returns

string

A conventional commit message string (e.g. "feat(rules): add auth/login")

Example

const msg = commitFromState({
  rulesAdded: ['auth/login', 'auth/logout'],
  contractsAdded: ['auth/login'],
  ...empty
});
// → "feat(rules): add auth/login, auth/logout\n\nContracts added: auth/login"