Commit Graph

1274 Commits

Author SHA1 Message Date
4fd6b68747 docs(audit): record broadcast-client lint cleanup
Record the broadcast-client warning cleanup hash and latest lint baseline.

Refs: docs/AUDIT_PLATFORM.md section W and docs/AUDIT_WARNING_COMPLETION_CHECKLIST.md W6.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
2026-05-04 16:08:03 -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
f2ca2ed86f docs(audit): mark tracker warning cleanup
What changed:
- Recorded tracker-web cleanup commit 04d2398.
- Updated W7 checklist items, warning delta, and verification commands.
- Captured the serialized post-push typecheck rerun after a parallel build collision.

Warning impact:
- Workspace lint warning count recorded as 95 -> 90.

Verification:
- pnpm --filter @bytelyst/tracker-web typecheck
- pnpm --filter @bytelyst/tracker-web test
- pnpm --filter @bytelyst/tracker-web exec eslint . --ext .ts,.tsx
- pnpm --filter @bytelyst/tracker-web build
- pnpm lint
2026-05-04 16:02:18 -07:00
bb5eeb2a05 docs(audit): mark admin feedback warning cleanup
What changed:

- Recorded admin-web feedback warning cleanup commit db4257f.

- Marked the four feedback W2 checklist items and admin-web scoped gates.

Warning impact:

- Feedback page warnings: 7 -> 0.

- Admin-web warnings: 23 -> 16.

Verification:

- pnpm --filter @bytelyst/admin-web typecheck

- pnpm --filter @bytelyst/admin-web test

- pnpm --filter @bytelyst/admin-web exec eslint . --ext .ts,.tsx

- pnpm lint
2026-05-04 16:01:46 -07:00
e8d762a6eb docs(audit): mark predictive typing cleanup
What changed:
- Marked W4 predictive analytics typing cleanup complete.
- Recorded commit 021f053 and the workspace warning delta.

Warning impact:
- Documentation only; records 189 -> 184 warnings from 021f053.

Verification:
- pnpm --filter @lysnrai/platform-service build
- pnpm --filter @lysnrai/platform-service test
- pnpm --filter @lysnrai/platform-service exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 16:00:46 -07:00
04d239848e chore(tracker-web): clear roadmap lint warnings
What changed:
- Replaced roadmap console error calls with page-level error state.
- Removed the stale eslint.config.js now that eslint.config.mjs is present.

Warning impact:
- @bytelyst/tracker-web scoped lint: 2 warnings + module warning -> 0 warnings.
- Workspace lint: 95 -> 90 warnings.

Verification:
- pnpm --filter @bytelyst/tracker-web typecheck
- pnpm --filter @bytelyst/tracker-web test
- pnpm --filter @bytelyst/tracker-web exec eslint . --ext .ts,.tsx
- pnpm --filter @bytelyst/tracker-web build
- pnpm lint
2026-05-04 15:59:15 -07:00
db4257fd76 chore(admin-web): clear feedback warnings
What changed:

- Removed unused feedback router import and unused catch bindings.

- Wrapped feedback loading in useCallback to satisfy hook dependencies.

- Replaced screenshot lightbox img with unoptimized Next Image.

Warning impact:

- dashboards/admin-web feedback page: 7 warnings -> 0 warnings.

- Workspace lint warning lines: 191 -> 176 in /tmp/lint-before-agent-a.log and /tmp/lint-after-fix-agent-a.log.

Verification:

- pnpm --filter @bytelyst/admin-web typecheck

- pnpm --filter @bytelyst/admin-web test

- pnpm --filter @bytelyst/admin-web exec eslint . --ext .ts,.tsx

- pnpm lint
2026-05-04 15:58:49 -07:00
021f053143 chore(platform): type predictive campaign events
What changed:
- Replaced predictive campaign-engine event-bus any casts with typed bus.emit calls.
- Preserved existing fire-and-forget event dispatch behavior with void emit calls.

Warning impact:
- services/platform-service/src/modules/predictive-analytics/campaign-engine.ts: no-explicit-any 5 -> 0.
- Workspace lint baseline: 189 warnings -> 184 warnings.

Verification:
- pnpm --filter @lysnrai/platform-service build
- pnpm --filter @lysnrai/platform-service exec eslint src/modules/predictive-analytics/campaign-engine.ts
- pnpm --filter @lysnrai/platform-service test
- pnpm --filter @lysnrai/platform-service exec eslint . --ext .ts,.tsx
- pnpm lint
2026-05-04 15:58:44 -07:00
437a0fed5a docs(audit): add agent checklist workflow
Extend the warning completion checklist with a repeatable agent protocol, claim table, commit/update format, stop conditions, and up to three safe parallel workstream prompts.
2026-05-04 15:51:48 -07:00
af893c23be docs(audit): add warning completion checklist
Add a detailed checklist for finishing the post-P-sweep quality work, including warning taxonomy, package workstreams, gates, done criteria, remaining task areas, and progress tracking.
2026-05-04 15:36:16 -07:00
6978ddb209 chore(cowork-service): type test doubles
Replace cowork-service test any casts with structural test doubles for IPC bridges, Fastify request payloads, and private IPC bridge probes.

Verification: pnpm --filter @lysnrai/cowork-service build; pnpm --filter @lysnrai/cowork-service test; pnpm --filter @lysnrai/cowork-service exec eslint . --ext .ts,.tsx; pnpm lint.
2026-05-04 15:25:43 -07:00
9625999ad4 chore(platform-service): remove stale lint disables
Drop unused eslint-disable comments now that the ignored destructured names use the underscore convention.

Verification: pnpm --filter @lysnrai/platform-service build; pnpm --filter @lysnrai/platform-service exec vitest run src/lib/declarative-loader.test.ts --pool forks; pnpm --filter @lysnrai/platform-service exec eslint src/lib/declarative-loader.test.ts --ext .ts,.tsx; pnpm lint.
2026-05-04 15:22:37 -07:00
b6da94dd4a chore(tracker-web): type proxy test request
Replace the tracker proxy test helper's any cast with an explicit NextRequest test double bridge.

Verification: pnpm --filter @bytelyst/tracker-web typecheck; pnpm --filter @bytelyst/tracker-web test; pnpm --filter @bytelyst/tracker-web exec eslint . --ext .ts,.tsx; pnpm lint.
2026-05-04 15:20:50 -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
41af641c54 docs(audit): refresh platform handoff state
Update the platform audit handoff and resume prompt to match the live gates: install, typecheck, test, and lint now pass with 0 lint errors when GITEA_NPM_TOKEN is exported after sourcing ~/.zshrc.

Refs: docs/AUDIT_PLATFORM.md section P.
2026-05-04 15:09:42 -07:00
1f5dc1a812 docs: add CODEX_RESUME_PROMPT.md for platform-side agent hand-off
Mirror of the trading repo's resume prompt but anchored on the
platform-side audit work. Any agent (Codex, Claude, Gemini, etc.)
running on this machine can paste in the short prompt at the bottom of
this file and self-bootstrap from the full brief above.

