Build from source: npm run build fails with 18 TS errors yet still emits dist/; npm test passes anyway and covers 2 of 104 test files; bench:attention crashes
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 812
- Forks
- 175
- Avg merge
- 2m
- Merged PRs (30d)
- 3
Description
Summary
The four documented from-source commands were run in order on a fresh --depth 1 clone of main. Two of the four fail, and the pair that "passes" hides the failure:
| step | result |
|---|---|
npm install |
✅ 9s — but 55 vulnerabilities (2 critical, 19 high) and it silently installs husky git hooks |
npm run build |
❌ exit 2 — 18 TypeScript errors |
npm test |
✅ exit 0 — passes despite the build failing; runs 2 of the repo's 104 test files |
npm run bench:attention |
❌ exit 1 — TypeError: controller.store is not a function |
Worse than a plain build failure: tsc has no noEmitOnError, so the failed build still writes 11 MB / 271 files into dist/, including the files that failed to typecheck. Everything downstream then runs against that output.
Environment: Node 24, macOS 15.6, clean clone, no global state involved.
1. npm run build fails on a clean checkout (exit 2)
sh: wasm-pack: command not found # swallowed by `|| true` in build:wasm
src/core/embedding-service.ts(208,41): error TS2307: Cannot find module '@huggingface/transformers'
src/embeddings/optimized-embedder.ts(637,41): error TS2307: Cannot find module '@huggingface/transformers'
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/harness/metaharness.ts(6-13): error TS2614: Module '"ruvector"' has no exported member
'METAHARNESS_VERSIONS' | 'assertMetaHarnessSafePayload' |
'evaluateMetaHarnessPromotion' | 'getMetaHarnessCapabilities' |
'runMetaHarnessDarwin' | 'runMetaHarnessFlywheel' |
'scanMetaHarnessRewardHacks' | 'verifyMetaHarnessReplay' (8 errors)
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' (4 errors)
Four distinct causes:
@huggingface/transformersis an undeclared dependency — imported by 5 files, absent frompackage.json.@metaharness/routeris likewise undeclared.- The
ruvectorimport shape is wrong (8 errors) — TS suggestsimport METAHARNESS_VERSIONS from "ruvector", i.e. the same namespace-vs-default confusion already filed as #189/#186. CostOptimalDecisiongenuinely lacks the four propertiesrouter.tsreads. This is an internal type error, not a missing package — no install fixes it.
Also worth separating: build:wasm is (npm run build:wasm || true) && tsc …, so a missing wasm-pack — an undocumented prerequisite, not mentioned in the setup instructions — fails invisibly and the build continues without WASM artifacts.
2. The failed build still emits dist/
agentic-flow/config/tsconfig.json sets outDir but not noEmitOnError, so after the exit-2 build:
$ du -sh agentic-flow/dist → 11M
$ find agentic-flow/dist -name '*.js' | wc -l → 271 (all stamped at build time)
$ ls agentic-flow/dist/router/router.js → EXISTS
$ ls agentic-flow/dist/harness/metaharness.js → EXISTS
$ ls agentic-flow/dist/router/cost-optimal-router.js → EXISTS
The three files listed are among those that failed to typecheck. So a contributor sees npm run build print errors, then finds a fully populated dist/, and every subsequent command runs against output from a build that reported failure. Setting noEmitOnError: true would make the failure honest.
3. npm test passes despite the build failing, and covers 2 of 104 test files
> npm run test:main && npm run test:parallel
> tsx validation/quick-wins/test-retry.ts ✅ Retry logic test passed
> tsx validation/quick-wins/test-logging.ts ✅ Logging test passed
> node tests/parallel/benchmark-suite.js → topology timings, "100.0% successRate", "Grade: A"
✅ All benchmarks completed exit 0
Two facts about this:
- Two assertion tests run. The repo contains 104
*.test.ts/*.test.js/*.spec.tsfiles;npm testinvokes none of them.test:coverage,test:attentionand the jest config all exist but are not wired intotest. - The rest is a benchmark, not a test. Topology timings with a
successRateand a letter grade have no failure condition tied to correctness — this suite reportsAon the same tree whose build just exited 2.
The combination means CI or a contributor can see a green npm test on a checkout that does not compile. Wiring test to the existing jest config would fix this.
4. npm run bench:attention fails (exit 1)
The attention half is genuinely healthy — every mechanism beats its target:
Flash: <5ms (Actual: 0.07ms) ✅
Multi-Head: <20ms (Actual: 0.07ms) ✅
Linear: <20ms (Actual: 0.06ms) ✅
Hyperbolic: <10ms (Actual: 0.07ms) ✅
MoE: <25ms (Actual: 0.12ms) ✅
Then the GNN section dies:
🕸️ Benchmarking GNN Query Refinement...
Inserting 100 test vectors...
❌ Benchmark failed: TypeError: controller.store is not a function
at EnhancedAgentDBWrapper.insert (agentic-flow/dist/core/agentdb-wrapper-enhanced.js:309:26)
at AttentionGNNBenchmark.benchmarkGNN (benchmarks/attention-gnn-benchmark.js:243:21)
Fatal error: TypeError: controller.store is not a function
The wrapper calls controller.store(...) on a controller that has no such method — same GNN/AgentDB integration family as #189 (@ruvector/gnn undeclared, exports no GraphNeuralNetwork) and #193.
5. Two smaller things
Version mismatch inside the repo. The root package.json is 2.0.2-alpha while the inner agentic-flow/ workspace is 2.1.2 — so a from-source build produces something labelled older than the published latest, and the build log interleaves both versions confusingly.
npm install side effects. The prepare script runs scripts/setup-husky.sh, installing pre-commit, commit-msg and pre-push git hooks into the contributor's clone. That is a reasonable thing for a maintainer to want, but it is not mentioned in the setup instructions and it changes the behaviour of the user's own git commit. npm install also reports 55 vulnerabilities (7 low, 27 moderate, 19 high, 2 critical).
Suggested minimum
- Declare
@huggingface/transformersand@metaharness/router, or make those imports optional. - Fix the
ruvectorimport form and theCostOptimalDecisiontype. - Set
noEmitOnError: trueso a failed build doesn't leave a usable-lookingdist/. - Point
npm testat the jest config so the 104 test files actually run. - Document
wasm-packas a prerequisite, or drop the|| trueso its absence is visible.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the root package.json scripts, agentic-flow/config/tsconfig.json, and the existing Jest configuration to separate build emission from test coverage. Then inspect benchmarks/attention-gnn-benchmark.js and the reported wrapper call. Done means the documented build, test, and attention benchmark commands complete with failures surfaced honestly and the stated test files are exercised.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, devtools, testing
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100