I don't know exactly where you are going with this question...
I am rebutting the claim that those portions of the NIE were declassified after they were disclosed to Miller. To make that claim, one obviously first needs to know how the President's authority works under US law.
...but I have wondered whether the absolute authority of the president to declassify whatever he wants whenever he wants and release it in anyway that he wants to is more limited than has been suggested.
It's not a blank check, but it is one so broad as to cover the vast majority of instances. The President's power over classified national security information is fairly clearly enumerated by statute. 18 USC 798 defines the crime of
unauthorized disclosure of classified. In doing so it also defines who an unauthorized person is:
The term “unauthorized person” means any person who, or agency which, is not authorized to receive information of the categories set forth in subsection (a) of this section, by the President, or by the head of a department or agency of the United States Government which is expressly designated by the President to engage in communication intelligence activities for the United States.
Stated conversely, a person authorized to receive classified is whoever the President says it is. The same power is again asserted in 50 USC 435 which establishes procedures for the protection of classified by the executive branch:
Not later than 180 days after October 14, 1994, the President shall, by Executive order or regulation, establish procedures to govern access to classified information which shall be binding upon all departments, agencies, and offices of the executive branch of Government.
Notice that this power is not retained by Congress nor is it delegated to the courts, the
New York Times or CBS News. Executive Order 13292, issued on March 25, 2003, currently governs the protection of classified national security information:
In some exceptional cases, however, the need to protect such information may be outweighed by the public interest in disclosure of the information, and in these cases the information should be declassified. When such questions arise, they shall be referred to the agency head or the senior agency official. That official will determine, as an exercise of discretion, whether the public interest in disclosure outweighs the damage to the national security that might reasonably be expected from disclosure.
March 2003, you say? So close to the authorization for disclosure that it must have been issued CYA. I have already established that the President has sole authority to change the rules via executive order (see 50 USC 435) but what the hell, let's play. The previous executive order which was superseded by EO 13292 was Executive Order 12958, issued by President Clinton on April 17, 1995, which contained the following directive:
In some exceptional cases, however, the need to protect such information may be outweighed by the public interest in disclosure of the information, and in these cases the information should be declassified. When such questions arise, they shall be referred to the agency head or the senior agency official. That official will determine, as an exercise of discretion, whether the public interest in disclosure outweighs the damage to national security that might reasonably be expected from disclosure.
Looks somehow familiar, right? President Clinton's order superseded to one issued by President Reagan in 1982, which did not contain that language explicitly, but clearly also designated the President as the supreme classification and declassification authority. That order superseded EO 12065 issued by President Carter on June 28, 1978. Guess what? Our old friend is back:
In some cases, however, the need to protect such information may be outweighed by the public interest in disclosure of the information, and in these cases the information should be declassified.
Enough of that.
At some point, the issue of treason would come up. So there is at least that minimal restriction.
Treason is a separate crime which does not
per se limit the statutory powers of the President. I agree that declassification
could be used as the overt act required to meet the statutory definition of treason. This ain't one of those cases.
Are there any more restrictions?
I am less familiar with the provisions of the Atomic Energy Act of 1954. It may impose real restrictions on the President.
Suppose that the president decided that sharing ABM secrets with the Russians was in the national interest and the congress had decided that it wasn't and had passed specific legislation to restrict the president's ability to distribute ABM engineering data. Could the president ignore congress and do what he thought was in the national interest legally?
Congress does not have that power unless the provisions of the release were outlined by treaty - which the Senate could reject. The POTUS is the sole organ of foreign affairs. The Senate cannot enter into a treaty without the President first presenting it to that body.
Suppose the president declassified portions of a document with the intent of misleading congress so that they would be supportive of a war that they might not otherwise support.
Does not apply. Congress had access to the October 2002 NIE. All members of Congress hold security clearances which allow them access to non-compartmentalized information such as that contained in the NIE.
Is intent the sole arbiter of legality here?
No and yes. Putting nuclear secrets and cryptography for a second, the POTUS is the sole class/declass authority. Article II Section 2 of the US Constitution is the arbiter of that authority. All other authorities stem from his person authority as commander-in-chief. By executive order, "an exercise of discretion" is the standard for declassification in the public interest. That may meet your definition of intent.
If the president did it to promote something he believed was in the American interest it would be legal but if the president did it knowing that it was against American interests it would then be illegal because it would then be treason?
Treason != all actions against American interests. 18 USC 2381:
Whoever, owing allegiance to the United States, levies war against them or adheres to their enemies, giving them aid and comfort within the United States or elsewhere, is guilty of treason and shall suffer death, or shall be imprisoned not less than five years and fined under this title but not less than $10,000; and shall be incapable of holding any office under the United States.
Article III Section 3 of the US Constitution is the basis for this statutory definition.
Could the president decide to release the personell files of everybody that works at the post office?
No. The personnel files for the USPS is not classified and is not national security information. Article II Section 8 of the US Constitution grants Congress the power "to establish post offices and post roads."