relay-flow 0.3.9-alpha → 0.3.11-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +30 -34
  2. package/cmd/relay-flow/commands_test.go +449 -23
  3. package/cmd/relay-flow/main.go +207 -37
  4. package/cmd/relay-flow/observability_test.go +11 -0
  5. package/cmd/relay-flow/onboarding.go +1 -1
  6. package/cmd/relay-flow/onboarding_test.go +1 -1
  7. package/cmd/relay-flow/scenario_test.go +26 -10
  8. package/cmd/relay-flow/serve.go +27 -1
  9. package/examples/config-reference.yaml +23 -19
  10. package/examples/workflow-reference.yaml +3 -0
  11. package/internal/execution/goworkflows/activities.go +13 -22
  12. package/internal/execution/goworkflows/engine_test.go +17 -3
  13. package/internal/execution/goworkflows/fakes_test.go +20 -0
  14. package/internal/execution/goworkflows/interpreter.go +25 -11
  15. package/internal/execution/goworkflows/mailbox_test.go +28 -1
  16. package/internal/execution/goworkflows/ownership_test.go +259 -0
  17. package/internal/execution/goworkflows/recovery_test.go +81 -1
  18. package/internal/execution/temporal/activities.go +13 -22
  19. package/internal/execution/temporal/compact_mailbox_test.go +56 -0
  20. package/internal/execution/temporal/interpreter.go +16 -3
  21. package/internal/execution/temporal/recovery.go +68 -36
  22. package/internal/harness/harness.go +23 -10
  23. package/internal/harness/opencode/opencode.go +22 -4
  24. package/internal/harness/opencode/opencode_test.go +41 -1
  25. package/internal/harness/opencode/repo_setup.go +1 -1
  26. package/internal/harness/opencode/task_env_test.go +2 -2
  27. package/internal/harness/pi/pi.go +21 -2
  28. package/internal/harness/pi/pi_test.go +7 -4
  29. package/internal/harness/pi/prompt_test.go +13 -5
  30. package/internal/harness/pi/task_env_test.go +18 -2
  31. package/internal/recover/recover.go +30 -1
  32. package/internal/repo/binding_test.go +63 -0
  33. package/internal/repo/repo.go +47 -6
  34. package/internal/router/router.go +39 -5
  35. package/internal/router/router_test.go +67 -1
  36. package/internal/run/manager.go +90 -3
  37. package/internal/run/run_manager_test.go +74 -0
  38. package/internal/server/api_test.go +13 -0
  39. package/internal/server/client.go +7 -0
  40. package/internal/server/fixture_test.go +5 -0
  41. package/internal/server/server.go +32 -3
  42. package/internal/task/beads/beads.go +201 -3
  43. package/internal/task/beads/beads_test.go +172 -0
  44. package/internal/task/jira/effects_test.go +86 -0
  45. package/internal/task/jira/filters_test.go +103 -0
  46. package/internal/task/jira/helpers_test.go +11 -2
  47. package/internal/task/jira/jira.go +244 -15
  48. package/internal/task/jira/normalize.go +30 -15
  49. package/internal/task/jira/rest/client.go +17 -2
  50. package/internal/task/jira/templates_test.go +38 -2
  51. package/internal/task/jira/transition_defaults_test.go +3 -1
  52. package/internal/task/task.go +67 -0
  53. package/internal/workflow/report.go +10 -0
  54. package/internal/workflow/report_test.go +16 -0
  55. package/internal/workflow/workflow.go +24 -0
  56. package/internal/workflow/workflow_test.go +58 -1
  57. package/package.json +1 -1
package/README.md CHANGED
@@ -16,6 +16,10 @@ Install the latest released CLI with Homebrew:
16
16
  brew install rajpopat27/tap/relay-flow
17
17
  ```
18
18
 
19
+ The package installs both equivalent commands, `relay-flow` and `rf`. The
20
+ short `rf` name is also included in release archives and can be installed by
21
+ `install.sh` or with `go install ./cmd/relay-flow ./cmd/rf` from a checkout.
22
+
19
23
  ### 2. Install the harness extension
20
24
 
21
25
  Choose the harness that will run your agent sessions. Both commands install the
@@ -24,13 +28,13 @@ same `relay-flow-plugin` package with host-specific entrypoints.
24
28
  **OpenCode**
25
29
 
26
30
  ```sh
