@atolis-hq/wake 0.3.95 → 0.3.96
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.
|
@@ -17,7 +17,15 @@ export function createSelfUpdateApplication(input) {
|
|
|
17
17
|
if (!force && (await input.ledger.isBad(tag))) {
|
|
18
18
|
continue;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
let updated;
|
|
21
|
+
try {
|
|
22
|
+
updated = await this.update(tag, force);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
if (error instanceof UpdateCandidateFailure)
|
|
26
|
+
continue;
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
21
29
|
if (updated) {
|
|
22
30
|
return { tag, updated: true };
|
|
23
31
|
}
|
|
@@ -81,21 +89,45 @@ async function runForwardUpdate(input, tag, attemptId, context) {
|
|
|
81
89
|
throw new Error('Self-update requires a clean source checkout');
|
|
82
90
|
await input.ledger.begin(tag);
|
|
83
91
|
await input.quiesce?.transition(UpdateMaintenancePhase.Updating, attemptId);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
let rollbackSucceeded = false;
|
|
93
|
+
let updated;
|
|
94
|
+
try {
|
|
95
|
+
updated = await runSelfUpdate({
|
|
96
|
+
tag,
|
|
97
|
+
force: true,
|
|
98
|
+
readLedger: input.ledger.read,
|
|
99
|
+
writeLedger: input.ledger.write,
|
|
100
|
+
update: async (nextTag) => {
|
|
101
|
+
await input.source.checkout(nextTag);
|
|
102
|
+
context.deployError = await deployRollout(input.rollout, nextTag);
|
|
103
|
+
},
|
|
104
|
+
health: async () => context.deployError === undefined && input.source.healthy(),
|
|
105
|
+
rollback: async (priorTag) => {
|
|
106
|
+
await rollbackUpdate(input, priorTag, attemptId);
|
|
107
|
+
rollbackSucceeded = true;
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
if (!rollbackSucceeded)
|
|
113
|
+
throw new UpdateRollbackError(error);
|
|
114
|
+
throw new UpdateCandidateFailure(error);
|
|
115
|
+
}
|
|
96
116
|
await input.quiesce?.clear(attemptId);
|
|
97
117
|
return updated;
|
|
98
118
|
}
|
|
119
|
+
class UpdateRollbackError extends Error {
|
|
120
|
+
constructor(error) {
|
|
121
|
+
super(formatError(error), { cause: error });
|
|
122
|
+
this.name = 'UpdateRollbackError';
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
class UpdateCandidateFailure extends Error {
|
|
126
|
+
constructor(error) {
|
|
127
|
+
super(formatError(error), { cause: error });
|
|
128
|
+
this.name = 'UpdateCandidateFailure';
|
|
129
|
+
}
|
|
130
|
+
}
|
|
99
131
|
async function deployRollout(rollout, tag) {
|
|
100
132
|
if (rollout === undefined)
|
|
101
133
|
return undefined;
|
package/dist/src/main.js
CHANGED
|
@@ -167,5 +167,12 @@ function runDocker(arguments_) {
|
|
|
167
167
|
: reject(new Error('docker ' + arguments_.join(' ') + ' exited with code ' + String(code))));
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href)
|
|
171
|
-
|
|
170
|
+
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
171
|
+
try {
|
|
172
|
+
await main();
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
process.stderr.write(`wake: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
176
|
+
process.exitCode = 1;
|
|
177
|
+
}
|
|
178
|
+
}
|
package/package.json
CHANGED
package/prompts/implement.md
CHANGED
|
@@ -32,6 +32,11 @@ Completion requirements:
|
|
|
32
32
|
- Include the pull request URL in your prose response.
|
|
33
33
|
- If you cannot safely complete the change, leave the workspace as-is and end
|
|
34
34
|
with BLOCKED or FAILED instead of guessing.
|
|
35
|
+
- Use `FAILED` when a required execution step cannot be completed, including
|
|
36
|
+
build or test failures, `git push` or `gh pr create` failures, or denied
|
|
37
|
+
tooling or sandbox access—even if the code itself is correct.
|
|
38
|
+
- Use `BLOCKED` only when completing the code change requires human
|
|
39
|
+
clarification, a decision, or judgment call.
|
|
35
40
|
|
|
36
41
|
Wake will provide the issue data and comments below in a delimited untrusted
|
|
37
42
|
data block.
|
|
@@ -50,4 +55,8 @@ Reminder of the completion requirements: commit, push {{branch}}, open a PR
|
|
|
50
55
|
with `gh pr create` referencing #{{issueNumber}}, and never merge it yourself. The
|
|
51
56
|
PR body must include the `<!-- wake:work-item {{workItemKey}} -->` marker
|
|
52
57
|
verbatim.
|
|
58
|
+
|
|
59
|
+
If you cannot safely complete the change, report `FAILED` when a required
|
|
60
|
+
execution step or tool access failed, and `BLOCKED` only when the code change
|
|
61
|
+
needs human clarification, a decision, or judgment call.
|
|
53
62
|
{{/if}}
|
package/prompts/refine.md
CHANGED
|
@@ -34,6 +34,10 @@ plan instead of asking. plan-review checks stated assumptions and rejects a
|
|
|
34
34
|
wrong one. Block only when the ticket's own intent can't be determined by
|
|
35
35
|
reading the repository.
|
|
36
36
|
|
|
37
|
+
If you cannot complete this stage, use `FAILED` when required repository or
|
|
38
|
+
tool access prevented the work. Use `BLOCKED` only when the issue requires
|
|
39
|
+
human clarification, a decision, or judgment call before it can proceed.
|
|
40
|
+
|
|
37
41
|
Wake will provide the issue data and comments below in a delimited untrusted
|
|
38
42
|
data block.
|
|
39
43
|
{{else}}
|
|
@@ -52,4 +56,9 @@ Wake will provide them below in a delimited untrusted data block.
|
|
|
52
56
|
|
|
53
57
|
Re-evaluate whether the issue is now well-specified enough to implement,
|
|
54
58
|
incorporating the new context above.
|
|
59
|
+
|
|
60
|
+
Use `FAILED` when required repository or tool access prevented this stage;
|
|
61
|
+
use `BLOCKED` only when the issue needs human clarification, a decision, or
|
|
62
|
+
judgment call. Merge conflicts remain `BLOCKED` because resolving them
|
|
63
|
+
requires judgment.
|
|
55
64
|
{{/if}}
|