Skip to main content

Headless Execution & CI Workflows

M31A is designed for headless automation in continuous integration and automated code repair pipelines.

Stable Exit Codes​

CI scripts can reliably branch on M31A's numeric process exit codes (src/cli/exit_codes.rs):

Exit CodeIdentifierSemantic Meaning
0SuccessExecution run completed and passed all verification checks
1GeneralErrorUnhandled runtime exception or command failure
2ConfigErrorInvalid or unparseable configuration file
3VerificationFailedNyquist gate failed; tests or compiler checks rejected code
4PolicyViolationAction denied by security policy or unattended approval required
5InterruptedExecution cancelled by operator or SIGINT/SIGTERM signal
6ResourceExhaustedConcurrency, timeout, or memory bounds exceeded
7CrashRecoveredUnhandled crash recovered from durable checkpoint

GitHub Actions Example​

name: Autonomous Code Maintenance

on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1' # Weekly Monday at 3 AM

jobs:
m31a-lint-fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install M31A
run: |
curl -fsSL https://docs.m31a.tonmoyinfrastructure.org/install.sh | bash
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Execute Autonomous Refactor
env:
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
run: |
m31a run --autonomy unattended --profile ci --output stream-json "Fix all clippy warnings and ensure cargo test passes"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: "fix: autonomous clippy remediation"
branch: "m31a/clippy-fixes"