Validation & CI
lore validate
Section titled “lore validate”Validates commits for Lore protocol compliance. Designed for CI/CD integration.
lore validate # validate last commitlore validate HEAD~5..HEAD # validate a rangelore validate --since main # all commits since branching from mainlore validate --last 3 # last 3 commitsValidation Rules
Section titled “Validation Rules”| Rule | Severity | Description |
|---|---|---|
| Valid trailer format | ERROR | Trailers must be parseable key-value pairs |
| Valid enum values | ERROR | Confidence, Scope-risk, Reversibility must use allowed values |
| Lore-id present | ERROR | Every Lore-enriched commit must have a Lore-id |
| Lore-id format | ERROR | Must be 8-char hex |
| Lore-id unique | ERROR | No two commits share a Lore-id |
| Intent <= 72 chars | WARNING | Subject line length |
| Required trailers present | WARNING or ERROR | Per .lore/config.toml setting |
| Message <= max lines | WARNING | Per .lore/config.toml setting |
| References valid | WARNING | Supersedes/Depends-on/Related point to existing atoms |
| > 5 of any trailer type | WARNING | Commit may be too large; consider splitting |
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | All commits valid |
| 1 | One or more errors found |
| 2 | Warnings only (no errors) |
Text Output
Section titled “Text Output”$ lore validate HEAD~3..HEAD
✗ abc1234 "Add auth interceptor" ERROR: Missing Lore-id trailer WARNING: No Constraint trailers (recommended by .lore/config.toml)
✓ def5678 "Prevent silent session drops" No issues
⚠ ghi9012 "Add retry logic" WARNING: Intent line is 85 characters (max recommended: 72)
Result: 1 error, 2 warnings across 3 commitsJSON Output
Section titled “JSON Output”{ "lore_version": "1.0", "valid": false, "summary": { "errors": 1, "warnings": 2, "commits_checked": 3 }, "results": [ { "commit": "abc1234", "lore_id": null, "valid": false, "issues": [ { "severity": "error", "rule": "lore-id-present", "message": "Missing Lore-id trailer" } ] } ]}CI/CD Integration
Section titled “CI/CD Integration”GitHub Actions
Section titled “GitHub Actions”name: Lore Validateon: [pull_request]jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Lore CLI run: npm install -g @lore-protocol/cli - name: Validate commits run: lore validate --since origin/mainGitLab CI
Section titled “GitLab CI”lore-validate: stage: test script: - npm install -g @lore-protocol/cli - lore validate --since origin/main rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event"The exit code tells your CI system whether to pass or fail the pipeline:
- Exit 0: All valid — pipeline passes
- Exit 1: Errors found — pipeline fails
- Exit 2: Warnings only — you decide (most teams let this pass)