The takeoff isn't directly automated, but there's a system called the "flight director" [1] that provides indicators on the pilot flying's display that correspond with a configured trajectory. In this case, it sounds like the flight director was badly misconfigured and the pilots not only omitted to reconfigure it, but followed the erroneous indication far past any point at which it was remotely reasonable (or remotely safe!) to do so.
I mean, you say that as if it were a joke, and yet I can't fathom any other explanation for this kind of event but that the pilot flying assumed the automation "knows where it's going". Unfortunately, without Rainn Wilson as the PNF...
Why does it not have basic sanity checking to make sure the configured flight path is not going unreasonably close to terrain? Is it solely controlling heading and altitude or does the flight director incorporate waypoints and topology?
It's not controlling anything, just providing steering cues for the pilots along whatever route it's set up for. Setting it up for the flight's intended route is a checklist item, which appears not to have been performed on this flight. Also on the checklist is identifying the correct airspeed for current conditions, called "Vr," at which to "rotate" and bring the aircraft off the ground during the takeoff roll.
Actually doing that is a memory item, intended to be prompted by a "Vr" call from the pilot not flying. As far as I know it's not yet clear whether the PNF gave that call, but the PF certainly waited to rotate until well after reaching Vr. This is where the "sanity checking" appears to have failed, with the PF heeding the misconfigured flight director when it disagreed with other instruments and the situation visible out the cockpit windshield.
It's heading, altitude, and speed. For example, if you're currently accelerating to a target speed and climbing to a target altitude, it won't command you to pitch up so much that you stop accelerating.
The autopilot follows the flight director, and the flight director is dumb.
The autopilot wouldn't have been in use for the takeoff roll, though, would it? The question of automation smarts seems like a bugaboo in what I understand to be a highly manual flight regime.
Correct, autopilot isn't engaged until at least several hundred feet AGL; varying by airline. Some airlines don't engage autopilot until reaching transition altitude or even cruise altitude. Still, the flight director is giving you the same information, and most pilots will just follow that because it's the most accurate way of getting you to where you need to go... if you've set it up correctly.
They are, but there's a system that almost shouts "VEE ONE!" and "VEE TWO!" over a loudspeaker in the cockpit, at least if the flight director is configured properly.
I'm grossly simplifying but V1 is the point where you go "okay, are we SURE we're ready to go flying, y/n?" Around V1, if there are problems with the plane not conducive to flying (engine failure, fire, control surface malfunction especially), you reject the takeoff. On a loaded/fueled commercial jet you run a chance of tire/brake damage because the braking system will be at nearly its limit, and the heat might cause some of the thermal/pressure fuses in the tires to blow.
At V2, that's where you are going flying whether you damn well like it or not, with the only exception being (I believe?) a loss of control surface authority, because in that case, you're not flying, period. Plane on fire? You're going into the air, because if you don't, you're crashing because the plane won't stop before the end of the runway.
Then there's Vr, the point at which you go flying (rotate.)
Just about the only thing on the pilot/copilot's mind around V1/V2 is "does everything feel / sound / look OK?" and then getting as much altitude as quickly as possible once Vr is hit, because altitude is potential energy. Until you have enough altitude such that your glide distance is enough to circle back to the airport and land, you are completely boned if you lose both engines.
The runway is long enough to handle the plane rolling out from V1 to a stop. That means at Vr you aren't anywhere even remotely close to the end of the runway.
Going into the runoff area, but then also failing to climb at a normal rate even after you've finally taken off, is mind-blowingly incompetent. I would think it would almost be a career-ending mistake for both officers. If the first officer was flying the plane but the captain was PIC, the captain should have taken control a second or two after the first officer failed to rotate at V2.
My guess is that the captain was flying and the first officer didn't speak up; especially on the least desirable route people are looking to get promoted out of that hell, and arguing with the captain often isn't conducive to that. Lot of the captains know each other, and even if you get promoted, you stand a good chance of running into one of his buddies.
Edit: forgot to mention, the plane was likely screaming at them for overspeed on the gear and/or flaps, as well.
V1 is the takeoff abort decision speed; beyond V1, you are going too fast to stop safely in the runway length still available to you. If the plane is on fire and you've lost an engine and the computers and screens all die, but you've passed V1, you are still taking off anyway.
V2 is the safe single-engine-failure climb-out speed. This is the speed you pitch for after rotating, so that you're not flying too slowly that an engine failure would be dangerous.
Vr is almost always at V1 or a little bit higher; by definition, it cannot be before V1 (if you were rotating before V1, you wouldn't have to worry about whether you have enough runway left to not rotate) or after V2 (if you're at your single-engine-failure climb-out speed, you should've already rotated).
The V2 speed is entered into the autothrottle before takeoff (but the autothrottle won't maintain that speed; it will maintain a thrust setting instead). The flight director will command you to pitch up to maintain at least that speed at the current thrust, but only if you've correctly entered an altitude for it to take you up to (which did not happen in this case).
Essentially, they were relying on the flight director to command them to rotate, instead of rotating when Vr was called out. This is a catastrophic lapse in judgment.