What exactly are the legal requirements? That is, how does the law define permanent attachment? Are both the pin and the weld necessary? What kind of each?
MA law doesn't address any sort of attachment unfortunately. Most people go with the old ATF standards from the Fed AWB since we adopted that law word for word...
ATF rules during the 1994-2004 ban were a few options; cut the offending threads off and recrown, "blind pin and weld" (aka drill barrel and device, drop tool steel pin, weld over), or solder using a material which has a melting point over 1100* (aka silver solder). The ATF was known to put a big wrench on your gun in a vice, and put a pipe on the wrench for leverage, in attempts to confirm that the muzzle device is affixed.
The import compliance BS that happened after the 1989 "ban" was a little different and was a reinterpretation of what constituted a "sporting rifle"; a lot of companies tack welded "thread protectors" on to guns (not blind pinned, or silver soldered), threw on thumbhole stocks, and called it a day - the ATF didn't complain. A lot of importers then removed said parts and made the guns into so-called assault configurations once the gun was in the country. Then in 1990 the 922(r) system came about, meaning that rifles had to have a certain number of US-made parts, and conversions became more complicated but were still do-able for importers.
The Chinese Norinco/Poly MAK90 was made to comply with the 1989 change, hence the mixed bag of configurations, since a lot had already been built in unacceptable configurations and were made compliant after completion but before import. Many MAK90s were in AW configuration before the 1994 Federal AWB, however, either converted by importers or by end users, but for the most part not threaded. Ditto the Norinco NHM-91 rifles, though many of them had tack welded muzzle devices (not blind pinned or silver soldered) over threaded barrel tips. In may of 1994, for a variety of reasons, import of Chinese pistols and rifles was banned, and remains so to this day; we still get shotguns from China though. In September of 1994 the Federal AWB went into effect.
Many Yugo (Serbian) and Romanian AKs come into the country TODAY with slim mag wells to accept only "low cap" single stack 10rd magazines for import purposes, and are then converted to double-stack configuration by importers (one in particular), and filled with US parts for 922(r) compliance. When WASRs and Yugos were brought in prior to the AWB sunset in '04, this was less of a concern because they were in compliance with both the 1989 "ban" and the 1994-2004 so conversion from "sporting" to "assault" spec was not an option for the civilian market.
Let's not forget that there are a lot of Colts dating back to just after the "civilian sales stop" in the late 1980s (The year escapes me but I want to say 1987? Either way there was a fuss with the White House and Colt simply stopped selling them to civilians for months...). These came from the factory with the bayonet lug milled off, with a solid A2 stock and silver-soldered A2 flash hider - therefore they were in an "assault configuration" prior to 1994 but definitely a mild one given the only offending features were the brake and the pistol grip.