|
|
|
|
import {
|
|
|
|
|
LogLevel,
|
|
|
|
|
createCatalogDiagnostics,
|
|
|
|
|
type DiagnosticCatalog,
|
|
|
|
|
type DiagnosticEvent,
|
|
|
|
|
type Diagnostics
|
|
|
|
|
} from '$libs/logr';
|
|
|
|
|
import {
|
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
|
|
|
CONN_DIAGNOSTIC_EVENTS,
|
|
|
|
|
CONN_EVENT_MESSAGE,
|
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
|
|
|
CONN_MODULE,
|
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
|
|
|
CONN_LOG_MSG_AUTH_FAILED,
|
|
|
|
|
CONN_LOG_MSG_BROWSER_RECONNECT,
|
|
|
|
|
CONN_LOG_MSG_CONNECT_FAILED,
|
|
|
|
|
CONN_LOG_MSG_FRAME_DECODE_FAILED,
|
|
|
|
|
CONN_LOG_MSG_FRAME_ENCODE_FAILED,
|
|
|
|
|
CONN_LOG_MSG_HEARTBEAT_TIMEOUT,
|
|
|
|
|
CONN_LOG_MSG_REAUTH_FAILED,
|
|
|
|
|
CONN_LOG_MSG_RECONNECT_EXHAUSTED,
|
|
|
|
|
CONN_LOG_MSG_SEND_FAILED,
|
|
|
|
|
CONN_LOG_MSG_SESSION_CHANGED,
|
|
|
|
|
CONN_LOG_MSG_SESSION_EXPIRED,
|
|
|
|
|
CONN_LOG_MSG_SESSION_REFRESHED,
|
|
|
|
|
CONN_LOG_MSG_SESSION_REVOKED,
|
|
|
|
|
CONN_LOG_MSG_TRANSPORT_ERROR
|
|
|
|
|
} from './consts.ts';
|
|
|
|
|
import { listenerThrewMessage } from './helpers.ts';
|
|
|
|
|
import type { Logger } from '$libs/logr';
|
|
|
|
|
|
|
|
|
|
export type ConnectionDiagnosticType =
|
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
|
|
|
(typeof CONN_DIAGNOSTIC_EVENTS)[keyof typeof CONN_DIAGNOSTIC_EVENTS];
|
|
|
|
|
|
|
|
|
|
export type ConnectionDiagnosticEvent = DiagnosticEvent<ConnectionDiagnosticType>;
|
|
|
|
|
export type ConnectionDiagnostics = Diagnostics<ConnectionDiagnosticEvent>;
|
|
|
|
|
|
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
|
|
|
const CONN_DIAGNOSTIC_LOGS: DiagnosticCatalog<ConnectionDiagnosticEvent> = {
|
|
|
|
|
[CONN_DIAGNOSTIC_EVENTS.AUTH_FAILED]: {
|
|
|
|
|
level: LogLevel.WARN,
|
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
|
|
|
message: CONN_LOG_MSG_AUTH_FAILED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.BROWSER_RECONNECT]: {
|
|
|
|
|
level: LogLevel.DEBUG,
|
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
|
|
|
message: CONN_LOG_MSG_BROWSER_RECONNECT
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.CONNECT_FAILED]: {
|
|
|
|
|
level: LogLevel.ERROR,
|
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
|
|
|
message: CONN_LOG_MSG_CONNECT_FAILED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.FRAME_DECODE_FAILED]: {
|
|
|
|
|
level: LogLevel.ERROR,
|
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
|
|
|
message: CONN_LOG_MSG_FRAME_DECODE_FAILED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.FRAME_ENCODE_FAILED]: {
|
|
|
|
|
level: LogLevel.ERROR,
|
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
|
|
|
message: CONN_LOG_MSG_FRAME_ENCODE_FAILED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.HEARTBEAT_TIMEOUT]: {
|
|
|
|
|
level: LogLevel.WARN,
|
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
|
|
|
message: CONN_LOG_MSG_HEARTBEAT_TIMEOUT
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.LISTENER_THREW]: (event) => ({
|
|
|
|
|
level: LogLevel.ERROR,
|
|
|
|
|
message: listenerThrewMessage(listenerEventName(event.meta))
|
|
|
|
|
}),
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.REAUTH_FAILED]: {
|
|
|
|
|
level: LogLevel.WARN,
|
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
|
|
|
message: CONN_LOG_MSG_REAUTH_FAILED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.RECONNECT_EXHAUSTED]: {
|
|
|
|
|
level: LogLevel.WARN,
|
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
|
|
|
message: CONN_LOG_MSG_RECONNECT_EXHAUSTED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.SEND_FAILED]: {
|
|
|
|
|
level: LogLevel.ERROR,
|
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
|
|
|
message: CONN_LOG_MSG_SEND_FAILED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.SESS_CHANGED]: {
|
|
|
|
|
level: LogLevel.DEBUG,
|
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
|
|
|
message: CONN_LOG_MSG_SESSION_CHANGED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.SESS_EXPIRED]: {
|
|
|
|
|
level: LogLevel.WARN,
|
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
|
|
|
message: CONN_LOG_MSG_SESSION_EXPIRED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.SESS_REFRESHED]: {
|
|
|
|
|
level: LogLevel.DEBUG,
|
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
|
|
|
message: CONN_LOG_MSG_SESSION_REFRESHED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.SESS_REVOKED]: {
|
|
|
|
|
level: LogLevel.WARN,
|
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
|
|
|
message: CONN_LOG_MSG_SESSION_REVOKED
|
|
|
|
|
},
|
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
|
|
|
[CONN_DIAGNOSTIC_EVENTS.TRANSPORT_ERROR]: {
|
|
|
|
|
level: LogLevel.ERROR,
|
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
|
|
|
message: CONN_LOG_MSG_TRANSPORT_ERROR
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function listenerEventName(meta: unknown): string {
|
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
|
|
|
if (typeof meta !== 'object' || meta === null) return CONN_EVENT_MESSAGE;
|
|
|
|
|
if (!('event' in meta)) return CONN_EVENT_MESSAGE;
|
|
|
|
|
const event = meta.event;
|
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
|
|
|
return typeof event === 'string' && event.length > 0 ? event : CONN_EVENT_MESSAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function createConnectionDiagnostics(input: {
|
|
|
|
|
readonly logger?: Logger;
|
|
|
|
|
readonly scope: string;
|
|
|
|
|
}): ConnectionDiagnostics {
|
|
|
|
|
return createCatalogDiagnostics({
|
|
|
|
|
logger: input.logger,
|
|
|
|
|
defaultCategory: input.scope,
|
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
|
|
|
catalog: CONN_DIAGNOSTIC_LOGS
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function emitConnectionDiagnostic(
|
|
|
|
|
diagnostics: ConnectionDiagnostics,
|
|
|
|
|
type: ConnectionDiagnosticType,
|
|
|
|
|
meta?: unknown
|
|
|
|
|
): void {
|
|
|
|
|
diagnostics.emit({
|
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
|
|
|
artifact: CONN_MODULE,
|
|
|
|
|
type,
|
|
|
|
|
meta
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function emitScopedConnectionDiagnostic(
|
|
|
|
|
diagnostics: ConnectionDiagnostics,
|
|
|
|
|
scope: string,
|
|
|
|
|
type: ConnectionDiagnosticType,
|
|
|
|
|
meta?: unknown
|
|
|
|
|
): void {
|
|
|
|
|
diagnostics.emit({
|
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
|
|
|
artifact: CONN_MODULE,
|
|
|
|
|
scope,
|
|
|
|
|
type,
|
|
|
|
|
meta
|
|
|
|
|
});
|
|
|
|
|
}
|