Mass. Gen. Laws ch. 211E, § 4
(a) A defendant may file a notice of appeal for review of an otherwise final sentence if:
(b) The commonwealth, with the personal approval of the attorney general or a district attorney, may appeal an otherwise final sentence if:
(c) In the case of a plea agreement entered into pursuant to Rule twelve of the Massachusetts rules of criminal procedure: