master
${ noResults }
5 Commits (dace6d00d13445adf37b05781c590d5f49591eb8)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
6b5533c840 |
Add module prefix to all remaining ad-hoc constants
Phase 2B.3 of the convention pass — closes the gap between rule 2
(`<MOD>_<CATEGORY>_<NAME>`) and the codebase. Adds the module's
4-letter alias to constants that previously had none or used a
non-canonical category prefix. ~190 constants renamed across 7
modules.
Bulk renames per module (sed with `\b...\b` word boundaries):
- arts/timr — ENGINE_METHOD_*, LOG_MSG_*, ERROR_PREFIX,
ERROR_NAME_*, ERROR_MSG_* now carry TIMR_ prefix
- arts/conn — TRANSPORT_KIND_*, FRAME_KEY_*, DEFAULT_*,
TIMR_KEY_*, BROWSER_EVENT_*, DOCUMENT_*,
WEBSOCKET_*, MOCK_TRANSPORT_*, LOG_MSG_*,
ERROR_*, FRAME_TYPE_*, METHOD_*, CLOSE_REASON_*
etc. now carry CONN_ prefix
- arts/sess — DEFAULT_*, AUTO_REFRESH_TIMER_KEY,
BROWSER_EVENT_*, DOCUMENT_*, BROADCAST_TYPE,
IDENTITY_*, REVOKE_SCOPE_*, REFRESH_STATUS_*,
ADOPT_REASON_*, SKIP_REASON_*, REVOKE_REASON_*,
INVARIANT_*, ACTOR_*, FIELD_*, ENGINE_METHOD_*,
ERROR_PREFIX/NAME/MSG, LOG_MSG_*, EVENT_* (the
lifecycle ones — see disambiguation below) now
carry SESS_ prefix
- arts/stor — ENTRY_CHANGE_SOURCE_*, DEFAULT_*, BROWSER_EVENT_*,
ENVELOPE_KEY/ERROR_*, NAMESPACE_SEPARATOR now
carry STOR_ prefix
- arts/http — DEFAULT_RETRY*, RETRY_AFTER_HEADERS,
DEFAULT_TIMEOUT, MAX_ERROR_BODY_BYTES, LOG_MSG_*,
ERROR_*, TIMEOUT_SCOPE_*, RESULT_KIND_* now
carry HTTP_ prefix
- arts/fmts — DEFAULT_LOCALE, AUTO_VALUE → FMTS_DEFAULT_LOCALE,
FMTS_AUTO_VALUE
- libs/timers — DEFAULT_BACKOFF_* → TIMR_DEFAULT_BACKOFF_*
- libs/lang — 4 unprefixed → LANG_ prefix
- libs/cach — 1 unprefixed → CACH_ prefix
Lifecycle vs bus event disambiguation (sess):
`arts/sess` had two distinct constant sets that collided after the
prefix add: `EVENT_*` (lifecycle, value `'sess.lifecycle.X'`) and
`SESS_EVENT_*` (bus, value `'sess.X'`). Both ended up with the same
SESS_EVENT_* name. To preserve the distinction:
- Lifecycle declarations renamed to SESS_EVENT_LIFECYCLE_* (matching
the path component already in their values).
- Bus declarations stay as SESS_EVENT_*.
- Consumers split correctly: code that switches on `change.event`
uses LIFECYCLE_ variants; code that publishes/subscribes to bus
uses bus variants.
Conn-side lifecycle redeclarations (`SESS_EVENT_REFRESHED` etc. with
`'sess.lifecycle.X'` values inside arts/conn/consts.ts) became
CONN_SESS_EVENT_* — these are conn-local copies; future cleanup
should import from sess instead of redeclaring.
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>
|
5 months ago |
|
|
a01ef0f63d |
Replace LOGGER_CATEGORY with <MOD>_MODULE single source of truth
Phase 2B.1 of the convention pass. Establishes one canonical constant
per module — `<MOD>_MODULE = '<alias>'` — as the single source for the
module's identifier across logger category, error message prefixes,
event scopes, and any other place the module's name is needed.
What changed:
1. Renamed all `<MOD>_LOG_CATEGORY` constants to `<MOD>_MODULE` (the
value semantics didn't change; only the name). Affected modules:
buss, conn, sess, perm (libs+arts+svrs), timr, lang, auth, http,
sium, cach, stor, aapp (libs+arts), and the four fmts sub-modules
(fmts, fmts.curr, fmts.dates, fmts.nums, fmts.unts).
2. Aligned values with the 4-letter alias where they didn't already:
- STOR_MODULE: 'storage' → 'stor'
- FMTS_MODULE: 'formats' → 'fmts'
- FMTS_CURR_MODULE: 'formats.currency' → 'fmts.curr'
- FMTS_DATES_MODULE: 'formats.dates' → 'fmts.dates'
- FMTS_NUMS_MODULE: 'formats.numbers' → 'fmts.nums'
- FMTS_UNTS_MODULE: 'formats.units' → 'fmts.unts'
3. Unified the duplicate `AAPP_MODULE` declaration: arts/aapp/consts.ts
now re-exports from libs/aapp/consts.ts (canonical source). Both
files used to declare it independently with different values
('app' vs 'aapp').
4. Replaced hardcoded `'[<alias>] ...'` literals in error messages
with template strings using `<MOD>_MODULE`. Every error-message
constant now derives the prefix from the module identifier instead
of hardcoding it. Affected files: libs/aapp/consts.ts, arts/aapp/consts.ts,
libs/buss/consts.ts, libs/lang/errors.ts, arts/stor/errors.ts,
arts/sium/errors.ts, arts/fmts/errors.ts, and the ERROR_PREFIX
constants in arts/conn, arts/sess, arts/http, arts/timr.
5. Updated diagnostic event values to use the new module aliases:
- STOR_DIAGNOSTIC_EVENTS.ERROR: 'storage.error' → 'stor.error'
- All FMTS_*_DIAGNOSTIC_EVENTS values to use 'fmts.X.*'
6. Updated tests that asserted against the old values (storage-integration.test
and fmts/curr/test/barrel.test).
7. Updated docs/conventions.md: replaced the LOG_CATEGORY category
with the new MODULE category. Added the rule that ERROR_MSG values
must use the template `[${<MOD>_MODULE}]`, never a hardcoded literal.
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>
|
5 months ago |
|
|
14fa92d38c |
Rename constant module prefixes to 4-letter aliases
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> |
5 months ago |
|
|
36868d3efe |
Add bus orchestration and ecosystem hardening
|
5 months ago |
|
|
6555c3b23e |
Consolidate framework diagnostics and refactors
|
5 months ago |