ruvnet / ruvnet/agentic-flow

npm run build fails with 12 TS errors and emits no dist/, but the published build script wraps every stage in || true

Open
#183 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
812
Forks
175
Avg merge
2m
Merged PRs (30d)
3

Description

Summary

npm run build fails in a clean clone with 12 TypeScript errors and produces no dist/. The published package's build script differs from the repo's and wraps every stage in || true, so those errors are swallowed and a partial dist/ is shipped. This looks like the common cause behind a set of runtime symptoms reported separately (#182).

Reproduction

git clone --depth 1 https://github.com/ruvnet/agentic-flow.git && cd agentic-flow
npm install     # ok — 1246 packages
npm run build   # exit 2, no dist/ produced

Errors fall into four groups:

src/harness/metaharness.ts(10-13): error TS2614: Module '"ruvector"' has no exported member
    'runMetaHarnessDarwin' / 'runMetaHarnessFlywheel' /
    'scanMetaHarnessRewardHacks' / 'verifyMetaHarnessReplay'
src/reasoningbank/utils/embeddings.ts(6,31): error TS2307: Cannot find module '@huggingface/transformers'
src/services/embedding-service.ts(205,41):  error TS2307: Cannot find module '@huggingface/transformers'
src/utils/model-cache.ts(216,41):           error TS2307: Cannot find module '@huggingface/transformers'
src/router/cost-optimal-router.ts(18,64):   error TS2307: Cannot find module '@metaharness/router'
src/router/router.ts(410-411): error TS2339: Property 'id' / 'predictedQuality' /
    'costPerMTok' / 'metBar' does not exist on type 'CostOptimalDecision'

@huggingface/transformers and @metaharness/router are imported but not declared as dependencies.

The build-script divergence

repo package.json:       "build": "npm run build:main && npm run build:packages"
published package.json:  "build": "(npm run build:wasm || true) && (tsc -p config/tsconfig.json --skipLibCheck || true) && …"

The published variant cannot fail: every stage is || true and tsc runs with --skipLibCheck. So the artifact on npm is whatever partial output survived a compile that errored.

Consistent runtime symptoms

These are what a partial dist/ would produce, and all are observable in the published 2.1.0:

  • MoEAttention is not a constructor and AdamOptimizer is not a constructor on every hooks intelligence invocation — even though @ruvector/attention exports both correctly (typeof MoEAttention === 'function' verified directly), so this is a resolution failure inside agentic-flow, not a broken native binding.
  • ./core, ./coordination and ./mcp are absent from the package exports map, so documented imports fail with ERR_PACKAGE_PATH_NOT_EXPORTED while the classes exist at dist/core/… and dist/coordination/….
  • import { AgenticFlow } from 'agentic-flow' — the main entry exports only main and reasoningbank.
  • The three missing @huggingface/transformers imports are all on the embedding path, which may relate to hash-embedding fallbacks appearing where real embeddings are expected.

The quality gates cannot catch it

npm run lint        → Cannot read config file: config/.eslintrc.strict.js  (file absent)
npm run typecheck   → same TS2307/TS2614 family (checks agentic-flow/src, a second copy of the tree)
npm run test:coverage → ReferenceError: module is not defined in ES module scope
                        (config/jest.config.js uses module.exports under "type": "module";
                         the sibling config/jest.config.cjs is fine)
npm run quality:check → dies at step 1 (lint), and would die again at test:coverage
npm run bench:attention → Cannot find module '../agentic-flow/dist/core/agentdb-wrapper-enhanced.js'
                          (from benchmarks/ that resolves to <repo>/agentic-flow/dist/, not <repo>/dist/)
npm run test:attention  → 12 tests, 12 failures, including
                          "should perform 4x faster than standard attention",
                          "should improve recall by >10%", "should route to sparse experts"
npm test                → passes while printing "✅ Spawned 0/5 agents",
                          "✅ Completed 0/5 tasks", "✅ Coordinated 0/6 connections"

Two things worth separating out:

  1. npm test treats 0/5 as success. A benchmark suite that spawns zero of five agents and prints a checkmark cannot detect the dispatch failure in #182.
  2. There appear to be two copies of the source treesrc/ and agentic-flow/src/ — with the same errors at different line numbers, so they have diverged. build compiles one, typecheck checks the other. Several scripts (test:main, typecheck) assume the nested layout while build and bench assume the flat one.

Suggested fix

  • Drop || true from the published build script so a failed compile cannot publish.
  • Declare @huggingface/transformers and @metaharness/router, or remove the imports.
  • Add the missing config/.eslintrc.strict.js, and point test:coverage at jest.config.cjs.
  • Reconcile src/ and agentic-flow/src/, and make the script paths agree on one layout.

Environment: node v22.23.0, npm 10.9.8, darwin arm64, repo HEAD d3735a3 (version 2.0.2-alpha), published 2.1.0.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the build entries in package.json with the published package metadata, then run npm run build and inspect config/tsconfig.json, src/, and agentic-flow/src/. Check the listed missing modules, type errors, package exports, and quality-gate scripts. Done means a clean clone builds a complete dist/ without swallowed errors and the relevant checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system, release, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.