Skip to content

Commit d10a294

Browse files
committed
update
1 parent aad938f commit d10a294

File tree

7 files changed

+178
-79
lines changed

7 files changed

+178
-79
lines changed

.editorconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
# ============================================================
2+
# .editorconfig (Standardize across editors and IDEs)
3+
# ============================================================
14
# REQ.UNIVERSAL: All professional GitHub project repositories MUST include .editorconfig.
25
# WHY: Establish a cross-editor baseline so diffs stay clean and formatting is consistent.
36
# ALT: Repository may omit .editorconfig ONLY if formatting is enforced equivalently by CI and formatter tooling.
47
# CUSTOM: Adjust indent_size defaults only if organizational standards change; keep stable across projects.
58
# NOTE: Sections are ordered by editorial importance, not strict alphabetical order.
69
# EditorConfig is documented at https://editorconfig.org
710

8-
[*.{editorconfig}]
911
root = true
1012

1113
# === Global defaults (always apply) ===

.github/workflows/ci-lean.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# ============================================================
2+
# .github/workflows/ci-lean.yml (Continuous Integration)
3+
# ============================================================
4+
# SOURCE: https://github.com/denisecase/templates
5+
#
6+
# WHY-FILE: Lean deliverables are proofs; broken proofs must not merge.
7+
# REQ: Any check that can be run locally MUST be available locally via pre-commit.
8+
# REQ: CI MUST NOT introduce arbitrary rules that are not reproducible locally.
9+
10+
name: CI Lean
11+
12+
# WHY: Validate repo contents on pushes to main branch and pull requests.
13+
14+
on:
15+
push:
16+
branches: [main] # WHY: Run when pushing to main branch.
17+
pull_request:
18+
branches: [main] # WHY: Run on pull requests targeting main branch.
19+
workflow_dispatch: # WHY: Allow manual triggering from Actions tab.
20+
21+
permissions: # WHY: Use least privileges required.
22+
contents: read
23+
24+
env:
25+
PYTHONUNBUFFERED: "1" # WHY: Real-time logging.
26+
PYTHONIOENCODING: "utf-8" # WHY: Ensure UTF-8 encoding for international characters.
27+
28+
jobs:
29+
ci:
30+
name: Repository checks
31+
runs-on: ubuntu-latest # WHY: Linux environment matches most production deployments
32+
timeout-minutes: 10 # WHY: Prevent hanging jobs. If over time, likely stuck.
33+
34+
steps:
35+
# ============================================================
36+
# ASSEMBLE: Get code and set up environment
37+
# ============================================================
38+
39+
- name: A1) Checkout repository code
40+
# WHY: Needed to access files for checks.
41+
uses: actions/checkout@v6
42+
43+
- name: A2) Run pre-commit (all files)
44+
# WHY: Single source of truth for locally runnable quality gates.
45+
# OBS: Fails if hooks would modify files; does not commit changes.
46+
id: precommit # WHY: Identify step for conditional follow-up. # WHY: Identify step for conditional follow-up.
47+
uses: pre-commit/action@v3.0.1
48+
with:
49+
extra_args: --all-files
50+
51+
- name: A2f) If pre-commit failed, run it locally
52+
if: failure()
53+
run: |
54+
echo "## Pre-commit failed" >> "$GITHUB_STEP_SUMMARY"
55+
echo "Please run pre-commit locally and commit the resulting changes." >> "$GITHUB_STEP_SUMMARY"
56+
57+
build:
58+
name: Build Lean (compile)
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 20
61+
needs: ci # WHY: Build only if ci job succeeds.
62+
63+
steps:
64+
# ============================================================
65+
# BUILD: Get code and build Lean project
66+
# ============================================================
67+
68+
- uses: actions/checkout@v6
69+
- uses: leanprover/lean-action@v1

.github/workflows/ci.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
pull-requests: write
2828

2929
steps:
30-
- name: 1) Checkout repository code
30+
- name: A1) Checkout repository code
3131
uses: actions/checkout@v6 # OBS: v6 current as of Dec 2025
3232

3333
- name: 2) Check links with Lychee

.pre-commit-config.yaml

