Skip to content

Sync: @huggingface/transformers v4 migration + release 0.9.30-chronode.4 - #13

Merged
ChronodeAi merged 6 commits into
mainfrom
sync/transformers-v4
Aug 25, 2026
Merged

Sync: @huggingface/transformers v4 migration + release 0.9.30-chronode.4#13
ChronodeAi merged 6 commits into
mainfrom
sync/transformers-v4

Conversation

@ChronodeAi

Copy link
Copy Markdown
Owner

Summary

Ports upstream rohitg00/agentmemory 8c90741 (rohitg00#1096) onto the Chronode fork and ships release 0.9.30-chronode.4.

Port

  • @xenova/transformers ^2.17.2 → @huggingface/transformers ^4.2.0 (optionalDependencies). onnxruntime-node/onnxruntime-web dropped from direct declaration — they ship transitively with v4. Lockfile regenerated via npm install.
  • src/providers/embedding/local.ts, src/providers/embedding/clip.ts, src/state/reranker.ts: import specifiers updated; module typed as typeof import("@huggingface/transformers"); explicit { dtype: "q8" } at all pipeline call sites (v4 defaults to fp32 on Node — without this, downloads grow ~3.5x); import try/catch split so model-load/network errors propagate their real message instead of the generic install hint. Fork's processingLocation provider field preserved.
  • src/xenova.d.ts deleted (v4 ships its own types); fork-local reranker pipeline cast (needed only for the old stub) removed. Manual mock added at __mocks__/@huggingface/transformers.ts for missing-package tests.
  • New regression tests: local-embedding-provider (3), clip-embedding-provider (5), env-guarded real-model smoke (RUN_HF_SMOKE=1, skipped by default), plus a vi.doMock positive path in reranker. ci/r13-test-manifest.json restamped 176 → 179 files.
  • CI matrix [20, 22][20, 22, 24, 26]; specifier/prose swaps across README, 11 README translations, SECURITY.md, benchmark docs + script.

⚠️ Model cache re-download (one-time)

The v4 package resolves its model cache inside its own directory (node_modules/@huggingface/transformers/.cache/) instead of xenova's. Local embeddings re-download once (~23 MB q8) on first use after upgrade, then cache as before. Documented in CHANGELOG.

Verification battery (all green)

  1. Embedding smoke: real Xenova/all-MiniLM-L6-v2 load through v4 produced a 384-dim finite vector (~9.6 s incl. download); also executed inside the R-13 gate via RUN_HF_SMOKE=1.
  2. npx vitest run: 1951 passed / 0 failures; only the 3 known file-level suite errors identical to base (integration secret gate; two node:test .mjs suites vitest cannot load).
  3. tsc: error set unchanged vs baseline (transport socket-union, tools-registry pattern/items, coding-memory TS6133) — nothing new; the two stale @xenova TS2307s are gone.
  4. R-13: full canonical gate AGENTMEMORY_SECRET=dummy AGENTMEMORY_PROJECT_CAPABILITY_SECRET=dummy node scripts/r13/run.mjsR-13 passed (receipt 1787689621784-0-675b0486, zero skips).
  5. evidence:interfaces:test pass + skills:check green; inventory refreshed at the release commit; plugin bundles rebuilt (standalone.mjs version stamp).

…ation

Ports rohitg00/agentmemory@8c90741 onto the Chronode fork:

- @xenova/transformers ^2.17.2 -> @huggingface/transformers ^4.2.0
  (optionalDependencies; onnxruntime-node/web now transitively provided).
- src/providers/embedding/{local,clip}.ts: import specifiers, module typed
  as typeof import("@huggingface/transformers"), explicit { dtype: "q8" }
  at all pipeline call sites (v4 defaults to fp32 on Node), split
  import try/catch so model-load errors propagate unmasked. Fork's
  processingLocation field preserved.
- src/state/reranker.ts: specifier + { dtype: "q8" }; drops the fork-local
  pipeline cast that existed only to satisfy the removed xenova.d.ts stub.
- src/xenova.d.ts deleted; __mocks__/@huggingface/transformers.ts manual
  mock added for missing-package tests.
- New tests: local-embedding-provider (3), clip-embedding-provider (5),
  env-guarded local-embedding-smoke (RUN_HF_SMOKE=1); reranker gains a
  doMock positive path. ci/r13-test-manifest.json restamped 176 -> 179.
- CI matrix [20,22] -> [20,22,24,26]; docs/specifier swaps across README,
  11 README translations, SECURITY.md, benchmark docs + script.
- Release 0.9.30-chronode.4; CHANGELOG documents the one-time local
  embedding model re-download caused by the v4 cache-dir change.
…, Node 26 profile

First CI round on the expanded matrix exposed three fork-side gaps:

- integrations/filesystem-watcher: fs.watch on Node >= 23 Linux reports a
  missing root via the async handle 'error' event instead of throwing
  synchronously, so start() silently attached nothing and the
  "could not watch any of the configured roots" contract never fired.
  An explicit existsSync check before attach makes it deterministic;
  @agentmemory/fs-watcher 0.1.1 -> 0.1.2.
- CI: run npm test with RUN_HF_SMOKE=1 — the R-13 gate treats any skipped
  test as failure, and upstream's env-guarded real-model embedding smoke
  skips by default.
- scripts/r13/lib.mjs: promote Node 26 to an accepted R-13 profile so
  matrix cells produce clean pass receipts (--require-pass rejects
  provisional-pass waivers); harness self-test updated with the new
  declared-profile table (v26 accepted, v27 rejected).
Sequential forks hand off between test files: an exiting worker can still
be visible in a single 250ms telemetry sample while the next file's worker
starts (native modules like onnxruntime delay teardown once loaded). The
sampler now flags peak concurrency only when >1 worker persists across
consecutive samples; a real maxWorkers>1 misconfiguration stays flagged.
@ChronodeAi
ChronodeAi merged commit 05b08ff into main Aug 25, 2026
8 checks passed
@ChronodeAi
ChronodeAi deleted the sync/transformers-v4 branch August 25, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant