Drops the 4-letter alias convention in favour of a single homogeneous
naming axis: full English words across filesystem, alias, wire format
and constants.
Module renames:
- arts/aapp → arts/active-app (libs/aapp also)
- arts/buss → arts/bus (libs/buss also)
- arts/cach → arts/cache (libs/cach + svrs/cach also)
- arts/conn → arts/connection
- arts/fend → arts/frontend
- arts/fmts → arts/formats (curr→currency, nums→numbers, unts→units)
- arts/logr → arts/logger (libs/logr also)
- arts/perm → arts/permissions (libs/perm + svrs/perm also)
- arts/sess → arts/session
- arts/stor → arts/storage
- arts/timr → arts/timer (libs/timers → libs/timer)
Modules left as-is: auth, dom, errs, http, lang, sium (already match
their canonical name or are proper names).
Special case: `aapp` could not become `app` because `$app` is reserved
by SvelteKit (`$app/stores`, `$app/navigation`, ...). Compromise:
- Filesystem and alias use `active-app` / `$active-app`.
- Constants and class names use `App` / `APP_*` (no `active-` prefix).
The `active-` prefix only disambiguates the alias from SvelteKit's
namespace; the module is App.
Special case: `permissions` keeps the plural for filesystem/alias/wire
but constants and classes use the singular `PERMISSION_*` /
`Permission*` because they describe the concept ("a permission
effect"), not the module collection.
Constants follow the new module name in caps: `STORAGE_*`, `BUS_*`,
`CACHE_*`, `CONNECTION_*`, `FORMATS_*`, `LOGGER_*`, `SESSION_*`,
`TIMER_*`, etc. Module values: `STORAGE_MODULE = 'storage'`,
`BUS_MODULE = 'bus'`, `APP_MODULE = 'app'`,
`PERMISSION_MODULE = 'permissions'`, etc.
Wire/code format moved accordingly: `'storage::*'`, `'bus::*'`,
`'session::*'`, `'permissions::*'`, etc. Diagnostic event values
updated: `'storage.error'`, `'bus.event.published'`,
`'connection.auth_failed'`, etc. App events use `'app.*'`:
`AAPP_EVENT_* → APP_EVENT_*` with values `'app.user.identity.changed'`.
Class renames (where they used the abbreviation):
- AappAlreadyCreatedError → AppAlreadyCreatedError
- BussError* → BusError* (where applicable)
- Cach* → Cache*
- Conn* → Connection* (e.g. ConnDisposedError → ConnectionDisposedError;
ConnConnection* collapsed to Connection*)
- Logr*Error → Logger*Error
- Sess* → Session* (SessInvalidSessionError → SessionInvalidError)
- Stor* → Storage*
- Timr* → Timer* (TimrInactiveTimerError → TimerInactiveError)
- AuthCachPort → AuthCachePort
- AuthClientCach* → AuthClientCache*
- AuthPermPort → AuthPermissionsPort
Property renames in option types:
- `cach?:` → `cache?:` in AuthClient options
- `logr:` → `logger:` in svrs/auth ports
- `timr:` → `timer:` in svrs/auth ports
`docs/conventions.md` rewritten:
- Rule 1 dropped the 4-letter alias mandate; lists the full English
module names and special-cases active-app, lang, sium, permissions.
- Rule 2 documents the new constant prefix convention and its two
exceptions (APP_* for active-app, PERMISSION_* singular for
permissions).
- Rule 6 codifies that all error infrastructure (codes, messages,
classes, guards) lives in a single `errors.ts` per module —
removing the `consts.ts` / `errors.ts` split for error-related
symbols.
`libs/errs` adds `ErrorMessages` type so every module can declare its
catalog as `<MOD>_ERROR_MESSAGES: ErrorMessages` instead of repeating
the `Readonly<Record<ErrCode, string | (...args) => string>>` shape.
Storage migrated as the first proof of the canonical pattern.
All 1334 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 2B.2 of the convention pass. Closes the inconsistency where
arts/aapp used APP_* prefix while libs/aapp already used AAPP_*.
After this commit every constant under arts/aapp and libs/aapp uses
the canonical 4-letter alias `AAPP_` (rule 1 of docs/conventions.md).
Constants renamed (~24 total):
- APP_EVENT_* → AAPP_EVENT_* (the 6 public events)
- APP_USER_IDENTITY_CAUSE_* → AAPP_USER_IDENTITY_CAUSE_*
- APP_ORCHESTRATION_* → AAPP_ORCHESTRATION_*
- APP_ERROR_* → AAPP_ERROR_*
- APP_LOG_MSG_* → AAPP_LOG_MSG_*
- APP_CONNECTION_CLOSE_REASON_* → AAPP_CONNECTION_CLOSE_REASON_*
- APP_EVENT_RUNTIMES → AAPP_EVENT_RUNTIMES
Wire-format change for the public app event values:
- 'app.user.identity.changed' → 'aapp.user.identity.changed'
- 'app.tenant.switched' → 'aapp.tenant.switched'
- 'app.permissions.refresh.requested'→ 'aapp.permissions.refresh.requested'
- 'app.connectivity.changed' → 'aapp.connectivity.changed'
- 'app.cache.invalidate.requested' → 'aapp.cache.invalidate.requested'
- 'app.dispose.starting' → 'aapp.dispose.starting'
Per docs/conventions.md rule 5, every event-identifier string value
must start with the module's 4-letter alias. Now that AAPP_MODULE = 'aapp'
(set in phase 2B.1) is the canonical module identifier, the event
scope follows. External observers of these events must update string
filters from `app.*` to `aapp.*`. The framework has not been tagged 0.1
yet so the wire format is still in flight.
Translation keys (`'app.title'`, `'app.cart'`, `'app.boot'`, etc. used
by `App.Lang.t(...)` in the demo / ecosystem test pages) are NOT
events and were intentionally left untouched — they're paths in the
lang schema, independent of the AAPP module identity.
Verification: svelte-check 1395 / 0 errors. Server 1230 tests, client
19 tests — all green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 2 of the convention pass documented in docs/conventions.md.
Aligns every module-level constant's prefix with the bundler alias
that already identifies the artifact (rule 1 of the convention):
- BUS_* → BUSS_* (libs/buss + arts/buss)
- CONNECTION_* → CONN_* (arts/conn + web consumers)
- SESSION_* → SESS_* (arts/sess + libs/aapp + consumers)
- PERMISSION_* → PERM_* (arts/perm, libs/perm, svrs/perm)
- TIMER_* → TIMR_* (arts/timr + libs/timers)
- CACHE_* → CACH_* (arts/cach + libs/cach + svrs/cach)
- STORAGE_* → STOR_* (arts/stor + consumers)
Mechanical sed pass with `\b<OLD>_` word-boundary anchor — this only
matches at identifier start, never inside (e.g. AAPP_BUS_CONTEXT_KEY
stays untouched because the boundary requirement is between non-word
and word characters).
Out of scope and deferred to phase 2B (per-module decisions, not
bulk-applicable):
- LOGGER_CATEGORY constants in each module's consts.ts must become
the module's own LOG_CATEGORY (BUSS_LOG_CATEGORY = 'buss',
CONN_LOG_CATEGORY = 'conn', etc.) — different rename per module,
not a single sed pattern.
- APP_* → AAPP_* (arts/aapp uses APP_ today; libs/aapp already
uses AAPP_).
- Ad-hoc constants without module prefix (DEFAULT_TIMER_*,
EVENT_*, BROWSER_*, IDENTITY_*, ACTOR_*, REVOKE_SCOPE_*, etc. in
arts/sess/consts.ts; AUTO_REAUTH_* in arts/conn).
Note on web/ files:
- src/web/routes/active/get-started/ai-agents/+page.svelte
- src/web/routes/temp/c2/+page.svelte
- src/web/routes/temp/c2/Curtain.svelte
These three files contain pre-existing user modifications (work in
progress unrelated to this rename) that the bulk sed touched on top
because they referenced renamed identifiers. Excluding them would
break compilation. Their content here is the intersection of both
changes; the user's prior edits to these files are intentionally
bundled in this commit.
Verification: svelte-check 1395 files / 0 errors. Server 1230 tests,
client 19 tests — all green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>