Skip to content

Commit b482e94

Browse files
committed
Add canonical example sets and schema invariants
Closes #4 Closes #5
1 parent 670883e commit b482e94

38 files changed

Lines changed: 959 additions & 97 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ PRIVATE-NOTES.md
2727

2828
# WHY: Commit recommended extensions (opt-in) for consistent development experience.
2929
# NOTE: Share recommendations, not personal editor styles or preferences.
30+
# Must reinclude directory first so Git will traverse
31+
!.vscode/
3032
!.vscode/extensions.json
3133
!.vscode/settings.json
3234

.vscode/ABOUT.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# VS Code Configuration (`.vscode/`)
2+
3+
Optional editor configuration for Visual Studio Code.
4+
5+
## Scope
6+
7+
- Improves consistency for contributors using VS Code
8+
- Not required to run, test, or build this repository
9+
- Does not affect CI or repository correctness
10+
11+
## JSON Note
12+
13+
VS Code allows comments in `.vscode` JSON files.
14+
15+
- Valid in VS Code only
16+
- Not valid general-purpose JSON
17+
18+
## Files
19+
20+
- `extensions.json` recommended extensions (optional)
21+
- `settings.json` workspace editor defaults

.vscode/extensions.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ============================================================
2+
// .vscode/extensions.json (Structural Explainability)
3+
// ============================================================
4+
// Updated 2026-04-22
5+
// NOTE: Comments are not allowed in standard JSON files,
6+
// but Microsoft allows them in their .vscode config files.
7+
{
8+
"recommendations": [
9+
// ============================================================
10+
// === PYTHON DEVELOPMENT ===
11+
// ============================================================
12+
"ms-python.python", // Core Python support
13+
"ms-python.vscode-pylance", // Fast IntelliSense and type checking
14+
"charliermarsh.ruff", // Modern formatting and linting (replaces black + isort + flake8)
15+
// ============================================================
16+
// === FILE PATH ASSISTANCE ===
17+
// ============================================================
18+
"christian-kohler.path-intellisense", // Autocomplete for file paths in Python strings (e.g., "data/file.csv")
19+
// ============================================================
20+
// === MARKDOWN AND DOCUMENTATION ===
21+
// ============================================================
22+
"yzhang.markdown-all-in-one", // Shortcuts, TOC, formatting for .md files
23+
"bierner.markdown-preview-github-styles", // GitHub-style markdown preview
24+
"esbenp.prettier-vscode", // Used for Markdown formatting
25+
// "bierner.markdown-mermaid", // Diagram rendering in markdown (flowcharts, etc.)
26+
// ============================================================
27+
// === DATA FILES AND CONFIGURATION ===
28+
// ============================================================
29+
"redhat.vscode-yaml", // YAML syntax, validation, formatting
30+
"tamasfe.even-better-toml", // TOML syntax, validation (for pyproject.toml)
31+
// ============================================================
32+
// === PROJECT INFRASTRUCTURE ===
33+
// ============================================================
34+
"editorconfig.editorconfig", // Respects .editorconfig settings (indentation, line endings)
35+
"github.vscode-github-actions" // GitHub Actions workflow editing, validation, and run support
36+
],
37+
"unwantedRecommendations": [
38+
// ============================================================
39+
// === NOT RECOMMENDED: CONFLICTS WITH CURRENT SETUP ===
40+
// ============================================================
41+
"ms-python.black-formatter", // We use ruff format instead
42+
"ms-python.isort" // We use ruff for import sorting
43+
]
44+
}