Lines changed: 68 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,101 @@
1-
# REQ.PROJECT: This repository SHOULD include a .pre-commit-config.yaml when quality gates are required.# REQ: Any check that can be run locally MUST be available here.# WHY: Provide fast, consistent local checks aligned with upstream quality gates.# WHY: Keep local checks compatible with repository-wide formatting rules.# OBS: Formatting baselines are defined in# .editorconfig (whitespace/indentation) and# .gitattributes (EOL normalization).# OBS: These hooks do not override .editorconfig or .gitattributes;# they only prevent common diff noise and validate repository metadata.# ALT: Checks that are inherently non-local are handled upstream.# CUSTOM: Keep the hook set minimal and non-destructive for normative Markdown specs.## OPTIONAL LOCAL USAGE (no repo venv required):# Install uv (once, user-level).# uv self update# uvx pre-commit install# uvx pre-commit run --all-files## OBS: If a hook reports "files were modified", re-run last command to confirm a clean pass.## NOTE: pre-commit is optional.# Repositories do not require Python, uv, or pre-commit to clone or commit.exclude: | (?x)^( \.DS_Store| \.ipynb_checkpoints/| \.mypy_cache/| \.pytest_cache/| \.ruff_cache/| \.tox/| \.venv/| build/| dist/| node_modules/| site/ )repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 # OBS: v6 current as of Dec 30 2025 hooks: - id: check-added-large-files # OBS: prevent large binary files - id: trailing-whitespace # OBS: clean trailing whitespace per .editorconfig - id: end-of-file-fixer # OBS: ensure files end with a newline per .gitattributes - id: check-merge-conflict # OBS: prevent committing unresolved merge conflicts # WHY: Workflow files may intentionally include marker-like strings (e.g., >>>>). exclude: ^\.github/workflows/.*\.(yml|yaml)$ - id: check-yaml # OBS: validate YAML syntax files: \.(yml|yaml)$ - repo: https://github.com/adrienverge/yamllint rev: v1.37.1 # OBS: pinned for reproducibility hooks: - id: yamllint # OBS: validate YAML structure and policy (no line-length enforcement) args: [-c, .yamllint.yml] files: \.(yml|yaml)$ - repo: https://github.com/rhysd/actionlint rev: v1.7.10 # OBS: v1.7.10 current as of Dec 30 2025 hooks: - id: actionlint # OBS: validate GitHub Actions workflow syntax files: ^\.github/workflows/.*\.(yml|yaml)$# REQ.PROJECT: This repository SHOULD include a .pre-commit-config.yaml when quality gates are required.
2-
# REQ: Any check that can be run locally MUST be available here.
3-
# WHY: Provide fast, consistent local checks aligned with upstream quality gates.
4-
# WHY: Keep local checks compatible with repository-wide formatting rules.
5-
# OBS: Formatting baselines are defined in
6-
# .editorconfig (whitespace/indentation) and
7-
# .gitattributes (EOL normalization).
8-
# OBS: These hooks do not override .editorconfig or .gitattributes;
9-
# they only prevent common diff noise and validate repository metadata.
10-
# ALT: Checks that are inherently non-local are handled upstream.
11-
# CUSTOM: Keep the hook set minimal and non-destructive for normative Markdown specs.
1+
# ============================================================
2+
# .pre-commit-config.yaml (Lean Hygiene)
3+
# ============================================================
4+
# VARIANT: lean-hygiene
5+
# SOURCE: https://github.com/denisecase/templates
6+
#
7+
# REQ: Lean repos MAY include a .pre-commit-config.yaml for repo hygiene (optional).
8+
# WHY: Keep diffs clean across OSes and validate repo metadata files (TOML/YAML/JSON).
9+
#
10+
# OBS: These hooks use and do NOT override:
11+
# - .editorconfig (whitespace / indentation)
12+
# - .gitattributes (EOL normalization)
13+
# - tool configs (if present), e.g., lakefile.lean, pyproject.toml
1214
#
1315
# OPTIONAL LOCAL USAGE (no repo venv required):
1416
# Install uv (once, user-level).
1517
# uv self update
1618
# uvx pre-commit install
17-
# uvx pre-commit run --all-files
18-
#
19-
# OBS: If a hook reports "files were modified", re-run last command to confirm a clean pass.
19+
# uvx pre-commit run --all-files (just once, to check all files)
20+
# Subsequent commits will AUTOMATICALLY run pre-commit hooks after git add
21+
# and before git commit.
2022
#
2123
# NOTE: pre-commit is optional.
22-
# Repositories do not require Python, uv, or pre-commit to clone or commit.
24+
# Repositories do NOT require Python, uv, or pre-commit to clone or commit.
2325

2426
exclude: |
2527
(?x)^(
2628
\.DS_Store|
29+
\.coverage|
2730
\.ipynb_checkpoints/|
2831
\.mypy_cache/|
32+
\.nox/|
2933
\.pytest_cache/|
3034
\.ruff_cache/|
3135
\.tox/|
3236
\.venv/|
37+
.*\.(egg-info)/|
38+
.*\.log|
39+
__pycache__/|
40+
_minted.*/|
3341
build/|
42+
coverage\.xml|
3443
dist/|
44+
htmlcov/|
45+
lake-packages/|
3546
node_modules/|
47+
out/|
3648
site/
3749
)
3850
3951
repos:
52+
# === REPO: PRE-COMMIT HOOKS (cross-platform, zero config) ===
53+
#
54+
# These hooks prevent problems that show up later as:
55+
# - mysterious diffs
56+
# - broken builds on another OS
57+
4058
- repo: https://github.com/pre-commit/pre-commit-hooks
4159
rev: v6.0.0
4260
hooks:
43-
- id: check-added-large-files # OBS: prevent large binary files
44-
- id: trailing-whitespace # OBS: clean trailing whitespace per .editorconfig
45-
- id: end-of-file-fixer # OBS: ensure files end with a newline per .gitattributes
61+
# === PRE-COMMIT: NORMALIZE FILE FORMATTING ===
4662

