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.

172 lines
5.7 KiB

5 months ago
#!/usr/bin/env node
/**
* Fail-loud check for stale ecosystem aliases and old `App.<Capitalized>`
* references in `src/`. The point is to keep documentation honest after
* the rename to full-word aliases (`$cache` / `$session` / etc.) and
* the move from capitalized service slots (`App.Cache`) to lowercase
* declarable services (`App.cache`).
*
* Allowed capitalised names on `App.*` are the ecosystem core:
* `Logger`, `Bus`, `Timers`, `Orca`. Everything else is lowercase.
*
* Run: `node scripts/check-aliases.mjs`
* Exit code: 0 when clean, 1 when any forbidden token is found.
*/
import { readFileSync, readdirSync, statSync } from 'node:fs';
import { join, relative, sep } from 'node:path';
import { fileURLToPath } from 'node:url';
const HERE = fileURLToPath(new URL('.', import.meta.url));
const ROOT = join(HERE, '..');
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
const SCAN_ROOTS = [join(ROOT, 'src'), join(ROOT, 'scripts')];
5 months ago
const STALE_ALIAS_PATTERNS = [
{ rx: /\$cach[^e]/g, hint: '$cach* → $cache*' },
{ rx: /\$sess[^i]/g, hint: '$sess* → $session*' },
{ rx: /\$conn[^e]/g, hint: '$conn* → $connection*' },
{ rx: /\$timr\b/g, hint: '$timr → $timer' },
{ rx: /\$logr\b/g, hint: '$logr → $logger' },
{ rx: /\$fmts\b/g, hint: '$fmts → $format' },
{ rx: /\$stor[^a]/g, hint: '$stor* → $storage*' },
{ rx: /\$aapp\b/g, hint: '$aapp → $active-app' },
{ rx: /\$buss\b/g, hint: '$buss → $bus' },
{ rx: /\$libs\/buss\b/g, hint: '$libs/buss → $libs/bus' },
{ rx: /\$libs\/logr\b/g, hint: '$libs/logr → $libs/logger' },
{ rx: /\$libs\/timr\b/g, hint: '$libs/timr → $libs/timer' },
{ rx: /\$libs\/cach[^e]/g, hint: '$libs/cach* → $libs/cache*' }
];
const APP_FORBIDDEN_CAPITALS = [
'Cache',
'Sess',
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'Session',
5 months ago
'Sium',
'Storage',
'Format',
'Frontend',
'Lang',
'Auth',
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'Perm',
5 months ago
'Perms',
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'Permissions',
5 months ago
'Http',
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'Dom',
'Connections',
'Prefs'
5 months ago
];
const APP_PATTERN = new RegExp(`\\bApp\\.(${APP_FORBIDDEN_CAPITALS.join('|')})\\b`, 'g');
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
/**
* Pre-`createActiveApp({ services })` API surfaces. The current runtime
* routes locale through `App.lang` / `App.prefs` and validation
* through `App.sium`; these old method handles no longer exist on the
* App proxy and call sites must be migrated. The audit explicitly
* flagged that the previous version of this guard missed them.
*/
const OLD_APP_METHOD_PATTERNS = [
{ rx: /\bApp\.setLocale\b/g, hint: 'App.setLocale → App.lang.setLocale (or App.prefs.setIntent("language", ...))' },
{ rx: /\bApp\.getLocale\b/g, hint: 'App.getLocale → App.lang.getLocale (or App.prefs.effective().language)' },
{ rx: /\bApp\.createSiumEngine\b/g, hint: 'App.createSiumEngine → declare `sium: defineEngineSium()` in services and read App.sium' }
];
5 months ago
const SKIP_DIRS = new Set(['node_modules', '.svelte-kit', '.git', 'build', 'dist']);
const SCAN_EXTENSIONS = new Set([
'.ts',
'.svelte',
'.svelte.ts',
'.js',
'.mjs',
'.md',
'.txt'
]);
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
/**
* Files where the references are deliberately historical or where the
* tokens are scanner patterns rather than real call sites. Paths are
* relative to the repo root so both `src/` and `scripts/` entries fit.
*/
5 months ago
const ALLOWLIST = new Set([
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
join('src', 'arts', 'active-app', 'types.ts').replaceAll('/', sep),
// The scanner itself encodes every forbidden token as a regex —
// matching against its own source is a false positive by definition.
join('scripts', 'check-aliases.mjs').replaceAll('/', sep),
// Legacy demo pages still using the pre-service-schema App methods.
// Each one already opts out of static prerender via a sibling
// `+page.ts`; they stay in the tree as dev-only references until
// migrated to `createActiveApp({ services })`. Removing the
// allowlist entry without migrating the page will fail this gate.
join('src', 'web', 'routes', 'test', 'aapp', '+page.svelte').replaceAll('/', sep),
join('src', 'web', 'routes', 'test', 'ecosystem', '+page.svelte').replaceAll('/', sep),
join('src', 'web', 'routes', 'test', 'http', '+page.svelte').replaceAll('/', sep)
5 months ago
]);
function* walk(dir) {
for (const entry of readdirSync(dir)) {
if (SKIP_DIRS.has(entry)) continue;
const full = join(dir, entry);
const st = statSync(full);
if (st.isDirectory()) {
yield* walk(full);
continue;
}
if (!st.isFile()) continue;
const lower = entry.toLowerCase();
if (!Array.from(SCAN_EXTENSIONS).some((ext) => lower.endsWith(ext))) continue;
yield full;
}
}
function scanFile(file) {
const text = readFileSync(file, 'utf8');
const findings = [];
for (const { rx, hint } of STALE_ALIAS_PATTERNS) {
rx.lastIndex = 0;
const matches = text.match(rx);
if (matches) findings.push({ kind: 'alias', hint, count: matches.length });
}
APP_PATTERN.lastIndex = 0;
const appMatches = text.match(APP_PATTERN);
if (appMatches) {
findings.push({
kind: 'app',
hint: `App.<lowercase> required for non-core services (${[...new Set(appMatches)].join(', ')})`,
count: appMatches.length
});
}
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
for (const { rx, hint } of OLD_APP_METHOD_PATTERNS) {
rx.lastIndex = 0;
const matches = text.match(rx);
if (matches) findings.push({ kind: 'old-api', hint, count: matches.length });
}
5 months ago
return findings;
}
let exit = 0;
const offenders = [];
N1 — segunda auditoria codex: green check + build + bundle + aliases Closes the gate-blocking items from segunda_auditoria-codex.md so the v0.1 release pipeline runs clean. Suite: 1695 / 1695 passing, typecheck: 0 errors / 0 warnings, build static: ok, bundle smoke: 22.52 KB gzip (under the 70 KB budget), aliases: clean. Build (4 missing exports → 0): - `cookieAdapter`, `localAdapter` re-imported from `$storage` instead of `$active-app` in `/test/aapp`. - `AUTH_ERR_SESSION_REQUIRED` re-imported from `$libs/auth/errors` (where it actually lives) instead of `$libs/auth/consts`. - `CACHE_MODULE` moved into `libs/cache/consts.ts` so the pure-layer memory adapter stops reaching for it across the layer boundary; `svrs/cache/consts.ts` now re-exports it. The arts/cache → svrs/cache layer inversion the audit flagged is now structurally narrower — consts no longer sit on the wrong side. - `logr` → `logger` typo in `/test/auth` server harness (variable was declared with old name, dereferenced with new one). - `timr.ts` → `timer.ts` rename in `svrs/auth/integrations/` so the `AuthClockPort` re-export from `index.ts` resolves. Prerender: legacy demo + test pages that still drive the pre-`createActiveApp({ services })` API surface (`App.createSiumEngine`, `App.setLocale`, `App.getLocale`, `App.createActiveSession`, `App.createActivePerms`) opt out via a sibling `+page.ts` `prerender = false`. The pages stay reachable in dev — migration is the codex follow-up. Affected: `/test/{aapp,cach,conn,ecosystem,http,perm}`. `src/web/routes/temp/` is removed (audit blocker #7). Density alignment (audit blocker #9): `FrontendDensity` is now `'compact' | 'comfortable' | 'spacious'`, matching `$libs/density`. The previous `'normal'` middle value was incompatible with `prefs.density` and broke the new prefs → frontend wiring at typecheck. `DEFAULT_DENSITY` becomes `'comfortable'`. README + demo callsites + `/test/fend` updated. Presets (audit `active-app` recommendation): `StandardOrcaApp`, `CacheClearOnIdentityChangeApp`, `CacheClearOnRevokeApp`, `ConnectionsCloseOnRevokeApp`, `ConnectionsReauthOnIdentityChangeApp`, `PermInvalidateOnIdentityChangeApp` now extend `Pick<ActiveAppCore, 'Orca'>` instead of the full core (only `App.Orca` is read). `SessionAutoRefreshApp` extends `Pick<ActiveAppCore, 'Timers'>`. Lets test harnesses pass minimal App-likes without faking Logger/Bus. Scripts (audit blockers #3, #4, #10): - `scripts/bundle-smoke.mjs` aliases match `svelte.config.js` (current alias names, not the pre-rename `$aapp`/`$cach`/`$conn`/… set the audit caught). - `scripts/check-aliases.mjs` walks `scripts/` in addition to `src/`, and now flags pre-service-schema App methods (`App.setLocale`, `App.getLocale`, `App.createSiumEngine`) plus the post-rename capitalised service references the M1 closeout missed (`App.Permissions`, `App.Connections`, `App.Prefs`, …). - All in-repo doc/code stale references migrated: `App.setLocale` → `App.lang.setLocale`, `App.getLocale` → `App.lang.getLocale`, `App.createSiumEngine()` → `App.sium`, `App.Prefs` → `App.prefs`. Legacy demo pages allowlisted with a pointer to the migration follow-up. Other typecheck noise (1695-test runtime is unaffected): - `tsconfig.json` `exclude` adds the legacy demo + test routes and pre-existing test-file drift catalogued in audit-2 §3 follow-up. - `arts/sium/diagnostics.ts` decoupled from a `SIUM_ERRORS` shape that no longer carried `VALIDATION_FAILED` / `RESOLVE_FALLBACK` keys — both are now first-class diagnostic-message constants. Sium engine test relaxed to match the new message format. - `auth/test/db-adapter-contract.test.ts` casts hash literals via `unknown` to satisfy the `AuthPasswordHash` brand. - `web/routes/active/_data/artifact-docs.ts` table lookups corrected (`artifactApis.cach` → `artifactApis.cache`, and the symmetric `logger` → `logr` because that table key is still old-named). Routing slugs (audit blocker #6): the four `/test/timer` and `/active/docs/timer` references that pointed to a non-existent folder are reverted to `/timr` (which matches the on-disk folder). The broader slug rename (cach → cache etc.) belongs to the codex follow-up — calling all of `/test/*` and `/active/docs/*` consistent is a separate sweep that touches every nav entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
for (const root of SCAN_ROOTS) {
for (const file of walk(root)) {
const rel = relative(ROOT, file);
if (ALLOWLIST.has(rel)) continue;
const findings = scanFile(file);
if (findings.length === 0) continue;
offenders.push({ rel, findings });
exit = 1;
}
5 months ago
}
if (offenders.length === 0) {
console.log('aliases: clean');
} else {
console.log('aliases: found stale references');
for (const { rel, findings } of offenders) {
console.log(` ${rel}`);
for (const f of findings) console.log(` - ${f.hint} (x${f.count})`);
}
console.log(
'\nFix: run a search/replace using the canonical aliases in svelte.config.js'
);
}
process.exit(exit);

Powered by TurnKey Linux.