27
- opencode plugin relay-flow-plugin@0.3.9-alpha
31
+ opencode plugin relay-flow-plugin@0.3.11-alpha
28
32
  ```
29
33
 
30
34
  **Pi**
31
35
 
32
36
  ```sh
33
- pi install npm:relay-flow-plugin@0.3.9-alpha
37
+ pi install npm:relay-flow-plugin@0.3.11-alpha
34
38
  ```
35
39
 
36
40
  Pi loads the package's `pi.ts` extension from its manifest. Do not add
@@ -62,7 +66,7 @@ relay-flow init \
62
66
  --runner-plugin orca \
63
67
  --harness-plugin opencode
64
68
  relay-flow task auth
65
- relay-flow serve --background
69
+ rf serve
66
70
  ```
67
71
 
68
72
  For Beads, skip `task auth` and initialize/authenticate the Beads workspace
@@ -84,7 +88,7 @@ For Herdr, register the repository path directly; relay-flow creates ticket
84
88
  worktrees lazily. The interactive registration asks for the task-system values
85
89
  required by the selected task plugin. `repo register` remains the standalone
86
90
  escape hatch for adding repositories after initialization and requires a
87
- running `relay-flow serve --background`.
91
+ running `rf serve` (or `relay-flow serve`).
88
92
 
89
93
  ### 5. Submit a workflow
90
94
 
@@ -160,7 +164,7 @@ OpenCode plugin configuration uses both entrypoints. The server entrypoint is li
160
164
  ```json
161
165
  {
162
166
  "$schema": "https://opencode.ai/config.json",
163
- "plugin": ["relay-flow-plugin@0.3.9-alpha"]
167
+ "plugin": ["relay-flow-plugin@0.3.11-alpha"]
164
168
  }
165
169
  ```
166
170
 
@@ -169,7 +173,7 @@ The native HITL approval entrypoint is listed in `.opencode/tui.json`:
169
173
  ```json
170
174
  {
171
175
  "$schema": "https://opencode.ai/tui.json",
172
- "plugin": ["relay-flow-plugin@0.3.9-alpha"]
176
+ "plugin": ["relay-flow-plugin@0.3.11-alpha"]
173
177
  }
174
178
  ```
175
179
 
@@ -185,7 +189,7 @@ Pi plugin: install the same published package manually in Pi's global package
185
189
  settings before starting a Pi harness session:
186
190
 
187
191
  ```sh
188
- pi install npm:relay-flow-plugin@0.3.9-alpha
192
+ pi install npm:relay-flow-plugin@0.3.11-alpha
189
193
  ```
190
194
 
191
195
  Relay-flow does not install or configure the package automatically. Pi resolves
@@ -221,7 +225,7 @@ For scripts and existing installations, keep the independent sequence:
221
225
  ```sh
222
226
  relay-flow init --task-plugin jira --runner-plugin orca --harness-plugin opencode
223
227
  relay-flow task auth --site https://company.atlassian.net --email you@example.com --token "$JIRA_API_TOKEN"
224
- relay-flow serve --background
228
+ rf serve
225
229
  ```
226
230
 
227
231
  `task auth` delegates to the selected task plug-in. Jira prompts for its site,
@@ -262,12 +266,11 @@ workflows/<name>.yaml 0644 submitted workflow definitions
262
266
 
263
267
  The guided first-run flow can start the server and open repository registration
264
268
  for you. `repo register` remains a server-backed standalone command for later
265
- additions: if no server is running, start it with
266
- `relay-flow serve --background` (or rerun interactive `relay-flow init` for a
267
- new home).
269
+ additions: if no server is running, start it with `rf serve` (or rerun
270
+ interactive `relay-flow init` for a new home).
268
271
 
269
272
  ```sh
270
- relay-flow serve --background
273
+ rf serve
271
274
  ```
272
275
 
273
276
  The repo must already exist in the runner. For the Orca runner, add it first
@@ -402,13 +405,18 @@ Outside that flow, `repo register` and `workflow submit` require the server to
402
405
  already be running; the same process polls repos and drives runs.
403
406
 