47-
- id: mixed-line-ending # OBS: normalize line endings before linters run
48-
# WHY: yamllint enforces LF; Windows working copies may be CRLF.
49-
args: [--fix=lf]
63+
- id: trailing-whitespace
64+
name: A1) Clean trailing whitespace (per .editorconfig)
65+
args: [--markdown-linebreak-ext=md] # Preserves markdown double-space line breaks
5066

51-
- id: check-merge-conflict # OBS: prevent committing unresolved merge conflicts
67+
- id: end-of-file-fixer
68+
name: A2) End files with a newline (per .gitattributes)
5269

53-
- id: check-yaml # OBS: validate YAML syntax
54-
files: \.(yml|yaml)$
70+
- id: mixed-line-ending
71+
name: A3) Normalize line endings to LF before linters
72+
args: [--fix=lf] # OBS: Windows working copies may be CRLF.
5573

56-
- repo: https://github.com/adrienverge/yamllint
57-
rev: v1.37.1
58-
hooks:
59-
- id: yamllint # OBS: validate YAML structure and policy (no line-length enforcement)
60-
args: [-c, .yamllint.yml]
74+
# === PRE-COMMIT: CHECK DATA FILE FORMATS ===
75+
76+
- id: check-json
77+
name: B1) Validate JSON syntax
78+
79+
- id: check-toml
80+
name: B2) Validate TOML syntax
81+
82+
- id: check-yaml
83+
name: B3) Validate YAML syntax
6184
files: \.(yml|yaml)$
85+
exclude: ^mkdocs\.ya?ml$ # OBS: mkdocs.yaml may include non-standard tags.
6286

63-
- repo: https://github.com/rhysd/actionlint
64-
rev: v1.7.10
65-
hooks:
66-
- id: actionlint # OBS: validate GitHub Actions workflow syntax
67-
files: ^\.github/workflows/.*\.(yml|yaml)$
87+
# === PRE-COMMIT:CHECK FOR COMMON PROBLEMS ===
88+
89+
- id: check-added-large-files
90+
name: C1) Prevent accidental commits of large binaries
91+
args: [--maxkb=500]
92+
93+
- id: check-merge-conflict
94+
name: C2) Prevent committing merge conflicts
95+
96+
- id: check-case-conflict
97+
name: C3) Check for filename case conflicts
98+
99+
# === GLOBAL SETTINGS ===
100+
# ALT: Set fail_fast to true to stop at first failure.
101+
fail_fast: false # Run all hooks even if one fails

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Structural Explainability: Evolution Protocol
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/MIT)
4-
![Build Status](https://github.com/structural-explainability/EvolutionProtocol/actions/workflows/ci.yml/badge.svg)
4+
![Build Status](https://github.com/structural-explainability/EvolutionProtocol/actions/workflows/ci-lean.yml/badge.svg?branch=main)
55
[![Check Links](https://github.com/structural-explainability/EvolutionProtocol/actions/workflows/links.yml/badge.svg)](https://github.com/structural-explainability/EvolutionProtocol/actions/workflows/links.yml)
66

77
> Lean 4 formalization of the Evolution Protocol schemas.
@@ -29,6 +29,29 @@ lake build
2929
lake exe verify
3030
```
3131

32+
## Developer (running pre-commit)
33+
34+
Pre-commit is optional; CI will report exact commands if it fails.
35+
36+
Steps to run pre-commit locally. Install `uv`.
37+
38+
Initialize once:
39+
40+
```shell
41+
uv self update
42+
uvx pre-commit install
43+
uvx pre-commit run --all-files
44+
```
45+
46+
Save progress as needed:
47+
48+
```shell
49+
git add -A
50+
# If pre-commit makes changes, re-run `git add -A` before committing.
51+
git commit -m "update"
52+
git push -u origin main
53+
```
54+
3255
## Annotations
3356

3457
[ANNOTATIONS.md](./ANNOTATIONS.md)

SE_MANIFEST.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
# ============================================================
2+
# SE_MANIFEST.toml (Repository Intent, Scope, and Role)
3+
# ============================================================
4+
15
schema = "se-manifest-1"
6+
schema_url = "https://github.com/structural-explainability/spec-se/blob/main/manifests/se-manifest-1.md"
7+
8+
[meta]
9+
# Non-normative contextual information
10+
framework = "Structural Explainability"
11+
framework_url = "https://github.com/structural-explainability"
12+
framework_note = "Provides definitions and conventions for SE_MANIFEST semantics."
13+
description = "Declarative claim of repository intent, scope, and role."
14+
purpose = "To make explicit the boundaries, responsibilities, and expectations of this repository relative to others."
215

316
[repo]
417
name = "EvolutionProtocol"

0 commit comments

Comments
 (0)