Overview
moda init maps your repo’s agents, prompts, and tools into a cited harness graph and syncs it to Moda. That map is a snapshot: as your team ships new agents, renames tools, or rewires prompts, the synced graph drifts from the code.
The living harness workflow closes that gap. A small GitHub Actions workflow re-runs the hosted harness analysis on every merge to main, approves the refreshed report, and syncs the updated graph to Moda — so the harness Moda serves always matches what is deployed.
Each rescan runs three CLI commands:
Setup
1. Add the repository secrets
In your repo, add these GitHub Actions secrets:MODA_API_KEY(required) — a Moda API key (moda_sk_...) from Settings → API KeysMODA_TENANT_ID(optional) — pins the workspace when the key spans multiple organizations
2. Generate the workflow
The easiest path ismoda init, which offers the workflow as an optional setup-plan item, or the explicit flag:
--harness-rescan):
.github/workflows/moda-harness-rescan.yml, pinned to the CLI version that generated it.
3. Or drop the workflow in by hand
Copy this into.github/workflows/moda-harness-rescan.yml, replacing <version> with the current @moda-ai/cli release (pin a version rather than @latest so CI runs a release you have reviewed):
.github/workflows/moda-harness-rescan.yml
Behavior notes
- Merge-to-main only. The workflow never runs on
pull_request, so unmerged agent changes are never synced to your workspace. Use theworkflow_dispatchtrigger for an out-of-band rescan. - Path scoping. Add
on.push.pathsglobs so only pushes touching agent-relevant code trigger a rescan. Pushes that touch none of the listed paths skip the workflow entirely. - Superseding runs. The
concurrencygroup cancels an in-flight rescan when a newer push lands; the latest merge always wins. - What leaves your CI.
harness analyze --remoteuploads a safe source snapshot to Moda for analysis; the snapshot is ephemeral and deleted after the run. LLM credentials stay on Moda’s side. - Failure isolation. The workflow only talks to Moda; it has read-only repo permissions and cannot push commits, so a failed rescan never blocks or mutates your codebase. Re-run it from the Actions tab or wait for the next merge.