Commit Graph

248 Commits

Author SHA1 Message Date
saravanakumardb1
7e08cce95f fix(kill-switch-client): point at /settings/kill-switch (the real endpoint)
The client was calling GET ${baseUrl}/flags/kill-switch which does
not exist on platform-service. The actual kill-switch endpoint lives
under /settings/kill-switch in the settings module (public, no auth
required). The bug was silently masked by the client's fail-open
behavior on non-OK responses, but it produced a 404 on every page
load for every consumer (NoteLett, MindLyst, ChronoMind, FlowMonk,
NomGap, PeakPulse, JarvisJr, LysnrAI, ActionTrail, EffoRise, Local
Memory GPT).

Discovery: running the deployed NoteLett docker stack against the
sibling platform-service, every page load triggered:
  GET http://localhost:4003/api/flags/kill-switch?platform=web → 404
Confirmed by curl-ing both endpoints directly:
  /api/flags/kill-switch        → {"message":"Route GET:/api/flags/kill-switch not found"}
  /api/settings/kill-switch     → {"enabled":true,"disabled":false,"message":""}

Also adds the productId as a query param. The server route accepts
productId from the query string OR an x-product-id header — sending
both is harmless and improves debuggability when grepping logs.

Updated JSDoc and the corresponding test assertion. Test count
unchanged (6 passed).

Verified:
  pnpm --filter @bytelyst/kill-switch-client test → 6/6 passed
  pnpm --filter @bytelyst/kill-switch-client build → ok
  curl /api/settings/kill-switch?productId=notelett → 200 with payload
2026-05-23 10:17:42 -07:00
saravanakumardb1
50db3ea621 chore(packages): bump versions for Gitea registry publish 2026-05-23 10:17:42 -07:00
saravanakumardb1
dc8161b382 fix(design-tokens): add --bl-* alias layer to all 10 product CSS files + generator
Root cause: @bytelyst/ui components reference --bl-* tokens (e.g. --bl-accent,
--bl-bg-canvas) but only tokens.css (MindLyst) and chronomind.css had these
aliases. All other 10 product CSS files fell back to hardcoded defaults,
making shared components unstyled.

Changes:
- actiontrail.css: --bl-* → --at-*
- flowmonk.css: --bl-* → --fm-*
- jarvisjr.css: --bl-* → --jj-*
- localllmlab.css: --bl-* → --llm-*
- localmemgpt.css: --bl-* → --lmg-*
- lysnrai.css: --bl-* → --lys-*
- mindlyst.css: --bl-* → --ml-*
- nomgap.css: --bl-* → --ng-*
- notelett.css: --bl-* → --nl-*
- peakpulse.css: --bl-* → --pp-*
- generate.ts: generateProductCSS() now emits --bl-* aliases automatically

31 aliases per file covering: surfaces, borders, text, accent, info/success/
warning/danger, focus ring, overlay scrim.
2026-05-14 20:33:40 -07:00
saravanakumardb1
9350829345 fix(design-tokens): add --bl-* alias layer to chronomind.css for @bytelyst/ui compatibility
Root cause: @bytelyst/ui components reference --bl-* tokens but chronomind.css
only defined --cm-* tokens. This caused all shared UI components to fall back
to hardcoded defaults, breaking the visual appearance.

Adds 31 --bl-* → --cm-* CSS custom property aliases matching the pattern
already used in tokens.css (--bl-* → --ml-*).
2026-05-14 20:18:08 -07:00
saravanakumardb1
83caf264df chore: publish 8 outdated packages to Gitea registry
Published:
  - @bytelyst/accessibility 0.1.6
  - @bytelyst/billing-client 0.1.0 (new)
  - @bytelyst/config 0.1.6
  - @bytelyst/create-app 0.1.4
  - @bytelyst/design-tokens 0.1.6
  - @bytelyst/subscription-client 0.1.6
  - @bytelyst/ui 0.1.8
  - @bytelyst/webhook-dispatch 0.1.6
