Files
Mert Koseoglu 1b7d7a727f fix(v1.0.133): hotfix v1.0.132 stale bundles + classifyIp + stats bar
v1.0.132 had three cascading bugs:
- CI postinstall hard-fail (#564) blocked its own Linux+Node20 runners → bundle rebuild failed → npm package shipped with v1.0.131-era bundles (source had fixes, runtime didn't)
- ctx_fetch_and_index threw ReferenceError: classifyIp is not defined (esbuild renamed the symbol; embedded SSRF guard called the canonical name)
- ctx_stats per-conversation bar read session_events.LENGTH(data) only (~200 bytes); never queried content DB chunks despite Slice 1 FK plumbing

Fixes:
- .github/workflows/bundle.yml + ci.yml node-version 20 → 22.5 (so CI can install + rebuild bundles)
- src/server.ts buildFetchCode: emit named function expression + var classifyIp = <name> alias so canonical identifier survives bundler rename (root cause at L1940)
- src/session/analytics.ts: new getContentBytesForSession() helper + getRealBytesStats accepts contentDbPath + ctx_stats handler in src/server.ts:2926 passes contentDbPath; per-session bar now sums chunk content bytes via session_id FK (architect-approved render-time read-only join, no time-window backfill)

Bundles included in this commit (CI blocked last time, ensuring npm tarball gets working code).

Tests: 3317 pass / 10 fail (8 OpenCode + 2 lifecycle env) / 29 skipped. Targeted modified-file tests: 540/540 pass.
2026-05-14 21:20:40 +03:00

42 lines
1.1 KiB
YAML

name: Bundle MCP Server & CLI
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'src/**'
- 'package.json'
- 'tsconfig.json'
permissions:
contents: write
jobs:
bundle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.5"
- run: npm install
- run: npx tsc --noEmit
- run: npm run bundle
- name: Assert bundle invariants (G3 — Issue #511 guardrail)
run: npm run assert-bundle
- name: Commit bundle
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -f server.bundle.mjs cli.bundle.mjs hooks/session-extract.bundle.mjs hooks/session-snapshot.bundle.mjs hooks/session-db.bundle.mjs hooks/security.bundle.mjs
git diff --staged --quiet && echo "No changes" && exit 0
git commit -m "ci: update server.bundle.mjs, cli.bundle.mjs, session hook & security bundles"
git push