Commit Graph

11 Commits

Author SHA1 Message Date
saravanakumardb1
dd90f709e1 fix(gitea): set ROOT_URL=host.docker.internal, NO_PROXY for host (F17)
Resolves F17 in docker-build-optimization-roadmap.

Root cause:
  Gitea's app.ini ROOT_URL was http://localhost:3300/. Gitea bakes
  ROOT_URL into the dist.tarball field of every published package's
  metadata. Inside a Docker container, 'localhost' is the container
  itself, not the host \u2014 so any 'pnpm install' that needed to fetch
  a tarball would ECONNREFUSED, even though the registry metadata
  itself was reachable via host.docker.internal.

Server-side fix (not in git, requires manual replication on each dev
machine; documented in roadmap \u00a73 A-pre-6):
  - Edit /opt/homebrew/var/gitea/custom/conf/app.ini:
    ROOT_URL = http://host.docker.internal:3300/
  - brew services restart gitea
  - sudo sh -c 'echo "127.0.0.1 host.docker.internal" >> /etc/hosts'

Repo-side fix (this commit):
  - switch-network.sh: add host.docker.internal to NO_PROXY +
    NPM_CONFIG_NOPROXY when NETWORK=corp. Required so host-side curl/
    pnpm/npm bypass the corporate proxy (cso.proxy.att.com) when
    resolving host.docker.internal. Without this, host installs fail
    with the corp proxy's 'Unknown Host' 504 page.

Republished all 64 @bytelyst/* packages so tarball URLs reflect the
new ROOT_URL:
  - .publish-manifest.json: 64 entries with new content hashes
  - packages/*/package.json: 64 patch-version bumps
    (auto-bumped by publish-outdated-packages.sh because previous
    versions already existed in registry)

Verification:
  curl http://localhost:3300/.../@bytelyst%2Ferrors | jq .dist.tarball
  → http://host.docker.internal:3300/.../errors-0.1.11.tgz  (was localhost:3300)
  workspace:* refs across all 64 packages: 0

Unblocks: A0-V on every pilot. Verified PASSING on learning_ai_clock:
  backend cold build: 59.2 s
  web cold build:     3:13 (193 s)
  Both via Gitea registry, no docker-prep.sh tarballs needed.
2026-05-27 01:51:43 -07:00
saravanakumardb1
cfcfc7bb90 fix(gitea): rewrite workspace:* in published tarballs (F16)
Resolves F16 in docker-build-optimization-roadmap v5.

Root cause:
  publish-outdated-packages.sh uses a pack-extract-repack pattern:
    1. pnpm pack (rewrites workspace:* in tarball)
    2. extract
    3. npm pack (re-tar from extracted content)
    4. npm publish

  Step 3 is the bug. npm pack does not recognize the pnpm-specific
  workspace: protocol — it treats workspace:* as a literal version
  string and passes it through to the final tarball. Result: any
  consumer doing 'pnpm install' inside Docker (where there is no
  workspace context) fails with ERR_PNPM_WORKSPACE_PKG_NOT_FOUND.

  Documented in roadmap §0 F16 + §3 Phase A-pre.

Fix (publish-outdated-packages.sh):
  - Insert a workspace:* rewriter between publishConfig strip and
    npm pack. Reads source package.json for each @bytelyst/* target,
    resolves workspace:* / workspace:^ / workspace:~ to ^x.y.z.
  - Add defense-in-depth: grep the post-rewrite package.json for any
    surviving 'workspace:' literal. If found, refuse to publish.

Republished 10 affected packages with workspace:* → resolved semver:
  @bytelyst/auth                0.1.5 → 0.1.6
  @bytelyst/diagnostics-client  0.1.6 → 0.1.7
  @bytelyst/events              0.1.5 → 0.1.6
  @bytelyst/extraction          0.1.5 → 0.1.6
  @bytelyst/fastify-auth        0.1.5 → 0.1.6
  @bytelyst/fastify-core        0.1.5 → 0.1.6
  @bytelyst/feedback-client     0.1.6 → 0.1.7
  @bytelyst/field-encrypt       0.1.6 → 0.1.7
  @bytelyst/react-auth          0.1.6 → 0.1.7
  @bytelyst/sync                0.1.5 → 0.1.6

Verification: all 10 packages now scan with 0 workspace:* refs in
their published package.json (per registry curl scan).

Unblocks: A0-V verification on learning_ai_clock (currently blocked
at learning_ai_clock@0be887288).
2026-05-27 01:29:29 -07:00
aad91f3b9d chore: remove embedded Gitea package registry 2026-05-08 21:10:03 -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
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
root
8b37189829 chore(registry): point packages to gitea.bytelyst.com 2026-03-31 10:53:13 +00:00
saravanakumardb1
46ee14371c fix(ci): add --pool forks to all vitest test scripts to fix kill EPERM on Node v25
Root cause: tinypool worker teardown calls kill() which returns EPERM
in the act_runner host environment on Node.js v25.2.1. Tests pass but
the vitest process crashes during cleanup, causing CI failure.

Fix: --pool forks CLI flag on every package/service test script, plus
pool: 'forks' in all vitest.config.ts files. This uses child_process.fork()
worker management which handles termination cleanly.

60 package.json files updated, 10 vitest.config.ts files updated.
2026-03-27 23:23:38 -07:00
saravanakumardb1
b6348fd4fe fix(security): harden npm publish — add .npmrc + publishConfig to all 57 packages
- Created .npmrc with @bytelyst scoped registry pointing to local Gitea
- Added publishConfig.registry to all 57 @bytelyst/* package.json files
- Created scripts/harden-publish-config.sh for future re-runs
- Prevents accidental publish to npmjs.org or corporate JFrog registry
2026-03-26 21:51:05 -07:00
saravanakumardb1
b33d3cf2b3 feat(platform): add webhook subscriptions module, DB migration runner, Swagger UI — complete 23/25 roadmap items 2026-03-01 23:38:48 -08:00
saravanakumardb1
63c08dbb0a refactor(services): integrate @bytelyst/fastify-core into all 4 services
Replaced duplicated server setup code with createServiceApp() factory:
- platform-service: 91 → 39 lines
- billing-service: 105 → 51 lines (keeps service-specific internal key auth)
- growth-service: 83 → 33 lines
- tracker-service: 88 → 36 lines

Enhanced fastify-core with optional Swagger + Prometheus metrics support.
Total reduction: ~208 lines of duplicated boilerplate eliminated.
All 246 tests pass.
2026-02-12 22:53:22 -08:00
saravanakumardb1
832eccafed feat: add package tests (58 new) + @bytelyst/fastify-core package
Package tests added:
- @bytelyst/cosmos: 12 tests (client singleton, env vars, container registry)
- @bytelyst/config: 15 tests (base schema, loadConfig, product identity)
- @bytelyst/auth: 10 tests (JWT round-trip, password hash/verify)
- @bytelyst/api-client: 10 tests (fetch, safeFetch, auth injection)
- @bytelyst/design-tokens: 11 tests (loadTokens, generated file checks)

New package:
- @bytelyst/fastify-core: 8 tests (createServiceApp factory with CORS,
  x-request-id, health endpoint, ServiceError handler)

Total: 246 tests passing (was 180)
2026-02-12 22:17:17 -08:00