Getting Started
Quickstart
This walks through the full pipeline on the demo spacecraft included with astrapatch: a small C telemetry handler with a deliberately introduced bounds-check weakness.
Open the shell
cd examples/demo-spacecraft
astrapatch
The shell draws the wordmark, shows the project status, and waits for a command. The slash is optional, and Tab completes commands and ids.
Run the pipeline
› /analyze
› /fix FINDING-001
› /verify
› /report
- /analyze finds three issues: the unchecked
memcpyinsrc/tlm.c(high, CWE-121), an unboundedsprintfinsrc/hk.c, and a fictional advisory for the vendoredminicrclibrary. - /fix FINDING-001 proposes a three-line bounds check, recorded as an untrusted proposal.
- /verify builds the baseline and the candidate in separate copies and runs the unit tests and two scenarios on both. The baseline aborts on malformed packets; the candidate completes them with nominal telemetry unchanged. The verdict is
accepted_for_review, with operator approval pending. - /report writes an evidence package with SHA-256 checksums to
.astrapatch/reports/.
Without the shell
The same steps run as one-shot commands, which is how you use astrapatch in scripts and CI:
astrapatch analyze
astrapatch remediate --finding FINDING-001
astrapatch verify --candidate candidate-001
astrapatch report --candidate candidate-001
verify exits with 0 when accepted for review, 1 when rejected and 3 when inconclusive.
Try a rejection
› /fix FINDING-002
› /verify
Fixing only the sprintf is rejected: the malformed-packet scenario still crashes.
Start fresh
rm -rf .astrapatch build telemetry.out metrics.json
Next
- CLI reference
- The beginner roadmap, if you want to understand every step in depth