examples: software-factory and stale-issues for the README use cases

Merged
KH
3mo ago
+215-0

Two example flows the README's "What can you do with this?" section points at, authored against the real surface package and registered in examples/tsconfig.json (npm --prefix packages/surface run typecheck:examples passes; flows check passes on both, the Slack one under RELAYFLOWS_SLACK_MOCK=1).

  • examples/software-factory/ — deployable today: flows deploy … --repo o/r --on linear:team=ENG --approver you. Implementer → deterministic tests → adversarial review (verdict is a file) → tests → gh pr create; a blocked review opens a draft PR with the findings and ends step_failed.
  • examples/stale-issues/ — the scheduled digest: deterministic GitHub fetch, one f.llm with a JSON-schema gate, one f.slack.post. Targets flows schedule (in flight); documents flows run --cloud on demand until then.

The Review use case points at the existing examples/pr-review-pipeline/, which #434's successor is making runnable.

🤖 Generated with Claude Code


[!NOTE]
Low Risk
Additive example and documentation only; no changes to core runtime, though the samples exercise shell, GitHub, and Slack when users deploy them.

Overview
Adds two README-linked example flows under examples/, each with a short README and a @relayflows/surface flow file, and registers them in examples/tsconfig.json for example typechecking.

software-factory wires ticket-driven automation: implementer agent → gated summary.md → deterministic npm test (exit-code gated) → adversarial reviewer that must write review.passed or review.blocked under .relayflow → tests again → commit/push and gh pr create (draft with findings when blocked, step_failed). Deploy/local run instructions cover flows deploy with --on triggers and --local-agent.

stale-issues is a scheduled digest pattern: validated repo name, journaled Node fetch of all open issues (paginated, no PRs) → single f.llm triage behind JSON schema → Slack post with mrkdwn escaping and issue numbers filtered to the fetched set. Documents flows schedule and interim flows run --cloud plus RELAYFLOWS_SLACK_MOCK=1 for local check.

Both examples emphasize untrusted input: shell arguments via shellWord/quoting, artifacts outside git’s tracked tree, and deterministic gates instead of agent-reported pass/fail.

Reviewed by Cursor Bugbot for commit 7306df149786310b9e668f50da0f52773ee29793. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Adds two runnable example flows for the README's "What can you do with this?" section, both registered in examples/tsconfig.json and passing flows check, with a hardening pass so they're safe to deploy with untrusted input.

  • examples/software-factory maps a ticket to a PR: implementer agent → deterministic tests → adversarial review (verdict written to a file) → tests → gh pr create; a blocked review opens a draft PR with findings and ends step_failed.
  • examples/stale-issues fetches open issues deterministically, classifies them with one LLM step behind a JSON-schema gate, and posts a single Slack digest; flows schedule is in flight, so the README documents flows run --cloud until it ships.

Security hardening

  • Ticket text is single-quoted into shell arguments so crafted titles can't run commands, and flow artifacts live outside the tracked tree.
  • The GitHub fetch validates the repo, paginates, and only fetched issues appear in the digest; model output is schema-validated and escaped for Slack mrkdwn.