404
407
  ```sh
405
- relay-flow serve # normal start; requires an initialized database
406
- relay-flow serve --background # detached; returns after the server is ready
407
- relay-flow serve --recover # explicit destructive rebuild from the task system
408
- relay-flow stop
408
+ rf serve # detached by default; waits for readiness
409
+ relay-flow serve --foreground # blocking mode for supervisors and development
410
+ relay-flow serve --background # compatibility spelling for detached startup
411
+ rf serve --recover # explicit destructive rebuild from the task system
412
+ rf stop
409
413
  ```
410
414
 
411
- `--background` preserves `--debug` and `--recover`, logs to `~/.relay-flow/server.log`, and remains stoppable with `relay-flow stop`. Plain `serve` remains foreground and blocking.
415
+ Both executable names share the same home, socket, lock, database, logs, exit
416
+ codes, and server lifecycle. Detached startup logs diagnostics to
417
+ `~/.relay-flow/server.log` and does not inherit a temporary or deleted caller
418
+ working directory. Use `--foreground` only when the process supervisor owns
419
+ the server lifetime; `--background` remains accepted for existing scripts.
412
420
 
413
421
  `serve --recover` treats ALL SQLite execution state as gone, closes surviving run-owned terminals (preserving worktrees and code), resets Jira parent+mailbox state, and starts every labeled parent in a fresh deterministic run from `start` with fresh `nodeVisitID`s. Recovery never runs automatically; database loss is never inferred.
414
422
 
@@ -606,28 +614,16 @@ durable run waiting; Pi does not require an LLM Question tool for this step.
606
614
 
607
615
  ## Structured node report
608
616
 
609
- Every visit (agent or HITL) submits one report with the same fixed labels:
617
+ Every visit (agent or HITL) submits one report with four fixed fields:
610
618
 
611
619
  ```
612
620
  STATUS: success | failure
613
- NEXT STEP: <one configured route for that status>
614
-
615
- SUMMARY:
616
- COMPLETED: ...
617
- COMMITS: <commit IDs or None>
618
- NOT COMPLETED: ... | None
619
- ISSUES DISCOVERED: ... | None
620
- VERIFICATION: ...
621
- NOTES: ... | None
622
-
623
- FEEDBACK:
624
- REASON FOR NEXT STEP: ...
625
- REQUIRED ACTIONS: ...
626
- RELEVANT CONTEXT: ...
627
- EXPECTED RESULT: ...
621
+ NEXT STEP: <one valid route>
622
+ SUMMARY: <concise result>
623
+ FEEDBACK: <concise handoff, or None when NEXT STEP is end>
628
624
  ```
629
625
 
630
- The labels above are fixed; configurable templates do not change the parsed report contract. The plugin submits one `report` object containing both lower-camel `summary` and `feedback` objects. Relay-flow validates that complete shape once, renders `summaryReport` through the task system's summary-comment template on the current mailbox, and renders `feedbackReport` through its feedback-comment template on only the selected next mailbox. `None` is the literal marker for an intentionally empty section. When `NEXT STEP` is `end`, every FEEDBACK field must be `None` and no feedback comment is written.
626
+ The report format is hardcoded, exposed as `{{report}}` in Jira mailbox templates and passed to the runtime plugin through `RELAY_FLOW_REPORT_FORMAT`; configurable templates do not change it. The plugin maps `SUMMARY` to `report.summary.completed` and `FEEDBACK` to `report.feedback.requiredActions`, filling the remaining internal JSON fields with `None`. Relay-flow validates the structured report and writes the current summary to its mailbox and only the selected feedback to the next mailbox. When `NEXT STEP` is `end`, `FEEDBACK` must be exactly `None` and no feedback comment is written.
631
627
 
632
628
  The plugin delivers `{runId, node, reportId, report}` as one JSON object via `relay-flow report` stdin with the shared backoff (initial 2s, factor 2, jitter 0.2, max 5m) until acknowledged. It derives `reportId` from the harness session/message identity. Duplicate/stale reports are acked safely with no repeated graph effects. Invalid agent output is nudged; ordinary, missing, or empty HITL output stays silent, while partial report-shaped HITL output is corrected and a valid HITL report opens the native TUI approval dialog. Relay-flow HITL approval does not use OpenCode's Question tool.
633
629