Skip to content

Commit 0653fe7

Browse files
committed
add theory
1 parent 419c661 commit 0653fe7

16 files changed

Lines changed: 946 additions & 64 deletions

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ exclude: |
3636
build/|
3737
coverage\.xml|
3838
dist/|
39+
external/se-formal-contract/|
3940
htmlcov/|
4041
lake-packages/|
4142
node_modules/|
@@ -65,9 +66,9 @@ repos:
6566
# === PRE-COMMIT: CHECK DATA FILE FORMATS ===
6667

6768
- id: check-json
68-
name: B1) Validate JSON syntax (except .vscode/)
69-
# WHY: VSCode settings may include comments, which are non-standard JSON.
70-
exclude: ^\.vscode/.*\.json$
69+
name: B1) Validate JSON syntax (except .vscode/ and external/)
70+
# WHY: VSCode settings may include comments; external/ contains submodules not owned by this repo.
71+
exclude: ^(\.vscode/.*\.json|external/.*\.json)$
7172

7273
- id: check-toml
7374
name: B2) Validate TOML syntax

CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
11
# Changelog
22

3+
<!-- markdownlint-disable MD024 -->
4+
35
All notable changes to this project will be documented in this file.
46

57
The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/)**
68
and this project adheres to **[Semantic Versioning](https://semver.org/spec/v2.0.0.html)**.
79

810
## [Unreleased]
911

12+
### Added
13+
14+
New repository class:
15+
16+
- `theory` — Lean 4 theorem-development repositories for Structural Explainability theory
17+
18+
Naming pattern support for `theory`:
19+
20+
- `se-theory-{focus}`
21+
22+
Dependency rules:
23+
24+
- `theory` may depend on `formal_contract`
25+
- `theory` does not introduce upstream dependencies into the foundation layer
26+
27+
Repository requirements for `theory`:
28+
29+
- Lean 4 project structure (`lean-toolchain`, `lakefile.toml`)
30+
- Lean module root (e.g., `SETheory`)
31+
- documentation (`docs/`)
32+
- no required data export directories
33+
34+
Design clarification:
35+
36+
- separation of concerns between:
37+
- theory repos (proof development)
38+
- formal contract (stable exported surface)
39+
- constitution (operational validation)
40+
1041
---
1142

1243
## [0.1.1] - 2026-04-27
@@ -22,7 +53,8 @@ Naming pattern support for `govsrc`:
2253

2354
- `se-govsrc-{jurisdiction}`
2455
- `se-govsrc-{jurisdiction}-{focus}`
25-
- Clarified that `{jurisdiction}` may include subdivision (e.g., `us-missouri`) and is treated as a single logical token
56+
- Clarified that `{jurisdiction}` may include
57+
subdivision (e.g., `us-missouri`) and is treated as a single logical token
2658

2759
Dependency rules for new classes:
2860

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ cff-version: "1.2.0"
99
type: software
1010

1111
title: "Structural Explainability Constitution"
12-
version: "0.1.0"
13-
date-released: "2026-04-22"
12+
version: "0.1.1"
13+
date-released: "2026-04-27"
1414

1515
authors:
1616
- family-names: Case

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ se-admin
3333

3434
### In a machine terminal
3535

36-
After you get a copy of this repo in your own GitHub account,
37-
open a machine terminal in `Repos` or where you want the project:
36+
Open a machine terminal where you want the project:
3837

3938
```shell
40-
# Replace username with YOUR GitHub username.
41-
git clone https://github.com/username/se-constitution
39+
git clone https://github.com/structural-explainability/se-constitution
4240

4341
cd se-constitution
4442
code .
@@ -51,6 +49,8 @@ uv self update
5149
uv python pin 3.15
5250
uv sync --extra dev --extra docs --upgrade
5351

52+
git submodule update --init --recursive
53+
5454
uvx pre-commit install
5555

5656
git add -A

data/class/class-registry.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ version = "0.1.0"
88
status = "draft"
99
title = "SE Constitution Class Registry"
1010

11+
[class.formal_contract]
12+
label = "Formal Contract"
13+
description = "Lean 4-verified formal contract exporting invariants, regimes, relations, and proof status to operational SE repositories."
14+
15+
[class.theory]
16+
label = "Theory"
17+
description = "Lean 4 theorem-development repositories for Structural Explainability theory."
18+
1119
[class.constitution]
1220
summary = "Architectural law and governing definitions for the SE ecosystem."
1321
stable = true

data/dependency/dependency-rules.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,24 @@ status = "draft"
1212
title = "SE Constitution Dependency Rules"
1313

1414
[principle]
15+
formal_contract_is_root = true
1516
no_cycles = true
1617
no_reverse_foundation_dependencies = true
1718
constitution_is_foundational = true
1819

19-
[dependency.constitution]
20+
[dependency.formal_contract]
2021
allowed = []
2122

23+
[dependency.theory]
24+
allowed = [
25+
"formal_contract",
26+
]
27+
28+
[dependency.constitution]
29+
allowed = [
30+
"formal_contract",
31+
]
32+
2233
[dependency.admin]
2334
allowed = [
2435
"adapter",

data/manifest/manifest-schema.toml

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -34,84 +34,59 @@ schema_url_required = true
3434
required = true
3535
description = "Non-normative contextual information about the manifest and framework."
3636
allowed_fields = [
37-
"framework",
38-
"framework_url",
39-
"framework_note",
40-
"description",
41-
"purpose"
37+
"framework",
38+
"framework_url",
39+
"framework_note",
40+
"description",
41+
"purpose",
4242
]
4343

4444
[section.repo]
4545
required = true
4646
description = "Stable repository identity and declared class."
47-
allowed_fields = [
48-
"name",
49-
"org",
50-
"class",
51-
"kind",
52-
"status",
53-
"since",
54-
"summary"
55-
]
47+
allowed_fields = ["name", "org", "class", "kind", "status", "since", "summary"]
5648

5749
[section.layer]
5850
required = true
5951
description = "Declared epistemic position."
60-
allowed_fields = [
61-
"space",
62-
"role"
63-
]
52+
allowed_fields = ["space", "role"]
6453

6554
[section.depends]
6655
required = true
6756
description = "Declared upstream dependencies."
68-
allowed_fields = [
69-
"required",
70-
"optional"
71-
]
57+
allowed_fields = ["required", "optional"]
7258

7359
[section.provides]
7460
required = true
7561
description = "Artifacts intentionally provided and maintained."
76-
allowed_fields = [
77-
"artifacts"
78-
]
62+
allowed_fields = ["artifacts"]
7963

8064
[section.scope]
8165
required = true
8266
description = "Explicit semantic boundary."
83-
allowed_fields = [
84-
"includes",
85-
"excludes"
86-
]
67+
allowed_fields = ["includes", "excludes"]
8768

8869
[section.compatibility]
8970
required = false
9071
description = "Declared compatibility with constitutional and ecosystem components."
9172
allowed_fields = [
92-
"constitution",
93-
"kernel",
94-
"mapspec",
95-
"schema",
96-
"profile",
97-
"rules"
73+
"constitution",
74+
"kernel",
75+
"mapspec",
76+
"schema",
77+
"profile",
78+
"rules",
9879
]
9980

10081
[section.citation]
10182
required = true
10283
description = "Citation pointer metadata."
103-
allowed_fields = [
104-
"cff",
105-
"preferred",
106-
"bib_hint"
107-
]
84+
allowed_fields = ["cff", "preferred", "bib_hint"]
10885

10986
[section.traceability]
11087
required = true
11188
description = "Identifier resolution and traceability strategy."
112-
allowed_fields = [
113-
"identifier_map"
114-
]
89+
allowed_fields = ["identifier_map"]
11590

11691
# ------------------------------------------------------------
11792
# Field definitions
@@ -226,6 +201,18 @@ required = true
226201
# Class-specific requirements
227202
# ------------------------------------------------------------
228203

204+
[class.formal_contract]
205+
required_repo_name_patterns = ["se-formal-contract"]
206+
required_layer_roles = ["formal-contract"]
207+
forbidden_sections = []
208+
required_compatibility_fields = []
209+
210+
[class.theory]
211+
required_repo_name_patterns = ["se-theory-{focus}"]
212+
required_layer_roles = ["theory"]
213+
forbidden_sections = []
214+
required_compatibility_fields = []
215+
229216
[class.constitution]
230217
required_repo_name_patterns = ["se-constitution"]
231218
required_layer_roles = ["constitution"]
@@ -275,7 +262,10 @@ forbidden_sections = []
275262
required_compatibility_fields = ["constitution", "kernel"]
276263

277264
[class.profile]
278-
required_repo_name_patterns = ["se-profile-{jurisdiction}", "se-profile-{jurisdiction}-{focus}"]
265+
required_repo_name_patterns = [
266+
"se-profile-{jurisdiction}",
267+
"se-profile-{jurisdiction}-{focus}",
268+
]
279269
required_layer_roles = ["profile"]
280270
forbidden_sections = []
281271
required_compatibility_fields = ["constitution", "kernel", "schema"]
@@ -286,10 +276,19 @@ optional_sections = ["validation", "naming", "governance", "traceability"]
286276

287277
[class.govsrc]
288278
required_sections = ["meta", "repo", "provides", "scope", "citation"]
289-
optional_sections = ["depends", "validation", "naming", "governance", "traceability"]
279+
optional_sections = [
280+
"depends",
281+
"validation",
282+
"naming",
283+
"governance",
284+
"traceability",
285+
]
290286

291287
[class.rules]
292-
required_repo_name_patterns = ["se-rules-{jurisdiction}", "se-rules-{jurisdiction}-{focus}"]
288+
required_repo_name_patterns = [
289+
"se-rules-{jurisdiction}",
290+
"se-rules-{jurisdiction}-{focus}",
291+
]
293292
required_layer_roles = ["rules"]
294293
forbidden_sections = []
295294
required_compatibility_fields = ["constitution", "kernel", "schema"]
@@ -330,10 +329,10 @@ empty_required_lists_allowed = true
330329
[notes]
331330
manifest_role = "Declares repository intent, scope, role, and compatibility under constitutional law."
332331
non_goals = [
333-
"build configuration",
334-
"deployment configuration",
335-
"runtime secrets",
336-
"replace README documentation",
337-
"replace CITATION.cff",
338-
"duplicate constitutional law tables"
332+
"build configuration",
333+
"deployment configuration",
334+
"runtime secrets",
335+
"replace README documentation",
336+
"replace CITATION.cff",
337+
"duplicate constitutional law tables",
339338
]

data/naming/naming-patterns.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ domain_pattern = "[a-z0-9]+(?:-[a-z0-9]+)*"
2424
focus_pattern = "[a-z0-9]+(?:-[a-z0-9]+)*"
2525
standard_pattern = "[a-z0-9]+(?:-[a-z0-9]+)*"
2626

27+
[pattern.formal_contract]
28+
class = "formal_contract"
29+
format = "se-formal-contract"
30+
31+
[pattern.theory]
32+
class = "theory"
33+
format = "se-theory-{focus}"
34+
required_tokens = ["focus"]
35+
2736
[pattern.constitution]
2837
class = "constitution"
2938
format = "se-constitution"

data/repo/repo-requirements.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,50 @@ schema = "se-manifest-2"
5757
require_ci = true
5858
require_manifest_validation = true
5959

60+
# ------------------------------------------------------------
61+
# Formal Contract
62+
# ------------------------------------------------------------
63+
64+
[repo.formal_contract]
65+
summary = "Lean 4-verified formal contract exporting invariants, regimes, relations, and proof status to operational SE repositories."
66+
67+
required_files = [
68+
"SE_MANIFEST.toml",
69+
"README.md",
70+
"CHANGELOG.md",
71+
"CITATION.cff",
72+
"lean-toolchain",
73+
"lakefile.toml",
74+
]
75+
76+
required_directories = [
77+
"SEFormalContract",
78+
"data/contract",
79+
"docs",
80+
]
81+
82+
# ------------------------------------------------------------
83+
# Theory
84+
# ------------------------------------------------------------
85+
86+
[repo.theory]
87+
summary = "Lean 4 theorem development repositories for Structural Explainability theory."
88+
89+
required_files = [
90+
"SE_MANIFEST.toml",
91+
"README.md",
92+
"CHANGELOG.md",
93+
"CITATION.cff",
94+
"lean-toolchain",
95+
"lakefile.toml",
96+
]
97+
98+
required_directories = [
99+
"SETheory",
100+
"docs",
101+
]
102+
103+
60104
# ------------------------------------------------------------
61105
# Constitution
62106
# ------------------------------------------------------------

0 commit comments

Comments
 (0)