@sweny-ai/core 0.1.149 → 0.1.151
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/dist/cli/builtin-workflows.d.ts +45 -0
- package/dist/cli/builtin-workflows.js +129 -0
- package/dist/cli/check.d.ts +2 -8
- package/dist/cli/check.js +2 -34
- package/dist/cli/config.js +2 -0
- package/dist/cli/main.js +49 -13
- package/dist/cli/packs.d.ts +9 -5
- package/dist/cli/packs.js +100 -50
- package/dist/executor.js +15 -3
- package/dist/harness/auth.d.ts +38 -0
- package/dist/harness/auth.js +93 -0
- package/dist/harness/claude-code.d.ts +8 -0
- package/dist/harness/claude-code.js +8 -1
- package/dist/harness/codex.d.ts +10 -1
- package/dist/harness/codex.js +17 -3
- package/dist/harness/pi.js +14 -3
- package/dist/harness/policy.js +6 -0
- package/dist/harness/tool-bridge/server.d.ts +20 -0
- package/dist/harness/tool-bridge/server.js +27 -10
- package/dist/harness/tool-bridge/shim.d.ts +41 -4
- package/dist/harness/tool-bridge/shim.js +118 -17
- package/dist/harness/types.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/node-policy.js +1 -0
- package/dist/safe-outputs.d.ts +17 -5
- package/dist/safe-outputs.js +85 -11
- package/dist/schema.d.ts +80 -0
- package/dist/schema.js +23 -0
- package/dist/types.d.ts +13 -0
- package/dist/workflows/browser.js +2 -2
- package/dist/workflows/implement.yml +61 -19
- package/dist/workflows/triage.yml +171 -139
- package/package.json +1 -1
|
@@ -3,6 +3,13 @@ name: Implement Fix
|
|
|
3
3
|
workflow_type: pr_review
|
|
4
4
|
description: Implement a code fix for an issue and open a pull request
|
|
5
5
|
entry: analyze
|
|
6
|
+
# Ceiling (#365). `write` because implement and create_pr change code in the
|
|
7
|
+
# checkout and push a branch; analyze and skip narrow to `read`. External
|
|
8
|
+
# writes (the PR, a comment on the issue) happen only as declared outputs.
|
|
9
|
+
permissions: write
|
|
10
|
+
safe_outputs:
|
|
11
|
+
allow: [comment, pr]
|
|
12
|
+
max: 3
|
|
6
13
|
nodes:
|
|
7
14
|
analyze:
|
|
8
15
|
name: Analyze Issue
|
|
@@ -34,6 +41,8 @@ nodes:
|
|
|
34
41
|
skills:
|
|
35
42
|
- github
|
|
36
43
|
- linear
|
|
44
|
+
# #365: analysis only. No write tool or write-capable built-in reaches it.
|
|
45
|
+
permissions: read
|
|
37
46
|
output:
|
|
38
47
|
type: object
|
|
39
48
|
properties:
|
|
@@ -75,19 +84,26 @@ nodes:
|
|
|
75
84
|
4. Stage and commit. Start the commit message with the issue identifier
|
|
76
85
|
in brackets, e.g. `[OFF-1234] fix: guard null projectId`.
|
|
77
86
|
|
|
78
|
-
Stop after the commit. Do NOT push or open the PR
|
|
79
|
-
node
|
|
80
|
-
the rest of the workflow.
|
|
87
|
+
Stop after the commit. Do NOT push or open the PR: the dedicated `create_pr`
|
|
88
|
+
node pushes the branch and requests the PR.
|
|
81
89
|
|
|
82
90
|
If the fix is too risky or complex, explain why and skip.
|
|
83
91
|
skills:
|
|
84
92
|
- github
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
# test runners
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
# A write node on purpose (#365): the code change itself. It edits files
|
|
94
|
+
# and commits, which needs file edits and a shell (`git add`/`git commit`,
|
|
95
|
+
# test runners). Same rationale as the triage workflow: keep it on the
|
|
96
|
+
# repo, no web (`deny: [net]`, portable across harnesses), and no GitHub
|
|
97
|
+
# write tool (the PR is create_pr's declared output).
|
|
98
|
+
permissions:
|
|
99
|
+
access: write
|
|
100
|
+
deny: [net]
|
|
101
|
+
tools:
|
|
102
|
+
deny:
|
|
103
|
+
- github_create_pr
|
|
104
|
+
- github_create_issue
|
|
105
|
+
- github_add_comment
|
|
106
|
+
- github_add_labels
|
|
91
107
|
create_pr:
|
|
92
108
|
name: Open Pull Request
|
|
93
109
|
# A failed PR must not stop the run: the only edge is an unconditional one to notify.
|
|
@@ -98,15 +114,18 @@ nodes:
|
|
|
98
114
|
|
|
99
115
|
1. Push the branch to the remote.
|
|
100
116
|
|
|
101
|
-
2.
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
2. Request the PR: with `emit_output` (type `pr`, `head` = the branch, `base` = the base branch,
|
|
118
|
+
default `main`) when you have it; sweny opens it after this step and reuses an open PR for the same
|
|
119
|
+
branch instead of failing. Without `emit_output`, call `github_create_pr`. The PR title MUST start
|
|
120
|
+
with the issue identifier in brackets: `[{context.input.issueIdentifier}] type: short description`
|
|
121
|
+
(e.g. `[OFF-1234] fix: guard null projectId`).
|
|
104
122
|
|
|
105
123
|
3. Reference the original issue in the PR body. If the issue tracker is Linear, include the line
|
|
106
124
|
"Fixes {context.input.issueIdentifier}" (e.g. "Fixes OFF-1234") so Linear links the PR and moves
|
|
107
125
|
the issue to Done on merge.
|
|
108
126
|
|
|
109
|
-
4.
|
|
127
|
+
4. Labels: add `task` (or `feature` if the issue is a feature request); `sweny` and `agent` are
|
|
128
|
+
always added.
|
|
110
129
|
|
|
111
130
|
|
|
112
131
|
If context.prTemplate is provided, use it as the format for the PR body. Otherwise use a clear structure with:
|
|
@@ -117,27 +136,50 @@ nodes:
|
|
|
117
136
|
sweny:run_id:{context.cloudRunId} -->
|
|
118
137
|
|
|
119
138
|
|
|
120
|
-
Return the PR
|
|
139
|
+
Return the branch and the PR title you requested.
|
|
121
140
|
skills:
|
|
122
141
|
- github
|
|
142
|
+
# A write node on purpose (#365): pushing the branch ships the code change
|
|
143
|
+
# and needs git in a shell. The PR itself is a declared output, so the
|
|
144
|
+
# agent never holds the PR write; no GitHub write tool is registered here.
|
|
145
|
+
permissions: write
|
|
146
|
+
outputs:
|
|
147
|
+
- type: pr
|
|
148
|
+
max: 1
|
|
149
|
+
labels: [sweny, agent]
|
|
150
|
+
tools:
|
|
151
|
+
deny:
|
|
152
|
+
- github_create_pr
|
|
153
|
+
- github_create_issue
|
|
154
|
+
- github_add_comment
|
|
155
|
+
- github_add_labels
|
|
123
156
|
notify:
|
|
124
157
|
name: Notify
|
|
125
158
|
instruction: |-
|
|
126
159
|
Send a notification about the implementation result:
|
|
127
160
|
|
|
128
|
-
1. Include: issue reference, PR link, brief summary of changes.
|
|
129
|
-
|
|
161
|
+
1. Include: issue reference, PR link, brief summary of changes. The PR sweny opened is in
|
|
162
|
+
`context.create_pr.safe_outputs` (`ref` and `url` of the `applied` entry).
|
|
163
|
+
2. Keep it concise: one message, not a wall of text.
|
|
164
|
+
3. If any `safe_outputs` entry has status `staged`, this run is a preview: send nothing, and put the
|
|
165
|
+
notification you would have sent in your summary.
|
|
130
166
|
skills:
|
|
131
167
|
- slack
|
|
132
168
|
- notification
|
|
133
169
|
skip:
|
|
134
|
-
name: Skip
|
|
170
|
+
name: Skip - Too Complex
|
|
135
171
|
instruction: |-
|
|
136
172
|
The fix was determined to be too complex or risky for automated implementation.
|
|
137
|
-
Add a comment to the issue explaining what was found and why it needs manual attention
|
|
173
|
+
Add a comment to the issue explaining what was found and why it needs manual attention
|
|
174
|
+
(with `emit_output` type `comment` when you have it).
|
|
138
175
|
skills:
|
|
139
|
-
- github
|
|
140
176
|
- linear
|
|
177
|
+
- github
|
|
178
|
+
# #365: one comment, and only on the issue this run is for.
|
|
179
|
+
outputs:
|
|
180
|
+
- type: comment
|
|
181
|
+
max: 1
|
|
182
|
+
number: { input: issueIdentifier }
|
|
141
183
|
edges:
|
|
142
184
|
- from: analyze
|
|
143
185
|
to: notify
|