2026-05-14 17:35:04 -07:00
root
60c34745f4 Add CardButton export to @bytelyst/ui package
- Add card-button export to package.json exports field
- Bump version to 0.1.8
- Publish to Gitea registry

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-12 03:42:49 +00:00
root
0c76a5f358 feat: add @bytelyst/mcp-client package for reusable MCP integration
Add new reusable MCP client package with connection management, tool execution, caching, rate limiting, audit logging, and error handling. This provides a standardized way to integrate with MCP servers across all ByteLyst products.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-11 19:10:15 +00:00
Devin
953730ff51 feat(ui): add <CardButton> primitive (UI audit Pattern A fix)
Some checks failed
CI — Common Platform / Build, Test & Typecheck (push) Has been cancelled
CI — Common Platform / Publish @bytelyst/* to Gitea npm registry (push) Has been cancelled
The Button primitive applies `whitespace-nowrap` + a fixed `h-{size}`
because it's tuned for single-line CTAs. Consumers using Button as a
card-shaped picker — title above description, icon next to multi-line
label — hit collapsed/clipped content because of those constraints.

CardButton is the right primitive for that use case:

  - block layout, full-width, left-aligned by default
  - whitespace: normal so multi-line content wraps
  - height: auto so any number of stacked rows works
  - focus-visible ring tied to --bl-focus-ring/--bl-accent (matches Button)
  - disabled opacity + pointer-events
  - selected? prop with subtle inset accent ring (override-able)
  - asChild support via Radix Slot for <Link>/<a> handoff

Bumps @bytelyst/ui to 0.1.6 and re-exports CardButton + CardButtonProps
from the package entry point.

Initial consumers: 5 sites in learning_ai_invt_trdg (StrategyWizard
risk + hours pickers, SimpleView buy + sell plan cards, MyStrategiesTab
diagnostic toggle). See docs/ui/UI_AUDIT.md Pattern A in that repo.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 09:31:29 +00:00
root
d2420f5d3c fix(devops): responsive UI + overflow guards in DevopsPanel
Some checks are pending
CI — Common Platform / Build, Test & Typecheck (push) Waiting to run
CI — Common Platform / Publish @bytelyst/* to Gitea npm registry (push) Blocked by required conditions
@bytelyst/devops 0.1.3:
- Wrap tables in scrollable container (overflow-x: auto) so long values
  never push the panel wider than its parent.
- table-layout: fixed + min-width on key column prevents column blow-out.
- Code/value cells use overflow-wrap: anywhere + word-break: break-word
  so long commit SHAs and Docker image strings wrap.
- pre block uses pre-wrap + break-word for raw JSON.
- Header actions wrap on narrow viewports.
- Tabs row scrolls horizontally rather than wrapping awkwardly.
- root container: maxWidth 100% + minWidth 0 to play nicely with flex parents.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 07:14:29 +00:00
root
51fc8d09b0 feat(devops): admin-only collector helpers, public version, deps + tests
Some checks are pending
CI — Common Platform / Build, Test & Typecheck (push) Waiting to run
CI — Common Platform / Publish @bytelyst/* to Gitea npm registry (push) Blocked by required conditions
Bumps @bytelyst/devops to 0.1.2.

Adds:
- getBuildInfo() — public-safe build info (commit + branch + image),
  no env vars or runtime introspection. Suitable for unauthenticated
  /api/devops/version endpoints used by ops/CI.
- getRuntimeInfo() / getConfigInfo() — exposed individually for callers
  who want to compose their own payload.
- readServiceVersion(import.meta.url) — walks up to package.json so
  consumers don't need to hardcode the version string.
- dependencyCheck(name, fn, timeoutMs) — timed health check wrapper
  with consistent ok/latency/detail shape. Enforces a hard timeout.
- httpDependencyCheck(name, url, timeoutMs) — convenience for HTTP probes.

Other improvements:
- SECRET_PATTERN extracted as a module constant.
- 17 unit tests covering build/runtime/config collectors, secret-leak
  guards, version walker fallbacks, dep timeouts, full collect payload.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 05:52:21 +00:00
root
17780adc1a feat(devops): add @bytelyst/devops package — runtime metadata + React UI
Some checks are pending
CI — Common Platform / Build, Test & Typecheck (push) Waiting to run
CI — Common Platform / Publish @bytelyst/* to Gitea npm registry (push) Blocked by required conditions
- Server collector via @bytelyst/devops/server: build, runtime, config, deps
- React UI via @bytelyst/devops/ui: tabbed view (Build/Runtime/Config/Deps/Raw)
- Build metadata baked from BYTELYST_COMMIT_SHA / BYTELYST_BUILT_AT / etc env vars
- No secret leakage: only env var keys are exposed, never values

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 04:56:39 +00:00
d7d683a1fb docs(ui): add launch state matrix story 2026-05-09 02:16:57 -07:00
4d172879f4 feat(ui): add operational workflow primitives 2026-05-08 21:16:48 -07:00
aad91f3b9d chore: remove embedded Gitea package registry 2026-05-08 21:10:03 -07:00
29ad325514 Improve shared UI primitives 2026-05-08 20:56:05 -07:00
3398574155 fix(ui): make app shell server compatible
Some checks failed
CI — Common Platform / Build, Test & Typecheck (push) Failing after 0s
CI — Common Platform / Publish @bytelyst/* to Gitea npm registry (push) Has been skipped
CI — Common Platform / Check design token drift (push) Failing after 0s
2026-05-06 18:09:54 -07:00
efb0162be0 fix(ui): expose core component subpath exports 2026-05-06 16:03:01 -07:00
cd6546ef97 fix(ui): emit node-compatible root exports 2026-05-06 14:03:49 -07:00
50617c1813 fix(ui): harden app shell responsive behavior 2026-05-06 13:44:44 -07:00
5e7b349a7c feat(ui): add app shell primitives 2026-05-06 13:32:17 -07:00
5af6154e80 test(ui): add primitive story coverage 2026-05-06 11:30:51 -07:00
5b720fda33 feat(ui): add data display primitives 2026-05-06 11:27:51 -07:00
0876bc125f feat(ui): add accessible control primitives 2026-05-06 11:25:26 -07:00
48ad3deb7f feat(ui): add surface layout primitives 2026-05-06 11:21:50 -07:00
f37fd480fe feat(ui): add product-safe primitive variants 2026-05-06 11:20:33 -07:00
9d5a31d559 fix(ui): use tokenized status colors 2026-05-06 11:15:29 -07:00
23e140009f feat(ui): add operational core primitives 2026-05-06 11:10:08 -07:00
OpenAI Codex
42f60cb286 feat(accessibility): add focus trap helpers 2026-05-05 01:15:38 -07:00
d3fbeba69d test(auth): allow bcrypt hash tests to finish
What changed:
- Added an auth package Vitest config with the existing forks pool and a 15s test timeout.
- Kept production bcryptjs salt rounds and test assertions unchanged.

Why:
- On this machine one 12-round bcryptjs hash can exceed Vitest's default 5s timeout, making the auth suite fail even though the implementation succeeds.

Verification:
- pnpm --filter @bytelyst/auth build
- pnpm --filter @bytelyst/auth test
- pnpm --filter @bytelyst/auth exec eslint . --ext .ts,.tsx
2026-05-04 16:58:50 -07:00
91e08bfda0 chore(diagnostics-client): document console capture
What changed:
- Added a scoped no-console justification around the console capture wrapper.

Warning impact:
- @bytelyst/diagnostics-client scoped lint: 8 warnings -> 0.
- Workspace lint: 101 -> 93 warnings.

Verification:
- pnpm --filter @bytelyst/diagnostics-client build
- pnpm --filter @bytelyst/diagnostics-client test
- pnpm --filter @bytelyst/diagnostics-client exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 16:40:03 -07:00
433c3a5493 chore(create-app): document generator output
What changed:
- Classified create-app generator console output as intentional CLI output.
- Added narrow file-level lint justifications for the generator entrypoints.

Warning impact:
- @bytelyst/create-app scoped warnings: 49 -> 0.
- Workspace warning total: 150 -> 101 with the generator/doc changes present.

Verification:
- pnpm --filter @bytelyst/create-app build
- pnpm --filter @bytelyst/create-app test
- pnpm --filter @bytelyst/create-app exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 16:37:13 -07:00
5b0fbc2b55 chore(config): document keyvault diagnostics
What changed:
- Kept Key Vault startup warnings visible before app loggers exist.
- Added narrow lint justifications for the two intentional console diagnostics.

Warning impact:
- @bytelyst/config scoped warnings: 2 -> 0.
- Workspace warning total: 157 -> 155.

Verification:
- pnpm --filter @bytelyst/config build
- pnpm --filter @bytelyst/config test
- pnpm --filter @bytelyst/config exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 16:30:53 -07:00
5fb49215cd chore(broadcast-client): document deep-link diagnostics
What changed:

- Keep broadcast deep-link warnings for host app integration failures.

- Add narrow lint justifications for the two intentional console diagnostics.

Warning impact:

- @bytelyst/broadcast-client no-console: 2 warnings -> 0 warnings.

Verification:

- pnpm --filter @bytelyst/broadcast-client build

- pnpm --filter @bytelyst/broadcast-client test

- pnpm --filter @bytelyst/broadcast-client exec eslint . --ext .ts,.tsx

- pnpm typecheck

- pnpm test

- pnpm lint

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:07:13 -07:00
afe7d88869 chore(monitoring): type fetch test mocks
Replace test-only any casts with a small typed fetch mock helper for partial health-check responses.

Verification: pnpm --filter @bytelyst/monitoring build; pnpm --filter @bytelyst/monitoring test; pnpm --filter @bytelyst/monitoring exec eslint . --ext .ts,.tsx; pnpm lint.
2026-05-04 15:19:05 -07:00
46900728d3 chore(api-client): type header merging
Replace the Headers branch's any cast with a typed copy into a Record so the shared API client keeps the same header merge behavior without a no-explicit-any warning.

Verification: pnpm --filter @bytelyst/api-client build; pnpm --filter @bytelyst/api-client test; pnpm --filter @bytelyst/api-client exec eslint . --ext .ts,.tsx; pnpm lint.
2026-05-04 15:17:33 -07:00
8f541c9f87 chore(audit): unblock workspace lint pipeline + 13 mechanical fixes
The first `pnpm -r exec eslint .` run was bailing at the very first
package (design-tokens), hiding any lint state in the rest of the 69
workspace packages. This commit fixes the structural blockers so the
pipeline runs end-to-end, then sweeps the small, low-risk lint errors
in the next 4 packages it surfaces. Real lint debt that remains
(85 errors, mostly @typescript-eslint/no-unused-vars across many
unrelated packages) is cataloged in docs/AUDIT_PLATFORM.md for follow-
up by package owners.

Structural fixes (eslint config):
  - eslint.config.js (root):
      • New flat-config block for **/*.cjs and **/scripts/**/*.{js,cjs}
        with Node globals (process, console, require, module, __dirname)
        and no-console disabled. CLI scripts legitimately print to
        stdout. This alone clears the 45 errors in design-tokens'
        validate-tokens.cjs.
      • Added XMLHttpRequest + ProgressEvent to browser globals so
        feedback-client compiles.
  - packages/ui/eslint.config.js:
      • Added @typescript-eslint/parser — the package-local override
        replaced (didn't merge with) the root config, so TS syntax was
        being parsed by espree and erroring on every `interface` /
        type import.
      • Added ignores for dist/** (root's ignores aren't inherited).
      • Extended the files glob to .storybook/**/*.{ts,tsx}.

Mechanical lint fixes (no behaviour change):
  - design-tokens/scripts/{validate,token-coverage}.cjs: empty catch
    binding (catch (e) → catch).
  - feedback-client/src/index.ts:
      • captureScreen(): preserve caught error via `{ cause: err }`
        on the rethrown Error (preserve-caught-error rule, real bug —
        previous chain dropped the original stack).
      • captureElement(): rename unused parity params mimeType/quality
        to _mimeType/_quality and document why they exist.
  - logger/__tests__/logger.test.ts: drop unused `LoggerConfig` import.
  - extraction-service/{lib/circuit-breaker,modules/extract/{sidecar-
    monitor,usage}}.test.ts: drop 3 unused vitest/type imports.
  - tracker-web/__tests__/tracker-proxy.test.ts: rename unused local
    `url` → `_url`.

New: docs/AUDIT_PLATFORM.md
  Tooling-backed audit summary (pnpm install / typecheck / test / lint
  results), classification of remaining lint debt by rule, and an
  ordered hand-off plan for package owners to clear the rest with
  `pnpm --filter <pkg> lint:fix` followed by an eyeball review.

Verified before commit:
  - `pnpm typecheck` → pass (all 69 packages compile)
  - `pnpm test`      → pass (~2,200 tests across 18+ suites)
  - `pnpm lint`      → 85 pre-existing errors surfaced (none introduced
    by this commit; all in unrelated packages — see AUDIT_PLATFORM.md
    section P).

Out of scope (left untouched in working tree):
  - In-progress nomgap-on-Vercel migration: docker-compose.ecosystem.yml,
    products/nomgap/product.json, services/platform-service/src/
    modules/flags/seed.ts.
  - pnpm-lock.yaml: my `pnpm install -r` regenerated it (+2.9k/-8.5k
    lines) — not part of the audit, owner should commit deliberately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 14:21:34 -07:00
saravanakumardb1
7d266bfcc0 fix(docker): INFRA-gap-02 unblock full-stack docker compose up
Three coordinated fixes so 'docker compose up cosmos-emulator platform-service
cowork-service --wait' completes end-to-end (pre-existing blocker surfaced by
W1 post-push review).

