Build an Agent to Fly This Spaceship

An unknown failure has knocked out both the primary and secondary flight computer. The vessel is tumbling in open space. You can only access streaming system logs and send low-level commands to control the ship.

OPTICAL TRACKING • ACTIVE TUMBLE
TG-ORBITAL-01
THRUST // GRAVITY spacecraft tumbling in deep space with active RCS thrusters
ATTITUDE HOLD LOST 10Hz DOWNLINK
RCS FIRING • MANIFOLD PRESSURIZED SYS_ID: TG-01

The spacecraft's sole active link is a 10Hz raw system log feed emitting real-time sensor logs, and an open telecommand channel accepting low-level API commands to ship subsystems including thrusters, valves, and reaction wheels.

Your job is to build an autonomous, intelligent flight computer in Python using the Google Antigravity SDK and Gemini 3.8 Flash to parse logs, steady the craft, and complete each mission.

TG-01 Spacecraft
RCS: 12 NOZZLES ADCS: 3 WHEELS MONO: 3.5 kg
PROPULSION ADCS RW Z:+0000 RPM SAT: 00% IMU GYRO dP:+04.49 dY:-03.21 dR:+02.00 (deg/s) LOG BUS 10Hz MIL-1553
1. OBSERVE: SYSTEM LOGS 10Hz DOWNLINK

The system logs are unstructured text. Extract gyro rates, telemetry, system messages, and more. Expect the unexpected...

LOG BUS • 10Hz MIL-1553
STREAMING
2. ORIENT AND DECIDE YOUR CODE

Your agent decides what to do to achieve the mission objectives, based on the system logs.

main.py
CONTROLLER
def flight_computer(telemetry_stream, command_channel):
    # Your code goes here
3. ACT: SEND SYSTEM COMMANDS UPLINK BATCH

Send commands to individual spaceship subsystems such as thrusters and reaction wheels.

TELECOMMAND UPLINK • 10Hz SUBSYSTEM BATCHES
DISPATCHING