Commit Graph

19 Commits

Author SHA1 Message Date
saravanakumardb1
7e1a2ad660 feat(gitea): add-host-runner.sh for multi-runner CI parallelism
- scripts/gitea/add-host-runner.sh: stand up Nth independent host-mode runner
  as its own launchd service (separate config/.runner/workdir, shared
  runner.env token, admin-API registration token, idempotent reload)
- GITEA_VM_SETUP.md 11.5: document multi-runner setup, fleet list/prune,
  and removal; 3 runners x capacity 2 ~= 6 parallel slots (verified)

Live fleet: learning-ai-mac (brew) + 2 added runners, all online; stale
offline registrations pruned.
2026-05-28 18:31:57 -07:00
saravanakumardb1
3224199894 feat(gitea): reproducible Actions runner registration + harden runner config
- add scripts/gitea/register-runner.sh (idempotent register, host/docker modes,
  capacity arg, admin-API registration token, --force re-register)
- GITEA_VM_SETUP.md Step 11: runner install/register, host-vs-docker tradeoffs,
  token externalization (env_file), concurrency (capacity), token rotation,
  end-to-end CI verification
- document runner registration + secrets in persist/ephemeral table

Live runner hardened separately: capacity 1->2, GITEA_NPM_TOKEN moved from
inline config.yaml to chmod-600 runner.env via env_file.
2026-05-28 18:05:55 -07:00
saravanakumardb1
a473a45aae chore(packages): bump versions + manifest after publishing 21 packages to Gitea
Published in this run:
  NEW: @bytelyst/charts@0.1.0
  NEW: @bytelyst/customizable-workspace@0.1.0
  NEW: @bytelyst/generative-theme@0.1.0
  NEW: @bytelyst/media-ui@0.1.0
  NEW: @bytelyst/notifications-ui@0.1.0
  NEW: @bytelyst/motion@0.2.1
  NEW: @bytelyst/data-viz@0.1.0 (?)
  CHANGED: @bytelyst/ui @0.2.0
  CHANGED: @bytelyst/auth-ui, broadcast-client, dashboard-components,
           llm-router, survey-client, ai-ui, command-palette,
           dashboard-shell, design-tokens, feature-flag-client,
           kill-switch-client, mcp-client, platform-client

Manifest fingerprint updated for all 21 packages.
2026-05-27 19:13:44 -07:00
root
7312689376 chore: record gitea package backfill 2026-05-27 18:27:43 +00:00
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
saravanakumardb1
678d8df42c feat(gitea): add bootstrap-vm.sh for fresh cloud VM setup
Idempotent end-to-end Gitea bootstrap for Azure VM (or any Linux host
with Docker available). Replaces manual SSH-and-paste workflow.

Steps (each skippable on re-run):
  1. Install Docker via official script (skip with --skip-docker)
  2. Write /etc/gitea/docker-compose.yml with package registry enabled
  3. Start gitea container, wait for HTTP :3300
  4. Create admin user via 'gitea admin user create' (CLI inside container,
     no auth bootstrap needed)
  5. Create npm-user (learning_ai_user) via admin API
  6. Mint npm-scoped token with write:package + read:package

Two execution modes:
  - On the VM directly: scp + ssh + run
  - Locally targeting remote: --ssh-host azureuser@vm

Outputs npm token to --output FILE or stdout. Prints copy-paste-ready
command for writing to ~/.gitea_npm_token_home on the workstation.

Final summary prints the doctor.sh verification command so user can
confirm registry reachability from their laptop in one step.

--dry-run shows planned actions without execution.
--force re-creates users (use after manual deletion).

Closes the 'cloud VM bootstrap' gap identified during the Gitea hardening
review — pairs with scripts/gitea/{doctor,token}.sh from commit 610a59fd.
2026-05-27 01:20:56 -07:00
saravanakumardb1
610a59fdc3 feat(gitea): parameterize owner via GITEA_NPM_OWNER + add doctor/token helpers
Eliminates the three operational pain points hit in the last
owner-rename incident:

1. Owner-rename drift across 14 repos
   - npmrc.template now uses ${GITEA_NPM_OWNER:-learning_ai_user}
   - switch-network.sh exports GITEA_NPM_OWNER on shell start
   - Future renames are a one-line env change, not 14 git commits

