Two more module renames flipping the direction of the previous pass:
- arts/permissions, libs/permissions, svrs/permissions, libs/svrs/permissions.ts
→ arts/perm, libs/perm, svrs/perm, libs/svrs/perm.ts.
Alias: $permissions → $perm. Constants: PERMISSION_* → PERM_*.
Wire: 'permissions::*' → 'perm::*'. Module value: 'perm'.
Class names: Permission*Error → Perm*Error. Helper functions:
permissionDecisionKey → permDecisionKey (and similar).
- arts/formats → arts/format (with the four sub-modules currency,
numbers, units, dates carried along). Alias: $formats → $format.
Constants: FORMATS_* → FORMAT_*. Wire: 'formats::*' → 'format::*'.
Class names: Formats*Error → Format*Error.
Both follow the auth/http/dom precedent: short word as the canonical
name. The earlier full-word forms (permissions, formats) created
asymmetric prefixes (PERMISSION_* singular, PERMISSIONS_REFRESH
plural) that were already showing as drift in this commit's call
sites.
Plus a fix to sium error structure that was carried over from the
previous audit round but never fully consolidated:
- arts/sium/errors.ts now owns the full error infra: SIUM_ERR seed,
all SIUM_ERR_* codes, SIUM_ERROR_MESSAGES catalog, error classes
(SiumValidationError, SiumAsyncSchemaError, SiumDiscriminatedUnionError),
guards and the SIUM_ERROR_MESSAGES type. The legacy SIUM_ERRORS
string catalog stays for the few non-thrown sites until those are
migrated.
- arts/sium/consts.ts no longer carries error codes — only module
identifier and diagnostic events.
- arts/sium/core/types.ts no longer carries error classes — only
schema types.
- All call sites in arts/sium/core/* and arts/sium/types/* now import
the error classes from `../errors` instead of `../core/types` /
`../consts`.
This is the canonical pattern documented in conventions.md rule 6:
all of a module's error infrastructure lives in a single errors.ts
file; consts.ts is for module configuration that has nothing to do
with errors. Sium is now compliant; the rest of the modules will
follow in subsequent commits.
All 1334 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>