glam/.opencode/rules/class-file-name-sync-rule.md
kempersc 86b9dcebff Refactor Digital Platform Classes and Introduce New Classes
- Renamed DigitalPlatformV2DataSource to DigitalPlatformDataSource with updated description and mappings.
- Updated DigitalPlatformV2KeyContact to DigitalPlatformKeyContact, enhancing description and mappings.
- Refined DigitalPlatformV2OrganizationProfile to DigitalPlatformOrganizationProfile, improving description and slot usage.
- Revised DigitalPlatformV2OrganizationStatus to DigitalPlatformOrganizationStatus, clarifying description and mappings.
- Changed DigitalPlatformV2PrimaryPlatform to DigitalPlatformPrimaryPlatform, enhancing description and slot definitions.
- Updated DigitalPlatformV2Provenance to DigitalPlatformProvenance, refining description and mappings.
- Revised DigitalPlatformV2ServiceDetails to DigitalPlatformServiceDetails, improving description and mappings.
- Changed DigitalPlatformV2TransformationMetadata to DigitalPlatformTransformationMetadata, enhancing description and mappings.
- Added new classes: DetectionThreshold, DeviceType, DeviceTypes, DiarizationStatus, DigitalArchive, DigitalArchiveRecordSetType, DigitalArchiveRecordSetTypes, and DigitalConfidence with appropriate descriptions and mappings.
- Established rules for class descriptions, multilingual support, and slot definitions to ensure consistency and clarity across the schema.
2026-02-15 15:54:26 +01:00

54 lines
1.5 KiB
Markdown

# Rule: Class File Name Must Match Class Label/Name
## 🚨 Critical
When a class label/name is changed, the class file name must be renamed to match.
This keeps class modules discoverable, prevents stale imports, and avoids long-term naming drift.
## The Rule
1. If the primary class identifier changes, rename the file in the same edit set.
- Change triggers include updates to:
- top-level `name:`
- class key under `classes:`
- canonical class label used for module naming
2. File naming must reflect the canonical class name.
-`DigitalPlatformProfile.yaml` for class `DigitalPlatformProfile`
-`DigitalPlatformV2.yaml` for class `DigitalPlatformProfile`
3. After renaming a file, update all references.
- `imports:` in other class/slot/type files
- manifests/indexes/build inputs
- any generated or curated mapping lists that include file paths
4. Keep semantic names versionless.
- Do not preserve old versioned file names when class names are de-versioned.
- Coordinate with `no-version-indicators-in-names-rule.md`.
## Required Checklist
- [ ] File name matches canonical class name
- [ ] `id:` and `name:` are internally consistent
- [ ] All import paths updated
- [ ] Search confirms no stale old file-name references remain
- [ ] YAML parses after rename
## Example
Before:
```yaml
# file: DigitalPlatformV2.yaml
name: DigitalPlatformProfile
classes:
DigitalPlatformProfile:
```
After:
```yaml
# file: DigitalPlatformProfile.yaml
name: DigitalPlatformProfile
classes:
DigitalPlatformProfile:
```