2. Stale shell-env tokens (file rotated, env didn't)
   - scripts/gitea/token.sh: status|print|validate|rotate subcommands
   - 'eval "$(bash scripts/gitea/token.sh print --export)"' refreshes
     any shell without re-sourcing ~/.zshrc
   - rotate uses Gitea API + macOS Keychain for admin creds

3. No pre-deploy validation
   - scripts/gitea/doctor.sh: NETWORK + DNS + token consistency +
     registry HTTP 200 + optional package@version probe
   - Run before any deploy that needs @bytelyst/* from Gitea
2026-05-27 00:41:47 -07:00
saravanakumardb1
d1d88db4dd chore(gitea): rename npm package owner ByteLyst -> learning_ai_user 2026-05-26 18:38:57 -07:00
root
9e8d0bd048 ci: add Gitea-compatible package publish modes
All checks were successful
CI — Common Platform / Build, Test & Typecheck (push) Successful in 5m28s
Publish @bytelyst/* packages / publish (push) Successful in 5m54s
2026-05-25 07:25:52 +00:00
saravanakumardb1
47af9f816a chore(packages): publish 4 outdated @bytelyst/* packages to Gitea
Per user request: 'use the local Gitea and make sure all packages
in Gitea are up to date'.

Built all packages from learning_ai_common_plat/packages/* and ran
scripts/gitea/publish-outdated-packages.sh against the local Gitea
npm registry (http://localhost:3300/api/packages/bytelyst/npm/).

Manifest-based hash comparison flagged 4 packages whose built dist/
content has changed since the last published tarball:

  @bytelyst/auth-ui          0.1.5 → 0.1.6
  @bytelyst/config           0.1.7 → 0.1.8
  @bytelyst/dashboard-shell  0.1.5 → 0.1.6
  @bytelyst/mcp-client       0.1.0 → 0.1.1

All four bumped + published successfully. Remaining 60 packages
verified up-to-date. One package skipped by design:
  @bytelyst/react-native-platform-sdk (RN — not in npm publish set)

Also incidentally fixed an mcp-client build break before this run:
stale dist/ + node_modules/.cache made tsc think MCPClient was
missing a 'log' property, even though the source had been correctly
refactored to use a private 'log: McpLogger' field. A clean
'rm -rf dist node_modules/.cache && pnpm build' resolved it; no
source changes needed.

Files updated:
  - packages/auth-ui/package.json
  - packages/config/package.json
  - packages/dashboard-shell/package.json
  - packages/mcp-client/package.json
  - scripts/gitea/.publish-manifest.json  (new content hashes)

After this commit, every published @bytelyst/* tarball in local
Gitea matches the source tree exactly.
2026-05-23 19:16:14 -07:00
saravanakumardb1
2fd49bb5c9 chore(packages): publish @bytelyst/kill-switch-client@0.1.6 to Gitea registry
The Gitea outdated-package detector reported @bytelyst/kill-switch-client
as the only @bytelyst/* package whose local content fingerprint differed
from the version already published to the registry. All other 63
packages in packages/ were UP-TO-DATE.

Publishing details:
  Before:  0.1.5 (registry + local)
  After:   0.1.6 (script auto-bumped patch + published)
  Files:   9 (dist/index.* + package.json), 3.2 kB tarball,
           shasum a9110243046f12be01b16f48f962ab64c0971d80
  Target:  http://localhost:3300/api/packages/bytelyst/npm/ (corp SSH tunnel)

Detected via:
  bash scripts/gitea/publish-outdated-packages.sh --dry-run
    -> Summary: 63 up-to-date, 1 changed, 1 skipped, 0 errors

Published via:
  bash scripts/gitea/publish-outdated-packages.sh \
       --skip-build \
       --filter @bytelyst/kill-switch-client
    -> + @bytelyst/kill-switch-client@0.1.6

Re-verification dry-run after publish:
  -> Summary: 64 up-to-date, 0 changed, 1 skipped, 0 errors
  -> 'All packages are up to date. Nothing to publish.'

This bump touches two files:
  - packages/kill-switch-client/package.json (version 0.1.5 -> 0.1.6)
  - scripts/gitea/.publish-manifest.json (content-hash bookkeeping
    so future dry-runs don't re-flag this version as needing publish)

Used --skip-build because 'pnpm build' would have tried to build
services/platform-service, which currently has 3 unrelated TS errors
(missing @bytelyst/devops/server module + 2 ProductIdentity property
mismatches). Built only @bytelyst/* packages via
'pnpm --filter ./packages/** build' first (all 65 packages built
clean) and then ran the publisher with --skip-build.
2026-05-23 12:32:49 -07:00
saravanakumardb1
50db3ea621 chore(packages): bump versions for Gitea registry publish 2026-05-23 10:17:42 -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
b6562b1de4 fix(ci): correct Gitea org name ByteLyst -> bytelyst in publish scripts
Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 02:23:15 +00: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
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
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