Skip to content

Add multi-stage flows: audit-triage, remediate-verify, full - #9

Merged
gurnben merged 1 commit into
mainfrom
feat/flows
Oct 21, 2026
Merged

gurnben merged 1 commit into
mainfrom
feat/flows

Conversation

@gurnben

@gurnben gurnben commented Oct 21, 2026

Copy link
Copy Markdown
Member

Summary

The harness's core loop — audit, triage, patch, verify — was four manual invocations whose wiring lived in the skills' docs. This PR adds flow commands that chain the stages through their artifacts, with each stage running as an ordinary background run (own journal, result, attach session):

  • flow audit-triage <repo> — secure-code-audit, then triage of its report with --auto (headless-safe). Output: the triaged findings (<repo>-triage.json) — the explicit hand-off point.
  • flow remediate-verify <findings> <repo> — patch from the triaged findings (or an audit report), then verify-remediation against a fresh clone of the target with the generated PATCHES applied (conflicting patches skipped, not fatal).
  • flow full <repo> — the whole loop end to end.
  • flow status [id] — list flows / show per-stage state, run ids and artifacts.
  • The pipeline worker derives each stage's inputs from the previous stage's result.json artifacts; a failing stage fails the flow with later stages left pending; stop signals cancel the current stage gracefully. Interactive flows follow stage-by-stage (Ctrl-C detaches without cancelling); every stage is inspectable with attach/result/logs since they're normal runs.

Verification

  • Live end to end against the fake harness and a real git target: all four stages chained (audit report → triage input, triage JSON → patch input, PATCHES applied to the verify checkout — the patched file verifiably changed), flow status showing stage detail.
  • Tests: artifact chaining (phase-1 output wired into phase-2 input, --auto included), failure propagation (later stages pending), and buildPatchedRepo against real git repositories (applicable patches apply, conflicting ones skip).
  • The fake harness is now skill-aware (writes the artifact matching the prompted skill), which the chaining tests rely on.
  • Full suite with race detector, vet, staticcheck clean.

💘 Generated with Crush

The harness's core loop — audit, triage, patch, verify — was four
manual invocations whose wiring lived in the skills' docs: triage
needs the audit report plus --auto to run headless, patch consumes
the triaged findings, and verify needs the original report and a
patched checkout that nothing produced automatically.

flow commands chain the stages through their artifacts. Each stage
runs as an ordinary background run (its own journal, result and
attach session), and the pipeline worker derives the next stage's
inputs from the previous stage's result: the audit report feeds
triage (--auto), the triaged findings feed patch, and verify audits
a fresh clone of the target with the generated PATCHES applied
(conflicting patches are skipped, not fatal).

  flow audit-triage <repo>            audit + triage; output = triaged
                                      findings, the hand-off point
  flow remediate-verify <f> <repo>    patch + verify from triaged
                                      findings (or an audit report)
  flow full <repo>                    the whole loop
  flow status [id]                    list flows / stage detail

Flows are detached workers like runs: Ctrl-C detaches without
cancelling, interactive flows follow stage-by-stage, and every stage
is inspectable with attach/result/logs.

Verified end to end against the fake harness and a real git target:
all four stages chained, the patch applied to the verify checkout,
failure stopping the flow with later stages pending. Tests cover the
artifact chaining (phase-1 output wired into phase-2 input), failure
propagation, and patch application against real git repositories.

💘 Generated with Crush

Assisted-by: Crush:rits/zai-org/glm-5-3
@gurnben
gurnben requested a review from a team as a code owner October 21, 2026 18:06
@gurnben
gurnben merged commit 6eafff0 into main Oct 21, 2026
2 checks passed
@gurnben
gurnben deleted the feat/flows branch October 21, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant