Skip to content

Commit debce24

Browse files
committed
move data/ to src/
1 parent e5d08f5 commit debce24

11 files changed

Lines changed: 55 additions & 19 deletions

File tree

.markdownlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
default: true
99

1010
MD013:
11-
line_length: 100
11+
line_length: 120
1212
headings: false
1313
tables: false
1414
code_blocks: false

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ and this project adheres to **[Semantic Versioning](https://semver.org/spec/v2.0
99

1010
---
1111

12+
## [0.1.1] - 2026-04-27
13+
14+
### Changed
15+
16+
- Canonical regime artifacts:
17+
- `data/regimes.toml`
18+
- `data/transformations.toml`
19+
- Moved to:
20+
- `src/se_regimes/data/regimes.toml`
21+
- `src/se_regimes/data/transformations.toml`
22+
- Changed `pyproject.toml`, `README.md`, and more to reflect the change.
23+
24+
---
25+
1226
## [0.1.0] - 2026-04-27
1327

1428
### Added

CLAUDE.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ uv run pytest
3737
## Regime registry rules
3838

3939
- All 9 regime profiles must be present in `regimes.toml` before any pilot case suite runs.
40-
- Each regime declares: `id`, `label`, `carrier`, `split_theorem`, `persistence_invariant`, `break_condition`, `transform_response`.
40+
- Each regime declares:
41+
- `id`, `label`, `carrier`, `split_theorem`, `persistence_invariant`,
42+
- `break_condition`, `transform_response`.
4143
- `split_theorem = null` for the three unsplit regimes.
4244
- `transform_response` keys must match the transformation families declared in `transformations.toml`.
4345

4446
## Test case rules
4547

4648
- Each case file is TOML, discovered by glob under `cases/`.
47-
- Each `[[case]]` entry declares: `id`, `domain`, `description`, `candidate_regime`, `transformations`, `expected`, `notes`.
49+
- Each `[[case]]` entry declares:
50+
- `id`, `domain`, `description`, `candidate_regime`, `transformations`, `expected`, `notes`.
4851
- `expected` is a list of `{ after, regime, outcome }` where `outcome` is `PRS` or `BRK`.
4952
- Case IDs must be unique across all files.
5053

@@ -53,7 +56,8 @@ uv run pytest
5356
- New regime: add entry to `regimes.toml`.
5457
- New transformation family: add entry to `transformations.toml`, add key to each regime's `transform_response`.
5558
- New domain suite: add `cases/{domain}/` directory with TOML files; engine discovers automatically.
56-
- New invariant type: `persistence_invariant` is currently a string label; promote to callable when theory is precise enough.
59+
- New invariant type: `persistence_invariant` is currently a string label;
60+
promote to callable when theory is precise enough.
5761

5862
## Dependency
5963

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
1414
## Owns
1515

16-
- `data/regimes.toml` all 9 identity and persistence regime profiles
17-
- `data/transformations.toml` transformation family definitions (BF, decomposition, nor_reorg)
16+
- `src/se_regimes/data/regimes.toml` - all 9 identity and persistence regime profiles
17+
- `src/se_regimes/data/transformations.toml` - transformation family definitions (BF, decomposition, nor_reorg)
1818

1919
## Includes
2020

SE_MANIFEST.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ authority = "structural-explainability"
6868
cff = "CITATION.cff"
6969

7070
[traceability]
71-
identifier_map = "data/regimes.toml"
71+
identifier_map = "src/se_regimes/data/regimes.toml"

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ version-file = "src/se_regimes/_version.py"
153153
# CUSTOM: Must match src/ folders.
154154
packages = ["src/se_regimes"] # REQ.PACKAGES: Discovery rooted at src/.
155155

156+
[tool.hatch.build.targets.wheel.force-include]
157+
"src/se_regimes/data" = "se_regimes/data" # WHY: Include data files in the wheel distribution under the correct package namespace.
158+
156159
[tool.hatch.version]
157160
# WHY: Version derived from git tags at build time — no manual source file edits.
158161
source = "vcs"

reports/stress_report.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Rule matrix
66

7-
_Declared responses from `data/regimes.toml` (theory-level assertions, not empirically validated)._
7+
_Declared responses from `src/se_regimes/data/regimes.toml` (theory-level assertions, not empirically validated)._
88
_Populated from registry regardless of case coverage._
99

1010
| regime | BF | decomposition | nor_reorg |
@@ -45,6 +45,6 @@ _Which regime x family pairs have at least one stress-test case._
4545

4646
## All cases
4747

48-
| id | domain | regime | result |
49-
| --- | --- | --- | --- |
50-
| - | - | - | - |
48+
| id | domain | regime | expected | result |
49+
| --- | --- | --- | --- | --- |
50+
| - | - | - | - | - |

src/se_regimes/registry.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
"""
55

66
from dataclasses import dataclass, field
7+
from importlib.resources import as_file, files
78
from pathlib import Path
89
import sys
910
import tomllib
1011
from typing import Literal
1112

1213
REPO_ROOT = Path(__file__).parent.parent.parent
13-
REGIMES_PATH = REPO_ROOT / "data" / "regimes.toml"
14-
TRANSFORMATIONS_PATH = REPO_ROOT / "data" / "transformations.toml"
14+
DATA_ROOT = files("se_regimes") / "data"
15+
REGIMES_RESOURCE = DATA_ROOT / "regimes.toml"
16+
TRANSFORMATIONS_RESOURCE = DATA_ROOT / "transformations.toml"
1517

1618
Outcome = Literal["PRS", "BRK", "INH", "TODO", "—"]
1719

@@ -122,13 +124,26 @@ def coverage_matrix(self) -> dict[str, dict[str, Outcome]]:
122124

123125

124126
def load(
125-
regimes_path: Path = REGIMES_PATH,
126-
transformations_path: Path = TRANSFORMATIONS_PATH,
127+
regimes_path: Path | None = None,
128+
transformations_path: Path | None = None,
127129
) -> Registry:
128-
"""Load the registry from the given TOML files, returning a Registry object."""
129-
with Path.open(regimes_path, "rb") as f:
130+
"""Load the registry from TOML files, returning a Registry object."""
131+
if regimes_path is not None and transformations_path is not None:
132+
return _load_from_paths(regimes_path, transformations_path)
133+
134+
with (
135+
as_file(REGIMES_RESOURCE) as packaged_regimes_path,
136+
as_file(TRANSFORMATIONS_RESOURCE) as packaged_transformations_path,
137+
):
138+
return _load_from_paths(packaged_regimes_path, packaged_transformations_path)
139+
140+
141+
def _load_from_paths(regimes_path: Path, transformations_path: Path) -> Registry:
142+
"""Load the registry from concrete filesystem paths."""
143+
with regimes_path.open("rb") as f:
130144
raw_regimes = tomllib.load(f)
131-
with Path.open(transformations_path, "rb") as f:
145+
146+
with transformations_path.open("rb") as f:
132147
raw_families = tomllib.load(f)
133148

134149
registry = Registry()

0 commit comments

Comments
 (0)