.vscode/settings.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// ============================================================
2+
// .vscode/settings.json (Structural Explainability)
3+
// ============================================================
4+
// Updated 2026-04-22
5+
// NOTE: Comments are not allowed in standard JSON files,
6+
// but Microsoft allows them in their .vscode config files.
7+
{
8+
"editor.formatOnSave": false,
9+
"[python]": {
10+
"editor.defaultFormatter": "charliermarsh.ruff"
11+
},
12+
"[json]": {
13+
"editor.defaultFormatter": "vscode.json-language-features"
14+
},
15+
"[jsonc]": {
16+
"editor.defaultFormatter": "vscode.json-language-features"
17+
},
18+
"[markdown]": {
19+
//prettier for markdown files (e.g., README.md)
20+
"editor.defaultFormatter": "esbenp.prettier-vscode"
21+
},
22+
"[yaml]": {
23+
"editor.defaultFormatter": "redhat.vscode-yaml"
24+
},
25+
"[toml]": {
26+
"editor.defaultFormatter": "tamasfe.even-better-toml"
27+
},
28+
"[github-actions-workflow]": {
29+
"editor.defaultFormatter": "redhat.vscode-yaml"
30+
},
31+
"yaml.schemas": {
32+
"https://json.schemastore.org/github-workflow.json": [
33+
".github/workflows/*.yml",
34+
".github/workflows/*.yaml"
35+
]
36+
}
37+
}

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,23 @@
99
[![Docs](https://github.com/structural-explainability/se-constitution/actions/workflows/deploy-zensical.yml/badge.svg?branch=main)](https://github.com/structural-explainability/se-constitution/actions/workflows/deploy-zensical.yml)
1010
[![Links](https://github.com/structural-explainability/se-constitution/actions/workflows/links.yml/badge.svg?branch=main)](https://github.com/structural-explainability/se-constitution/actions/workflows/links.yml)
1111

12-
> Structural Explainability constitution:
12+
> Structural Explainability Constitution:
1313
> rules, schemas, and validation for the SE ecosystem.
1414
15+
## Context
16+
17+
se-constitution
18+
19+
- defines rules
20+
21+
se-kernel
22+
23+
- defines primitives those rules depend on
24+
25+
se-admin
26+
27+
- enforces rules across repositories
28+
1529
## Command Reference
1630

1731
<details>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ============================================================
2+
# Canonical Invalid Example: Class Registry
3+
# VIOLATION 1: [class.kernel] is missing required 'summary' field.
4+
# Expected error: "class-registry.toml: [class.kernel] must define summary or description."
5+
# ============================================================
6+
7+
[meta]
8+
version = "0.1.0"
9+
status = "draft"
10+
title = "SE Constitution Class Registry (Invalid Example)"
11+
12+
[class.constitution]
13+
summary = "Architectural law and governing definitions for the SE ecosystem."
14+
stable = true
15+
allowed_repo_name_patterns = ["se-constitution"]
16+
17+
[class.kernel]
18+
# VIOLATION 1: 'summary' intentionally omitted.
19+
stable = true
20+
allowed_repo_name_patterns = ["se-kernel"]
21+
22+
[validation]
23+
single_class_required = true
24+
known_class_required = true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# ============================================================
2+
# Canonical Invalid Example: Dependency Rules
3+
# VIOLATION 2: kernel's allowed list contains 'phantom', which is not a known class.
4+
# Expected error: "dependency-rules.toml: class 'kernel' allows unknown dependency class 'phantom'."
5+
# ============================================================
6+
7+
[meta]
8+
version = "0.1.0"
9+
status = "draft"
10+
title = "SE Constitution Dependency Rules (Invalid Example)"
11+
12+
[principle]
13+
no_cycles = true
14+
no_reverse_foundation_dependencies = true
15+
constitution_is_foundational = true
16+
17+
[dependency.constitution]
18+
allowed = []
19+
20+
[dependency.kernel]
21+
# VIOLATION 2: 'phantom' is not defined in class-registry.toml.
22+
allowed = ["constitution", "phantom"]
23+
24+
[validation]
25+
dependency_classes_must_be_known = true
26+
forbid_unknown_dependency_classes = true
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ============================================================
2+
# Canonical Invalid Example: Manifest Schema
3+
# Defines required sections and fields for SE_MANIFEST.toml.
4+
# Class entries match classes in class-registry.
5+
# ============================================================
6+
7+
[meta]
8+
version = "0.1.0"
9+
status = "draft"
10+
title = "SE Manifest Schema (Minimal Invalid Example)"
11+
12+
[section.repo]
13+
required = true
14+
15+
[section.layer]
16+
required = true
17+
18+
[section.depends]
19+
required = true
20+
21+
[field."repo.name"]
22+
type = "string"
23+
required = true
24+
25+
[field."repo.class"]
26+
type = "string"
27+
required = true
28+
29+
[class.constitution]
30+
required_repo_name_patterns = ["se-constitution"]
31+
32+
[class.kernel]
33+
required_repo_name_patterns = ["se-kernel"]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ============================================================
2+
# Canonical Invalid Example: Naming Patterns
3+
# VIOLATION 3: [pattern.phantom] references class 'phantom' not in class-registry.
4+
# Expected error: cross-file - naming pattern class 'phantom' is not a known class.
5+
# ============================================================
6+
7+
[meta]
8+
version = "0.1.0"
9+
status = "draft"
10+
title = "SE Constitution Naming Patterns (Invalid Example)"
11+
12+
[global]
13+
required_prefix = "se"
14+
separator = "-"
15+
ascii_only = true
16+
lowercase_only = true
17+
18+
[pattern.constitution]
19+
class = "constitution"
20+
format = "se-constitution"
21+
22+
[pattern.kernel]
23+
class = "kernel"
24+
format = "se-kernel"
25+
26+
[pattern.phantom]
27+
# VIOLATION 3: 'phantom' is not defined in class-registry.toml.
28+
class = "phantom"
29+
format = "se-phantom"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# ============================================================
2+
# Canonical Invalid Example: Repo Requirements
3+
# Minimum obligations for constitution and kernel classes.
4+
# All repo keys match classes in class-registry.
5+
# ============================================================
6+
7+
[meta]
8+
version = "0.1.0"
9+
status = "draft"
10+
title = "SE Repo Requirements Registry (Minimal Invalid Example)"
11+
12+
[global]
13+
required_root_files = ["README.md", "SE_MANIFEST.toml"]
14+
15+
[repo.constitution]
16+
summary = "Architectural law and governing definitions for the SE ecosystem."
17+
require_ci = true
18+
require_manifest_validation = true
19+
20+
[repo.kernel]
21+
summary = "Foundational structural primitives, invariants, and enduring constraints."
22+
require_ci = true
23+
require_manifest_validation = true
24+
25+
[validation]
26+
enforce_known_repo_classes = true
27+
enforce_required_root_files = true

0 commit comments

Comments
 (0)