You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
3.6 KiB

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,
LOG_MSG_AUTH_FAILED,
LOG_MSG_BROWSER_RECONNECT,
LOG_MSG_CONNECT_FAILED,
LOG_MSG_FRAME_DECODE_FAILED,
LOG_MSG_FRAME_ENCODE_FAILED,
LOG_MSG_HEARTBEAT_TIMEOUT,
LOG_MSG_REAUTH_FAILED,
LOG_MSG_RECONNECT_EXHAUSTED,
LOG_MSG_SEND_FAILED,
LOG_MSG_SESSION_CHANGED,
LOG_MSG_SESSION_EXPIRED,
LOG_MSG_SESSION_REFRESHED,
LOG_MSG_SESSION_REVOKED,
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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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,
message: 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
});
}

Powered by TurnKey Linux.