1. Remove harmful prepare:tsc from @bytelyst/react-native-platform-sdk
   package.json. The hook fires during pnpm install --frozen-lockfile against
   an empty src/ tree (because Dockerfiles COPY package.jsons before
   sources), tsc aborts, install fails. Canonical monorepo build flow is
   pnpm -r build using the existing build:tsc script; prepare only runs for
   git+ URL installs (which this published package doesn't use), so removing
   it is lossless.

2. Add --ignore-scripts to platform-service + mcp-server Dockerfile install
   steps. Mirrors the pattern already used by extraction-service/Dockerfile,
   dashboards/admin-web/Dockerfile, dashboards/tracker-web/Dockerfile.
   Belt-and-braces against future prepare-hook regressions in any workspace
   package.

3. Expand .dockerignore node_modules/dist/.next/coverage to **/ globs.
   Docker's .dockerignore with bare 'node_modules' only matches root-level;
   nested packages/*/node_modules/ were being COPY'd into images, poisoning
   them with host-absolute-path .bin shims (e.g. @bytelyst/storage's tsc
   shim resolved to /learning_voice_ai_agent/node_modules/.pnpm/... which
   doesn't exist in the container → MODULE_NOT_FOUND). The glob fix makes
   COPY packages/ packages/ deliver source only.

Gap: INFRA-gap-02
Verified:
  pnpm install --frozen-lockfile                              
  pnpm --filter @bytelyst/react-native-platform-sdk build     
  pnpm --filter @bytelyst/react-native-platform-sdk typecheck 
  docker compose build platform-service                        (previously failed)
  docker compose build mcp-server                             
  docker compose build extraction-service                     
2026-04-16 15:48:32 -07:00
saravanakumardb1
acace0cdc5 feat(field-encrypt): add CosmosDekStore for production DEK persistence (6 tests)
- dek-store-cosmos.ts: Cosmos DB-backed DekStore implementation
  - Uses _encryption_keys container with dekId partition key
  - Upsert semantics, idempotent delete, query-based listIds
- index.ts: export CosmosDekStore
- index.test.ts: 6 new tests with mock container (56 total)

This completes E2EE Phase 3 — production multi-instance DEK storage.
Previously only MemoryDekStore was available, losing DEKs on restart.
2026-04-14 11:29:23 -07:00
saravanakumardb1
d83641c5ee fix(subscription-client): extend SubscriptionDoc with platform-service fields 2026-04-13 22:57:13 -07:00
saravanakumardb1
87ae533b58 fix(webhook-dispatch): add missing typescript + vitest devDependencies 2026-04-13 11:41:34 -07:00
saravanakumardb1
7284914fb3 fix(billing-client): add missing typescript devDependency 2026-04-13 11:05:26 -07:00
saravanakumardb1
774244eaa2 feat(billing-client): add @bytelyst/billing-client shared package
Browser/React Native-safe typed client for platform-service billing
endpoints: plans, subscriptions, payments, and usage.

Follows the same factory pattern as broadcast-client and survey-client.
Any ByteLyst product can add billing with 5 lines of wiring code.

12 tests covering all methods, auth headers, error handling, and
404 null-return for missing subscriptions.
2026-04-13 10:28:29 -07:00
saravanakumardb1
deff216c7e refactor(gitea): robust manifest-based publish pipeline
publish-outdated-packages.sh rewritten:
- Manifest-based change detection (no registry tarball downloads)
- Single pack per package (not double-pack for check+publish)
- Deterministic content hash: normalizes version, publishConfig,
  and @bytelyst/* dep versions (workspace:* resolution noise)
- Single metadata fetch per package (cached in-process)
- Fixed .npmrc overwrite bug that broke auth during publish phase
- npm_clean() helper strips all proxy env vars uniformly

release-packages.sh fixed:
- .npmrc now includes scoped registry + proxy=false for corp
- Unified corp/home publish path (no duplicated code)
- version_on_registry() uses proxy-stripped env
- Registry credential check uses proxy-stripped env

CI workflow: switched to publish-outdated-packages.sh --skip-build
2026-04-13 01:47:03 -07:00
saravanakumardb1
4e92634f62 chore(create-app): remove private flag, publish to Gitea registry 2026-04-13 00:56:13 -07:00
saravanakumardb1
7b12cba099 chore(packages): bump versions for Gitea registry publish
Published 60 @bytelyst/* packages to local Gitea npm registry.
create-app skipped (private: true — internal scaffolding tool).

Token regenerated with full write:package scope to fix E401.
2026-04-13 00:51:57 -07:00
saravanakumardb1
9db3967fe1 ci: update CI/CD configuration 2026-04-12 23:51:10 -07:00
root
e2259f39ec chore: release version bumps [skip ci] 2026-04-13 04:37:22 +00:00
root
39e48f3241 feat(llm): add FallbackLLMProvider + release pipeline script
- packages/llm: add FallbackLLMProvider (providers/fallback.ts) that
  tries each provider in order, skipping unconfigured or erroring ones;
  wire 'fallback' as a first-class LLMProviderType in factory + types
- packages/llm: improve auto-detection in factory — PERPLEXITY_API_KEY
  and GEMINI_API_KEY trigger auto-selection when no explicit provider set
- scripts/release.sh: new pipeline — rebase from origin/main, build,
  apply changesets, publish outdated packages to Gitea registry, push
- scripts/run-registry-tests.sh: fix Gitea URL health-check to use a
  real package endpoint with auth header instead of bare registry root
- docs: mark Vercel track-B prompts B1–B3 as complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 04:21:12 +00:00
saravanakumardb1
d1c6cf47c8 feat(palace): add @bytelyst/palace shared package — MemPalace primitives (91 tests)
New shared package: packages/palace/ (@bytelyst/palace)

Modules:
- types.ts — BasePalaceWingDoc, RoomDoc, MemoryDoc, TunnelDoc, KGTripleDoc, DiaryDoc
- halls.ts — HallType union, HALL_PRESETS (notelett/mindlyst/coding), hallFromLabel()
- cosine.ts — cosineSimilarity(), topKByCosine(), normalizeVector()
- dedup.ts — isContentDuplicate(), isExactDuplicate(), findClosestMatch()
- decay.ts — computeDecayedRelevance(), boostRelevance()
- extraction.ts — buildExtractionPrompt(), parseExtractionResponse(), regexFallbackExtraction()
- kg.ts — findContradictions(), mergeTriples(), isTripleCurrent()
- wakeup.ts — buildWakeUpLayers(), truncateToTokenBudget(), WAKEUP_PRESETS
- config.ts — palaceConfigSchema (Zod)

7 test files, 91 tests passing.
Consumed by NoteLett, MindLyst, and future palace-enabled products.
2026-04-10 00:57:00 -07:00
saravanakumardb1
031e910607 fix(extraction-service): review fixes — locale mapping, model passthrough, content-type validation
BUG 1: Azure locale derivation produced 'en-EN' (invalid) for 2-letter codes.
  → Added toAzureLocale() with 28-language mapping table (en→en-US, pt→pt-BR, etc.)
  → Exported for testing; falls back to code-CODE for unmapped languages.

BUG 2: model field from request schema was silently dropped after provider refactor.
  → Added optional model field to TranscriptionInput interface.
  → OpenAI provider now uses input.model override (falls back to config.model).
  → Route passes model through to provider.transcribe().

GAP 4: SUPPORTED_AUDIO_TYPES was defined but never validated against.
  → Route now rejects unsupported content-types with a clear error message.
  → Allows application/octet-stream (Azure Blob SAS URLs often return this).

GAP 5: Client JSDoc still said 'via OpenAI Whisper API' — now 'via configured STT provider'.

GAP 8: Azure WAV content-type hardcoded samplerate=16000 — now generic audio/wav.

Tests: 42 transcription tests (was 35), 178 total passing.
  → toAzureLocale: 4 tests (locale mapping, passthrough, fallback, case-insensitive)
  → setSTT: 1 test (singleton override)
  → model passthrough: 2 tests (mock ignores, input accepts)
2026-04-06 11:40:27 -07:00