Brief covers:
  - Required reads (HANDOVER.md + AUDIT_PLATFORM.md, optionally the
    trading repo's HANDOVER for cross-repo context)
  - Environment (source ~/.zshrc for GITEA_NPM_TOKEN — without it pnpm
    install -r fails on the private @bytelyst/* mobile dep)
  - Verification gates with explicit "error count must go down, never
    up" rule
  - Working-tree state: 3 nomgap WIP files + 1 regenerated lockfile
    that the agent must NOT touch
  - The P-sweep: 85 pre-existing lint errors, broken down by rule, with
    a per-package workflow (one package = one commit) and a suggested
    walking order
  - Commit conventions matching the prior session
    (chore(P-sweep): pnpm --filter <pkg> lint:fix)
  - Seven explicit "do not" rules — the most important being do-not-
    modify the audit's load-bearing eslint config block (`**/*.cjs` +
    `**/scripts/**`) which prevents 45 errors from regressing
  - When-to-stop-and-ask criteria so the agent doesn't blindly delete
    "unused" exports that downstream repos (trading vendor) consume

Refs: docs/HANDOVER.md, docs/AUDIT_PLATFORM.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 14:50:07 -07:00
69a4dc4340 docs: add HANDOVER.md for the platform audit work
Standalone hand-off note pointing the next contributor at:
  - Current health snapshot (install/typecheck/test , lint runs but
    85 pre-existing errors surfaced)
  - The .npmrc / GITEA_NPM_TOKEN requirement (without it nothing installs)
  - Three uncommitted nomgap-WIP files in the working tree that the audit
    intentionally left alone (out of scope, missing context)
  - The audit doc (docs/AUDIT_PLATFORM.md) as the source of truth for
    open vs done items
  - Suggested next steps (per-package `pnpm --filter <pkg> lint:fix`
    sweeps, owned by package maintainers)
  - Backup branch reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 14:23:36 -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
46a16f06bc docs(roadmaps): detailed 2026-04-17 plans for event bus, RAG, agent runtime, approval queue
Four grounded roadmaps superseding the scaffolded versions with
current-state audits, data models, week-by-week phase plans, tech-stack
decisions, and acceptance checklists. Execution order:
Event Bus (P0) unlocks Agent Runtime + RAG (P1 parallel), which unlock
Approval Queue (P1).
2026-04-17 09:36:44 -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
dda74c2d20 feat(cowork-service): POST /api/plugins/reload
Hot-reload the orchestrator's on-disk plugin registry without a
restart. Routes to the reload_plugins Rust IPC method, gated by the
same authz the orchestrator enforces (admin role OR platform-signed
JWT) so a forbidden caller gets a canonical ForbiddenError envelope
instead of a raw IPC error passthrough. The response body is a
ReloadStats { loaded, added, removed, updated, errors } summary,
validated against ReloadResponseSchema before being returned to the
caller.

Tests cover: admin success (200 + envelope), user-without-platform
(403 before IPC), bridge unavailable (400), orchestrator -32003 →
ForbiddenError, other IPC errors → BadRequestError, malformed
orchestrator payloads → BadRequestError.

Phase: 3.1
Verified: pnpm -r typecheck, pnpm --filter @lysnrai/cowork-service {lint,build,test}
(140 passed, 6 new reload tests)
2026-04-16 15:45:42 -07:00
saravanakumardb1
756f5ef56b fix(pnpm): refresh pnpm-lock.yaml to match all committed package.jsons
Baseline pnpm-lock.yaml on origin/main was missing entries for
packages/billing-client and packages/webhook-dispatch (their
package.json files list typescript + vitest devDependencies that the
lockfile didn't reflect). Any pnpm install --frozen-lockfile — in CI,
in services/platform-service/Dockerfile, in services/mcp-server/Dockerfile,
in services/extraction-service/Dockerfile — therefore failed with
ERR_PNPM_OUTDATED_LOCKFILE.

Ran pnpm install which regenerated the lockfile deterministically; the
net diff cleans up a large amount of stale phantom entries while adding
the two missing package entries. After the refresh,
pnpm install --frozen-lockfile succeeds.

This is W1 baseline-repair scope (similar to commit a954f434 for lint).
It does NOT fully restore the full-stack docker compose smoke because
services/platform-service/Dockerfile also has a separate pre-existing
bug: @bytelyst/react-native-platform-sdk runs `tsc` in its prepare
script, but pnpm install runs prepare scripts before the Dockerfile
COPY packages/ step brings in source — so tsc has nothing to compile
and fails. That Dockerfile is outside W1's Files-You-Own and needs
a separate fix (either remove/no-op the prepare script, use pnpm
install --ignore-scripts, or COPY source before install).

Gap: none (baseline repair supporting INFRA-gap-01)
Verified: pnpm install --frozen-lockfile (clean), pnpm -r typecheck /
          lint / build / test (all green), docker compose build
          cowork-service + docker compose up -d cowork-service --wait
          (still Healthy), curl localhost:4009/health (200 OK).
2026-04-16 13:58:36 -07:00
saravanakumardb1
b92aee729f feat(docker): INFRA-gap-01 wire cowork-service into compose stack
Adds cowork-service (port 4009) to docker-compose.yml with healthcheck,
depends_on gates for cosmos-emulator and platform-service, env_file
integration, and Traefik labels. Unblocks Phase 3 ecosystem wiring of
the ByteLyst roadmap.

Also adds the services/cowork-service/Dockerfile that compose builds
from. Pattern mirrors services/mcp-server/Dockerfile but copies the
full workspace in one step rather than enumerating every package.json,
to stay resilient to workspace membership changes. Production stage
runs `node dist/server.js` on :4009 with BusyBox-wget healthcheck
(bundled with node:22-alpine — no apk install required).

.env.example gains a Cowork-Service section documenting:
- ANTHROPIC_API_KEY, RUST_RUNTIME_BIN, RUST_RUNTIME_TIMEOUT_MS
- OLLAMA_URL, OLLAMA_MODELS
- FEATURE_FLAGS_ENABLED
The 13th clawcowork flag telemetry_enabled already ships via COMMON_FLAGS
in services/platform-service/src/modules/flags/seed.ts so seed.ts was not
touched.

Gap: INFRA-gap-01
Verified: docker compose config (YAML validity + env substitution),
          pnpm -r typecheck / lint / build / test (all green),
          docker compose build cowork-service (image built),
          docker compose up -d cowork-service --no-deps --wait (Healthy),
          curl -fsS localhost:4009/health → {"status":"ok","service":"cowork-service",...}.

Note: full-stack `docker compose up cosmos-emulator platform-service
cowork-service --wait` is blocked by a pre-existing issue in
services/platform-service/Dockerfile (react-native-platform-sdk prepare
script fails during pnpm install --frozen-lockfile in the image build).
That is outside W1 scope; cowork-service starts clean on its own and
becomes Healthy when platform-service is available out-of-band.
2026-04-16 13:07:11 -07:00
saravanakumardb1
a954f434ef fix(lint): repair pre-existing baseline lint errors blocking W1 gates
Baseline origin/main pnpm -r lint failed with 90+ errors across
platform-service, extraction-service, and tracker-web. These block the
shared W1 quality gates (prompts/README.md §4) which require all of
typecheck + lint + build + test to be green before committing W1 infra
work. Fixes are strictly scoped to unblock gates:

- eslint.config.js: extend @typescript-eslint/no-unused-vars with
  varsIgnorePattern / caughtErrorsIgnorePattern / destructuredArrayIgnorePattern
  all honouring the existing `^_` convention already used for args.
- platform-service: add file-level eslint-disable for
  @typescript-eslint/no-unused-vars, no-redeclare, no-useless-escape on
  the 33 legacy files failing lint (ab-testing, ai-diagnostics,
  diagnostics, predictive-analytics, broadcasts/types, surveys/types,
  lib/push-notifications).
- extraction-service tests: drop unused vitest imports (beforeEach,
  afterEach, HealthCheck).
- tracker-web tracker-proxy.test.ts: prefix unused url with _.
- Applied eslint --fix on platform-service which normalised a handful
  of `let` → `const` and removed one redundant disable comment.

Scope creep vs W1 "Files You Own" is acknowledged — user explicitly
approved this path when baseline rot was surfaced.

Verified: pnpm -r typecheck, lint, build, test all green.
2026-04-16 13:06:37 -07:00
saravanakumardb1
17ddd086e7 docs(agents): add .npmrc canonical template rule to AGENTS.md
Never edit .npmrc directly in product repos — managed by
canonical template in learning_ai_common_plat/scripts/npmrc.template.
Use sync-npmrc.sh to propagate. Prevents gitea.bytelyst.com hardcoding.
2026-04-14 11:57:21 -07:00
saravanakumardb1
01cc5b35a4 feat(scripts): add .npmrc template + sync/drift-check scripts (DRY)
Single source of truth: scripts/npmrc.template
- sync-npmrc.sh: copies template to all 13 product repos
- check-npmrc-drift.sh: detects drift (exit 1 if any repo drifted)

Also synced 4 drifted repos: MindLyst, NoteLett, ActionTrail, Talk2Obs.
Prevents future gitea.bytelyst.com hardcoding issues.
2026-04-14 11:48:55 -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
a107b2e342 fix: standardize common-plat .npmrc + publish script for corp network
- .npmrc: use ${GITEA_NPM_HOST:-localhost}:3300 (was hardcoded gitea.bytelyst.com)
- publish-local-packages.sh: use ${GITEA_NPM_HOST:-localhost}:3300 fallback
- fix-npmrc-all-repos.sh: add common-plat to repo list, skip self for
  workspace link, add nested .npmrc scanning (e.g. dashboard/.npmrc)
2026-04-13 10:51:12 -07:00
saravanakumardb1
7208506412 chore(scripts): add fix-npmrc-all-repos.sh for cross-repo registry standardization
Replaces hardcoded gitea.bytelyst.com URLs with env-var-based
${GITEA_NPM_HOST:-localhost}:3300 and adds common-plat workspace
links. Supports dry-run and --apply modes.

Addresses recurring TLS proxy failures on corp network.
2026-04-13 10:34:07 -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
85bb860382 fix(gitea): fix publish auth — scoped registry + proxy=false in .npmrc
Root causes found:
1. publishConfig.registry in each package.json overrides --registry CLI
   flag, causing npm to hit gitea.bytelyst.com through corp proxy.
2. Global ~/.npmrc proxy settings (NPM_CONFIG_PROXY env vars) route
   localhost:3300 through the corporate proxy.
3. No .npmrc with auth token was created for npm publish to use.

Fix: generate a proper .npmrc in WORK_DIR with:
- _authToken for registry auth
- @bytelyst:registry scoped override (bypasses publishConfig)
- proxy=false + https-proxy=false on corp network
- Unified corp/home publish path (both use same .npmrc)

Token scope issue still open: current GITEA_NPM_TOKEN has read:package
but not write:package — needs regeneration in Gitea UI.
2026-04-13 00:21:13 -07:00
saravanakumardb1
54a06e227a refactor(scripts): move 5 Gitea scripts into scripts/gitea/ subdirectory
Moved:
  publish-local-gitea-packages.sh  → gitea/publish-local-packages.sh
  publish-outdated-gitea-packages.sh → gitea/publish-outdated-packages.sh
  release-gitea-packages.sh        → gitea/release-packages.sh
  run-registry-tests.sh            → gitea/run-registry-tests.sh
  harden-publish-config.sh         → gitea/harden-publish-config.sh

Dropped -gitea- infix (redundant with folder name).

Fixed in every moved script:
- REPO_ROOT: ../ → ../../ (one level deeper)
- Internal cross-reference comments

Updated all 10 referencing files:
- package.json (release script path)
- .gitea/workflows/ci.yml (publish step)
- 3 workflow .md files (publish-outdated usage)
- 3 devops docs (publish-local + registry-tests refs)
- 2 internal comment cross-references
2026-04-13 00:02:55 -07:00
saravanakumardb1
97c0ad9554 fix(scripts): add NETWORK-aware registry resolution to release script
release.sh → release-gitea-packages.sh:

1. Renamed to clearly describe purpose (Gitea npm package release, not
   a generic release script).

2. Added NETWORK=corp/home detection matching publish-outdated-gitea-
   packages.sh pattern:
   - corp: localhost:3300 SSH tunnel + proxy env var stripping
   - home: Azure VM directly via gitea.bytelyst.com or ~/.gitea_vm_host

3. Added ~/.gitea_npm_token file fallback (same as sibling scripts).

4. Corp publishes now strip HTTP_PROXY/HTTPS_PROXY/npm_config_proxy
   env vars so npm reaches localhost tunnel directly instead of going
   through the corporate proxy (which can't reach the tunnel).

5. Updated package.json 'release' script reference.
2026-04-12 23:56:19 -07:00
saravanakumardb1
9db3967fe1 ci: update CI/CD configuration 2026-04-12 23:51:10 -07:00
root
a7679de295 fix(release): reliable auth, per-package progress logs, clean commits
- Use shared ~/.npmrc via --userconfig for all npm view + publish calls
  (inline --// flags are unreliable on npm v10+ for writes)
- Verify registry credentials upfront before any work begins
- Log each package status inline as scan runs (✓/⊘/→/✗) grouped by workspace
- Suppress noisy npm notice / pnpm progress output; surface only errors
- Move FAILED to its own tracked array; exit non-zero if any publish fails
- Restrict release commits to package.json / pnpm-lock.yaml / .changeset
  (prevents node-compile-cache and other generated dirs being committed)
- Fix pagination bug in registry comparison (was only checking 50 packages)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 05:44:47 +00:00
root
4a0ceb17e3 chore: release version bumps [skip ci] 2026-04-13 05:00:19 +00: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
85d8cef110 docs: expand Docker build corporate proxy workarounds
- AGENTS.md § 9: add 'Docker builds behind corporate proxy' subsection
  with Alpine/corepack/strict-ssl/NODE_TLS rules
- dual-network-setup.md: replace one-liner Docker section with full
  workaround table, recommended Dockerfile pattern, and key rules
2026-04-10 16:00:12 -07: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
saravanakumardb1
a77b3ff931 refactor(extraction-service): provider-agnostic transcription — OpenAI + Azure Speech + Mock
- TranscriptionProvider interface with transcribe() + isConfigured()
- OpenAITranscriptionProvider: Whisper API (existing behavior)
- AzureTranscriptionProvider: Azure Speech REST API for short audio
- MockTranscriptionProvider: deterministic results for testing
- Factory: getSTT() singleton with env-driven auto-detection
  - STT_PROVIDER=openai|azure|mock (explicit)
  - Auto-detect: AZURE_SPEECH_KEY → azure, OPENAI_API_KEY → openai, else mock
- Config: add STT_PROVIDER, AZURE_SPEECH_KEY, AZURE_SPEECH_REGION env vars
- Route refactored: audio download (common) → provider.transcribe() (swappable)
- deriveFilename() extracted to types.ts (shared by route + providers)
- 35 transcription tests (was 12), 171 total passing
- Follows same pattern as @bytelyst/llm provider abstraction
2026-04-06 11:30:22 -07:00
saravanakumardb1
f8e15880d2 feat(extraction): add transcribe() to ExtractionClient — reusable speech-to-text client
- TranscribeRequest/TranscribeResponse types exported from @bytelyst/extraction
- transcribe() method on ExtractionClient calls POST /api/transcribe
- 3 new client tests (correct body, optional fields, error propagation)
- Package test count: 16 → 19
2026-04-06 11:11:17 -07:00