@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.
@@ -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 — the dedicated `create_pr`
79
- node handles that via `github_create_pr` and its eval gate is what unblocks
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
- # Same rationale as the triage workflow: keep the implement node focused
86
- # on the repo. Bash stays available because `git add`/`git commit` and
87
- # test runners are essential.
88
- disallowed_tools:
89
- - WebFetch
90
- - WebSearch
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. Create the PR using `github_create_pr`. The PR title MUST start with the issue identifier in
102
- brackets: `[{context.input.issueIdentifier}] type: short description` (e.g. `[OFF-1234] fix: guard
103
- null projectId`).
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. Pass `labels: ["sweny", "agent", "task"]` to `github_create_pr` (or `["sweny", "agent", "feature"]` if the issue is a feature request).
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 URL.
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
- 2. Keep it concise — one message, not a wall of text.
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 — Too Complex
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