v0.2.4

Documentation version

v0.2.4v0.3.2
en

Documentation language

en

Search documentation

ESC

Documentation search

What are you working on?

Find a guide, configuration option, action, or ESH topic.

Browse documentation
DocsRepository policy configuration

Repository policy configuration

.evin/policy.json defines repository-wide policies consumed by Git hooks, release actions, and repository tooling. It complements .flow files, which describe Evin's workflow orchestration.

The manifest is standard JSON. Its required $schema property points to the versioned public schema at https://dl.everyinit.dev/schema/v1/policy. Editor tooling can use that URI for structural validation and completion. Evin also performs semantic checks at runtime and bundles the matching schema, so loading a project does not depend on a network request.

The schema contract is versioned independently of Evin releases. Compatible additions can be made under /v1/; incompatible shape changes use a new versioned URL. A project's $schema URI selects that contract explicitly. The checked-in schema is generated from the Rust model. Regenerate it with cargo run --locked -p evin-config --example export_schemas and verify it with cargo evin-dev run schema-check.

Root schema

RepositoryPolicy Define repository governance, release impact rules, and Git hook policies.

The root object accepts $schema, name, description, and the policy namespaces commits, branches, releases, tags, pull_requests, authorship, history, files, lfs, submodules, and remotes. Unknown properties are rejected. Omitted namespaces use their documented defaults.

Metadata

RepositoryPolicy.$schema Select the versioned JSON Schema contract for this policy document.

Use the published schema URI as the $schema value. The schema is bundled with Evin for offline runtime validation.

RepositoryPolicy.name Give the repository policy a human-readable name.

The policy name appears in Evin diagnostics and summaries.

Commit and branch policies

RepositoryPolicy.commits Configure conventional commit formatting and validation.

message_format accepts a string or a list of alternatives. fields can constrain named placeholders with allowed values, casing, patterns, or length limits. Commit policies are enforced by the commit-msg hook and are also consumed by changelog and version-bumper actions.

RepositoryPolicy.branches Validate branch names and configure push protections.

Branch formats use named placeholders and can define field constraints. policies.block_push_to_main controls direct pushes to the default branch.

Release policy

RepositoryPolicy.releases Map change types to version bumps and changelog sections.

change_types maps commit types to major, minor, patch, or none impacts and changelog sections. versioning.strategy is semver by default; cargo applies Cargo-compatible pre-1.0 versioning. packages can declare release targets and watched paths.

Other policy namespaces

The remaining namespaces configure tag naming and deletion, pull request metadata, author identity, history checks, staged file rules, Git LFS, submodules, and allowed push remotes. Their accepted fields and value types are defined in the policy JSON Schema.

Example

{
  "$schema": "https://dl.everyinit.dev/schema/v1/policy",
  "name": "Repository Development Standard",
  "commits": {
    "message_format": ["{type}({scope}?){breaking?}: {description}", "{type}: {description}"],
    "fields": {
      "type": { "allowed_values": ["feat", "fix", "docs", "refactor", "test", "chore"] }
    }
  },
  "releases": {
    "versioning": { "strategy": "cargo" },
    "change_types": {
      "feat": { "bump": "minor", "changelog_section": "Features" },
      "fix": { "bump": "patch", "changelog_section": "Bug Fixes" }
    }
  }
}

evin sync installs policy-enforcing Git hooks even when no workflow task is bound. Task hooks can be attached independently with on.hooks in .flow files. Policy changes can be inspected with evin sync --dry-run --verbose and checked with evin check.

Migrating from 0.2.x

Rename .evin/gitrules.flow to .evin/policy.json, convert the document to JSON, remove the #!evin/v1 header and root version, then add the $schema property shown above. In .evin/workspace.flow, rename workspace.rules to workspace.policy and point it at .evin/policy.json. Evin 0.3.0 does not load the old path or field and does not provide an automatic migration command.

Page source: reference/50.repository-policy-configuration.4530.md