Skip to content

Commit 39e8498

Browse files
authored
feat(routines): add catalog foundation (#58)
Establish the zero-content routine catalog, exact source and donor pin ownership, and a validated non-claiming coverage state.
1 parent 89ccaff commit 39e8498

9 files changed

Lines changed: 721 additions & 1 deletion

File tree

.github/workflows/verify.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
working-directory: cxf-library
3333
run: python3 tools/lint/registry.py
3434

35+
- name: routine catalog lint
36+
working-directory: cxf-library
37+
run: |
38+
python3 -m unittest discover -s tools/lint/tests -v
39+
python3 tools/lint/routines.py
40+
3541
- uses: dtolnay/rust-toolchain@stable
3642

3743
- uses: Swatinem/rust-cache@v2

SCHEMA.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ cxf-library/
1818
├── faults/<equip>/README.md # chapter index and status table
1919
├── playbooks/<slug>.md # remediation playbooks (shared across faults)
2020
├── clusters/clusters.json # fault clusters (syndromes with shared root cause)
21-
├── routines/ # G36 routine enhancements (non-fault control programs)
21+
├── routines/ # routine catalog; no executable routines in this version
22+
│ ├── registry.json # executable routine inventory
23+
│ └── g36/ # G36 source pins and coverage declaration
2224
├── tools/verify/ # Rust harness: loads each rule into the engine, runs vectors
2325
```
2426

@@ -45,6 +47,79 @@ are allowed: they appear in prose and index tables marked planned/deferred,
4547
never in the registry, and the next authored rule in that family takes the
4648
next free number, honoring any reservation.
4749

50+
## Routine catalog foundation
51+
52+
The routine catalog is an explicit zero-state. It defines identities,
53+
provenance pins, and validation boundaries, but contains no implemented or
54+
verified routines. These contracts do not change any fault contract or fault
55+
schema identifier.
56+
57+
Pin ownership is split by purpose:
58+
59+
- Root `ENGINE_PIN` is the runtime evaluator revision.
60+
- `routines/g36/DONOR_PIN` is the exact open-control-engine donor fixture and
61+
golden revision.
62+
- `routines/g36/SOURCE_PIN` is the exact upstream Modelica Buildings source
63+
revision.
64+
65+
Each pin file contains one lowercase 40-hex Git commit. The pin files are the
66+
authoritative locations for these revisions.
67+
68+
### `routines/registry.json` (`cxf-library/routine-registry/v1`)
69+
70+
The registry is an object with exactly two keys: `schema` and `routines`.
71+
`schema` is `cxf-library/routine-registry/v1`; `routines` is an array. The
72+
registry owns the executable routine inventory. In this foundation version,
73+
the production array is empty.
74+
75+
Future rows have exactly these keys:
76+
77+
| Field | Type | Contract |
78+
|---|---|---|
79+
| `id` | string | `<class-id>__<variant-id>` |
80+
| `class_id` | string | `G36-<DOMAIN>-<SLUG>` |
81+
| `variant_id` | string | lowercase kebab case |
82+
| `name` | string | display name |
83+
| `family` | string | routine family |
84+
| `level` | enum | `leaf` \| `controller` \| `fragment` |
85+
| `status` | enum | `draft` \| `ported` \| `engine_verified` \| `source_evidenced` \| `adopted` \| `deprecated` |
86+
| `path` | string | safe repository-relative POSIX path below `g36/` |
87+
| `canonical_class` | string\|null | nonempty canonical class for non-fragments; null for fragments |
88+
| `evidence_tier` | enum | `E0` through `E5` |
89+
| `completeness` | object | four-axis completeness declaration |
90+
91+
`<DOMAIN>` is one uppercase ASCII alphanumeric segment. `<SLUG>` is one or
92+
more uppercase ASCII alphanumeric segments separated by hyphens. Variant IDs
93+
contain lowercase ASCII alphanumeric segments separated by single hyphens.
94+
Routine IDs MUST equal the row's `<class_id>__<variant_id>`.
95+
96+
Registry paths MUST start with `g36/`. Absolute paths, backslashes, empty
97+
segments, `.` segments, and `..` segments are invalid. IDs and paths MUST each
98+
be unique, and rows MUST be sorted by `id`.
99+
100+
Every `completeness` object has exactly these keys:
101+
`donor_configuration`, `canonical_class`, `family_package`, and
102+
`guideline_profile`. Each value is `complete`, `partial`, `not_applicable`, or
103+
`unknown`.
104+
105+
### `routines/g36/coverage.json` (`cxf-library/g36-coverage/v1`)
106+
107+
Coverage declares profile scope and claims; it does not repeat the registry's
108+
inventory. The top-level object has exactly `schema`, `profile`,
109+
`completeness`, `areas`, and `claims`. `schema` is
110+
`cxf-library/g36-coverage/v1`, and `profile` is a nonempty string.
111+
`completeness` uses the same exact four-axis object as a registry row.
112+
113+
For this foundation version, `areas` and `claims` MUST be empty arrays. While
114+
the registry is empty, all four coverage completeness values MUST be
115+
`unknown`. Pin fields and an `implemented_variants` inventory do not belong in
116+
coverage.
117+
118+
The interface ABI, routine vector format, routine card or frontmatter,
119+
provenance bundle, package acceptance, member-list or array support, and
120+
executable verification are deferred. This version does not define those
121+
contracts.
122+
48123
## Design stance (why the pieces split this way)
49124

50125
- **A fault rule is a CDL composite block**: canonical point inputs → elementary

routines/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Routine catalog
2+
3+
Status: **zero executable routines**. Nothing in this namespace is implemented
4+
or verified yet.
5+
6+
`registry.json` is the executable routine inventory. It contains an empty
7+
`routines` array. `g36/coverage.json` records the non-claiming G36 profile
8+
zero-state; it is not a second inventory.
9+
10+
Revision ownership is explicit:
11+
12+
- Root `ENGINE_PIN` selects the runtime evaluator.
13+
- `g36/DONOR_PIN` selects the open-control-engine donor fixture and golden
14+
revision.
15+
- `g36/SOURCE_PIN` selects the upstream Modelica Buildings source revision.
16+
17+
The pin files are authoritative. See the routine catalog section in
18+
[`SCHEMA.md`](../SCHEMA.md) for row identities, allowed values, and path rules.
19+
Run `python3 tools/lint/routines.py` from the repository root to validate the
20+
catalog.
21+
22+
Interface ABI, vectors, cards or frontmatter, provenance bundles, package
23+
acceptance, member-list or array support, and executable verification remain
24+
deferred.

routines/g36/DONOR_PIN

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
41e997fd130c5e454446b40bcc3ba576429876b4

routines/g36/SOURCE_PIN

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a131864e4c4df22ebcd52bb8da439de0087ac365

routines/g36/coverage.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"schema": "cxf-library/g36-coverage/v1",
3+
"profile": "G36-2021-private-audit",
4+
"completeness": {
5+
"donor_configuration": "unknown",
6+
"canonical_class": "unknown",
7+
"family_package": "unknown",
8+
"guideline_profile": "unknown"
9+
},
10+
"areas": [],
11+
"claims": []
12+
}

routines/registry.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"schema": "cxf-library/routine-registry/v1",
3+
"routines": []
4+
}

0 commit comments

Comments
 (0)