Problem
There is no automated enforcement that commits on feature branches follow the Lore protocol. Contributors can push regular commits without Lore trailers, and this is only caught during manual review (if at all). This undermines the protocol's goal of capturing decision context for every change.
Proposed Solution
Provide Lore commit validation as a portable, installable hook that works across CI platforms and local development environments — not just GitHub Actions.
Distribution Channels
1. Git Hook (local development)
A commit-msg hook that validates each commit at authoring time:
# Install via lore CLI
lore hooks install
# Or manually — .git/hooks/commit-msg
#!/bin/sh
lore validate --last 1 --strict
Should also support pre-commit framework for teams already using it:
# .pre-commit-config.yaml
repos:
- repo: https://github.com/Ian-stetsenko/lore-protocol
rev: v0.3.0
hooks:
- id: lore-validate
stages: [commit-msg]
And Husky for Node.js projects:
# .husky/commit-msg
npx lore validate --last 1 --strict
2. CI Pipeline (PR validation)
Validates all commits in a PR range. Should work in any CI system, not just GitHub Actions:
GitHub Actions:
- run: npx lore validate --since origin/main --strict --json
GitLab CI:
validate-lore:
script:
- npx lore validate --since origin/main --strict
Bitbucket Pipelines, Jenkins, CircleCI, etc.:
npx lore validate --since origin/$TARGET_BRANCH --strict
The CLI is the portable interface — CI integration is just a one-liner wrapping lore validate.
3. GitHub Action (optional convenience wrapper)
For GitHub-native teams, a published action for cleaner workflow syntax:
- uses: Ian-stetsenko/lore-protocol-action@v1
with:
strict: true
since: origin/main
This would be a thin wrapper around lore validate that handles setup (Node.js, npm install) and provides nice PR annotations.
Validation Behavior
For each commit in the range:
- Check that a
Lore-id trailer is present
- Check that required trailers (per
.lore/config.toml) are present
- Validate trailer format and enum values
- Report which commits failed and why
Exit codes: 0 = all valid, 1 = errors found, 2 = warnings only
Configuration
Strictness configurable per-project via .lore/config.toml:
[validation]
strict = true # treat warnings as errors
required = ["Confidence"] # trailers that must be present
[hooks]
enforce = true # enable/disable hook enforcement
allow_fixup = true # allow fixup!/squash! commits (validated after squash)
skip_authors = ["dependabot[bot]"] # skip validation for automated commits
skip_patterns = ["^Merge "] # skip merge commits
Edge Cases
- Merge commits — skip by default (no decision context needed)
- Fixup/squash commits — allow if
allow_fixup = true, validated after squash
- Dependabot/automated commits — configurable allowlist of authors or commit patterns
- Initial adoption —
--since flag scopes enforcement to new commits only
Existing CLI Support
lore validate already supports:
--since <ref> — validate commits in a range
--last <n> — validate last N commits
--strict — treat warnings as errors
--json — machine-readable output for CI integration
Implementation Phases
lore hooks install command — installs commit-msg hook into .git/hooks/
- pre-commit framework integration —
.pre-commit-hooks.yaml in repo root
- Documentation — setup guides for Husky, pre-commit, and major CI platforms
- GitHub Action (optional) — published action for convenience
Problem
There is no automated enforcement that commits on feature branches follow the Lore protocol. Contributors can push regular commits without Lore trailers, and this is only caught during manual review (if at all). This undermines the protocol's goal of capturing decision context for every change.
Proposed Solution
Provide Lore commit validation as a portable, installable hook that works across CI platforms and local development environments — not just GitHub Actions.
Distribution Channels
1. Git Hook (local development)
A
commit-msghook that validates each commit at authoring time:Should also support pre-commit framework for teams already using it:
And Husky for Node.js projects:
# .husky/commit-msg npx lore validate --last 1 --strict2. CI Pipeline (PR validation)
Validates all commits in a PR range. Should work in any CI system, not just GitHub Actions:
GitHub Actions:
GitLab CI:
Bitbucket Pipelines, Jenkins, CircleCI, etc.:
npx lore validate --since origin/$TARGET_BRANCH --strictThe CLI is the portable interface — CI integration is just a one-liner wrapping
lore validate.3. GitHub Action (optional convenience wrapper)
For GitHub-native teams, a published action for cleaner workflow syntax:
This would be a thin wrapper around
lore validatethat handles setup (Node.js, npm install) and provides nice PR annotations.Validation Behavior
For each commit in the range:
Lore-idtrailer is present.lore/config.toml) are presentExit codes: 0 = all valid, 1 = errors found, 2 = warnings only
Configuration
Strictness configurable per-project via
.lore/config.toml:Edge Cases
allow_fixup = true, validated after squash--sinceflag scopes enforcement to new commits onlyExisting CLI Support
lore validatealready supports:--since <ref>— validate commits in a range--last <n>— validate last N commits--strict— treat warnings as errors--json— machine-readable output for CI integrationImplementation Phases
lore hooks installcommand — installscommit-msghook into.git/hooks/.pre-commit-hooks.yamlin repo root