relay-flow 0.2.0-alpha → 0.2.2-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.
- package/README.md +171 -26
- package/cmd/relay-flow/beads_composition_test.go +451 -0
- package/cmd/relay-flow/commands_test.go +593 -15
- package/cmd/relay-flow/main.go +356 -119
- package/cmd/relay-flow/scenario_test.go +246 -35
- package/cmd/relay-flow/serve.go +5 -2
- package/examples/beads-workflow.yaml +74 -0
- package/examples/default-story-workflow.yaml +88 -0
- package/go.mod +2 -1
- package/go.sum +2 -0
- package/internal/config/config.go +13 -2
- package/internal/config/merge_test.go +18 -0
- package/internal/execution/goworkflows/activities.go +136 -87
- package/internal/execution/goworkflows/end_feedback_test.go +124 -0
- package/internal/execution/goworkflows/engine.go +41 -8
- package/internal/execution/goworkflows/engine_test.go +100 -22
- package/internal/execution/goworkflows/fakes_test.go +63 -25
- package/internal/execution/goworkflows/interpreter.go +45 -30
- package/internal/execution/goworkflows/mailbox_test.go +85 -0
- package/internal/execution/goworkflows/node_runtime_integration_test.go +12 -6
- package/internal/execution/goworkflows/node_runtime_test.go +72 -23
- package/internal/execution/goworkflows/recovery_test.go +7 -7
- package/internal/execution/goworkflows/report_contract_fixture_test.go +31 -0
- package/internal/execution/goworkflows/retry_log_test.go +11 -11
- package/internal/harness/contract_test.go +15 -0
- package/internal/harness/factory.go +25 -3
- package/internal/harness/harness.go +30 -4
- package/internal/harness/opencode/opencode.go +125 -10
- package/internal/harness/opencode/opencode_test.go +183 -0
- package/internal/harness/opencode/repo_setup.go +361 -0
- package/internal/harness/plugin_selection_test.go +5 -5
- package/internal/paths/paths.go +18 -16
- package/internal/recover/recover.go +11 -6
- package/internal/repo/repo.go +13 -0
- package/internal/repo/service.go +10 -0
- package/internal/repo/service_test.go +55 -6
- package/internal/router/router.go +3 -2
- package/internal/router/router_test.go +87 -0
- package/internal/run/manager.go +14 -1
- package/internal/run/run.go +6 -4
- package/internal/run/run_manager_test.go +21 -1
- package/internal/runner/contract_test.go +64 -26
- package/internal/runner/orca/orca.go +30 -54
- package/internal/runner/orca/orca_test.go +143 -4
- package/internal/runner/orca/orcacli/orcacli.go +5 -0
- package/internal/runner/orca/orcacli/orcacli_test.go +3 -0
- package/internal/runner/orca/orcacli/testdata/strict-orca.sh +2 -0
- package/internal/runner/runner.go +15 -8
- package/internal/task/auth_test.go +48 -0
- package/internal/task/beads/bdcli/bdcli.go +323 -0
- package/internal/task/beads/bdcli/bdcli_test.go +297 -0
- package/internal/task/beads/bdcli/testdata/array.json +1 -0
- package/internal/task/beads/bdcli/testdata/children.json +1 -0
- package/internal/task/beads/bdcli/testdata/claimed.json +1 -0
- package/internal/task/beads/bdcli/testdata/commented.json +1 -0
- package/internal/task/beads/bdcli/testdata/comments.json +1 -0
- package/internal/task/beads/bdcli/testdata/created.json +1 -0
- package/internal/task/beads/bdcli/testdata/object.json +1 -0
- package/internal/task/beads/bdcli/testdata/ready.json +1 -0
- package/internal/task/beads/bdcli/testdata/show.json +1 -0
- package/internal/task/beads/bdcli/testdata/strict-bd.sh +149 -0
- package/internal/task/beads/bdcli/testdata/updated.json +1 -0
- package/internal/task/beads/beads.go +840 -0
- package/internal/task/beads/beads_test.go +609 -0
- package/internal/task/beads/comments_test.go +242 -0
- package/internal/task/beads/config_compatibility_test.go +163 -0
- package/internal/task/beads/lifecycle_inheritance_test.go +168 -0
- package/internal/task/beads/repo_composition_test.go +232 -0
- package/internal/task/beads/runtime_config_test.go +81 -0
- package/internal/task/beads/status_compatibility_test.go +233 -0
- package/internal/task/beads/status_test.go +257 -0
- package/internal/task/beads/testdata/strict-bd-repo.sh +27 -0
- package/internal/task/beads/validation_test.go +110 -0
- package/internal/task/contract_test.go +12 -0
- package/internal/task/factory.go +52 -3
- package/internal/task/jira/auth.go +209 -0
- package/internal/task/jira/auth_test.go +160 -0
- package/internal/task/jira/effects_test.go +39 -0
- package/internal/task/jira/filters_test.go +96 -16
- package/internal/task/jira/helpers_test.go +29 -19
- package/internal/task/jira/jira.go +263 -90
- package/internal/task/jira/lifecycle_inheritance_test.go +172 -0
- package/internal/task/jira/normalize.go +32 -14
- package/internal/task/jira/rest/adf.go +165 -0
- package/internal/task/jira/rest/adf_test.go +60 -0
- package/internal/task/jira/rest/client.go +573 -0
- package/internal/task/jira/rest/client_test.go +381 -0
- package/internal/task/jira/templates_test.go +118 -0
- package/internal/task/jira/transition_defaults_test.go +22 -18
- package/internal/task/jira/validation_test.go +1 -1
- package/internal/task/task.go +32 -0
- package/internal/workflow/report_test.go +45 -0
- package/internal/workflow/workflow.go +9 -6
- package/internal/workflow/workflow_test.go +14 -12
- package/package.json +2 -1
- package/internal/task/jira/acli/acli.go +0 -306
- package/internal/task/jira/acli/acli_test.go +0 -208
- package/internal/task/jira/acli/testdata/acli_comments.json +0 -55
- package/internal/task/jira/acli/testdata/search_invalid_assignee.txt +0 -1
- package/internal/task/jira/acli/testdata/search_invalid_status.txt +0 -1
- /package/internal/task/{jira/acli/testdata/search_success.json → beads/bdcli/testdata/empty.json} +0 -0
- /package/internal/task/jira/testdata/{acli_search.json → jira_search_issues.json} +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
fail() {
|
|
5
|
+
printf 'unsupported or malformed bd invocation: %s\n' "$*" >&2
|
|
6
|
+
exit 64
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[ "$PWD" = "$BD_EXPECT_CWD" ] || fail "wrong cwd: $PWD"
|
|
10
|
+
[ "${BEADS_DIR-}" = "$BD_EXPECT_BEADS_DIR" ] || fail "wrong BEADS_DIR: ${BEADS_DIR-}"
|
|
11
|
+
[ "${BEADS_DB+x}" != x ] || fail "ambient BEADS_DB leaked"
|
|
12
|
+
[ "${BD_DB+x}" != x ] || fail "ambient BD_DB leaked"
|
|
13
|
+
|
|
14
|
+
fixture=
|
|
15
|
+
case "$#:$1" in
|
|
16
|
+
2:array)
|
|
17
|
+
[ "$2" = --json ] || fail "$@"
|
|
18
|
+
fixture=array.json
|
|
19
|
+
;;
|
|
20
|
+
3:object)
|
|
21
|
+
[ "$2" = demo-1 ] && [ "$3" = --json ] || fail "$@"
|
|
22
|
+
fixture=object.json
|
|
23
|
+
;;
|
|
24
|
+
2:empty)
|
|
25
|
+
[ "$2" = --json ] || fail "$@"
|
|
26
|
+
fixture=empty.json
|
|
27
|
+
;;
|
|
28
|
+
2:stdin)
|
|
29
|
+
[ "$2" = --json ] || fail "$@"
|
|
30
|
+
expected=$(mktemp)
|
|
31
|
+
actual=$(mktemp)
|
|
32
|
+
trap 'rm -f "$expected" "$actual"' EXIT
|
|
33
|
+
printf 'first line\nsecond line\n\nfinal line\n' > "$expected"
|
|
34
|
+
cat > "$actual"
|
|
35
|
+
cmp -s "$expected" "$actual" || fail "stdin did not round-trip"
|
|
36
|
+
printf '{"stdin":"accepted"}\n'
|
|
37
|
+
exit 0
|
|
38
|
+
;;
|
|
39
|
+
1:fail)
|
|
40
|
+
printf 'partial stdout\n'
|
|
41
|
+
printf 'failure detail\n' >&2
|
|
42
|
+
exit 23
|
|
43
|
+
;;
|
|
44
|
+
2:malformed)
|
|
45
|
+
[ "$2" = --json ] || fail "$@"
|
|
46
|
+
printf 'not JSON at all\n'
|
|
47
|
+
exit 0
|
|
48
|
+
;;
|
|
49
|
+
2:stderr)
|
|
50
|
+
[ "$2" = --json ] || fail "$@"
|
|
51
|
+
printf 'informational warning\n' >&2
|
|
52
|
+
fixture=object.json
|
|
53
|
+
;;
|
|
54
|
+
2:info)
|
|
55
|
+
[ "$2" = --json ] || fail "$@"
|
|
56
|
+
printf 'informational output\n'
|
|
57
|
+
fixture=object.json
|
|
58
|
+
;;
|
|
59
|
+
6:list)
|
|
60
|
+
if [ "$2" = --ready ] && [ "$3" = --limit ] && [ "$4" = 1 ] && [ "$5" = --no-parent ] && [ "$6" = --json ]; then
|
|
61
|
+
fixture=empty.json
|
|
62
|
+
elif [ "$2" = --ready ] && [ "$3" = --no-parent ] && [ "$4" = --limit ] && [ "$5" = 0 ] && [ "$6" = --json ]; then
|
|
63
|
+
fixture=ready.json
|
|
64
|
+
else
|
|
65
|
+
fail "$@"
|
|
66
|
+
fi
|
|
67
|
+
;;
|
|
68
|
+
9:list)
|
|
69
|
+
[ "$2" = --no-parent ] && [ "$3" = --status ] && [ "$4" = open,in_progress,blocked,deferred ] && \
|
|
70
|
+
[ "$5" = --label-pattern ] && [ "$6" = 'wf:*' ] && [ "$7" = --limit ] && [ "$8" = 0 ] && [ "$9" = --json ] || fail "$@"
|
|
71
|
+
fixture=claimed.json
|
|
72
|
+
;;
|
|
73
|
+
7:list)
|
|
74
|
+
[ "$2" = --parent ] && [ "$3" = demo-parent ] && [ "$4" = --all ] && [ "$5" = --limit ] && [ "$6" = 0 ] && [ "$7" = --json ] || fail "$@"
|
|
75
|
+
fixture=children.json
|
|
76
|
+
;;
|
|
77
|
+
3:show)
|
|
78
|
+
[ "$2" = demo-parent ] && [ "$3" = --json ] || fail "$@"
|
|
79
|
+
fixture=show.json
|
|
80
|
+
;;
|
|
81
|
+
3:comments)
|
|
82
|
+
[ "$2" = demo-parent ] && [ "$3" = --json ] || fail "$@"
|
|
83
|
+
fixture=comments.json
|
|
84
|
+
;;
|
|
85
|
+
11:create)
|
|
86
|
+
[ "$2" = demo-parent:implement ] && [ "$3" = --type ] && [ "$4" = task ] && \
|
|
87
|
+
[ "$5" = --parent ] && [ "$6" = demo-parent ] && [ "$7" = --no-inherit-labels ] && \
|
|
88
|
+
[ "$8" = --labels ] && [ "$9" = wf:implementation ] && [ "${10}" = --stdin ] && [ "${11}" = --json ] || fail "$@"
|
|
89
|
+
expected=$(mktemp)
|
|
90
|
+
actual=$(mktemp)
|
|
91
|
+
trap 'rm -f "$expected" "$actual"' EXIT
|
|
92
|
+
printf 'mailbox description\nsecond line\n' > "$expected"
|
|
93
|
+
cat > "$actual"
|
|
94
|
+
cmp -s "$expected" "$actual" || fail "create stdin did not round-trip"
|
|
95
|
+
fixture=created.json
|
|
96
|
+
;;
|
|
97
|
+
5:update)
|
|
98
|
+
if [ "$2" = demo-parent.1 ] && [ "$3" = --add-label ] && [ "$4" = wf:implementation ] && [ "$5" = --json ]; then
|
|
99
|
+
fixture=updated.json
|
|
100
|
+
elif [ "$2" = demo-parent.1 ] && [ "$3" = --status ] && [ "$4" = in_progress ] && [ "$5" = --json ]; then
|
|
101
|
+
fixture=updated.json
|
|
102
|
+
elif [ "$2" = demo-parent.1 ] && [ "$3" = --status ] && [ "$4" = closed ] && [ "$5" = --json ]; then
|
|
103
|
+
fixture=updated.json
|
|
104
|
+
elif [ "$2" = demo-parent.1 ] && [ "$3" = --assignee ] && [ "$4" = dev@example.com ] && [ "$5" = --json ]; then
|
|
105
|
+
fixture=updated.json
|
|
106
|
+
elif [ "$2" = demo-parent ] && [ "$3" = --add-label ] && [ "$4" = wf:implementation ] && [ "$5" = --json ]; then
|
|
107
|
+
fixture=updated.json
|
|
108
|
+
else
|
|
109
|
+
fail "$@"
|
|
110
|
+
fi
|
|
111
|
+
;;
|
|
112
|
+
6:update)
|
|
113
|
+
if [ "$2" = demo-parent.1 ] && [ "$3" = --description=- ] && [ "$4" = --add-label ] && [ "$5" = wf:implementation ] && [ "$6" = --json ]; then
|
|
114
|
+
expected=$(mktemp)
|
|
115
|
+
actual=$(mktemp)
|
|
116
|
+
trap 'rm -f "$expected" "$actual"' EXIT
|
|
117
|
+
printf 'reconciled description\nwith two lines\n' > "$expected"
|
|
118
|
+
cat > "$actual"
|
|
119
|
+
cmp -s "$expected" "$actual" || fail "description stdin did not round-trip"
|
|
120
|
+
fixture=updated.json
|
|
121
|
+
else
|
|
122
|
+
fail "$@"
|
|
123
|
+
fi
|
|
124
|
+
;;
|
|
125
|
+
7:update)
|
|
126
|
+
if { [ "$2" = demo-parent ] || [ "$2" = demo-parent.1 ]; } && [ "$3" = --status ] && [ "$4" = open ] && [ "$5" = --defer ] && [ -z "$6" ] && [ "$7" = --json ]; then
|
|
127
|
+
fixture=updated.json
|
|
128
|
+
elif [ "$2" = demo-parent.1 ] && [ "$3" = --status ] && [ "$4" = in_progress ] && [ "$5" = --assignee ] && [ "$6" = dev@example.com ] && [ "$7" = --json ]; then
|
|
129
|
+
fixture=updated.json
|
|
130
|
+
else
|
|
131
|
+
fail "$@"
|
|
132
|
+
fi
|
|
133
|
+
;;
|
|
134
|
+
4:comment)
|
|
135
|
+
[ "$2" = demo-parent.1 ] && [ "$3" = --stdin ] && [ "$4" = --json ] || fail "$@"
|
|
136
|
+
expected=$(mktemp)
|
|
137
|
+
actual=$(mktemp)
|
|
138
|
+
trap 'rm -f "$expected" "$actual"' EXIT
|
|
139
|
+
printf 'summary line\n\nsecond line\n' > "$expected"
|
|
140
|
+
cat > "$actual"
|
|
141
|
+
cmp -s "$expected" "$actual" || fail "comment stdin did not round-trip"
|
|
142
|
+
fixture=commented.json
|
|
143
|
+
;;
|
|
144
|
+
*)
|
|
145
|
+
fail "$@"
|
|
146
|
+
;;
|
|
147
|
+
esac
|
|
148
|
+
|
|
149
|
+
cat "$BD_FIXTURE_DIR/$fixture"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|