waypoint-codex 1.0.16 → 1.0.18
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/src/upgrade.js
CHANGED
|
@@ -76,18 +76,90 @@ export function compareVersions(left, right) {
|
|
|
76
76
|
}
|
|
77
77
|
return 0;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const
|
|
81
|
-
const latest = spawnSync(npmBinary, ["view", "waypoint-codex", "version"], {
|
|
79
|
+
function spawnNpmPipe(npmBinary, args) {
|
|
80
|
+
const result = spawnSync(npmBinary, args, {
|
|
82
81
|
stdio: "pipe",
|
|
83
82
|
encoding: "utf8",
|
|
84
83
|
});
|
|
85
|
-
|
|
84
|
+
return {
|
|
85
|
+
status: result.status ?? 1,
|
|
86
|
+
stdout: result.stdout ?? "",
|
|
87
|
+
stderr: result.stderr ?? "",
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function writePipedOutput(result, stdio) {
|
|
91
|
+
if (stdio !== "inherit") {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (result.stdout.length > 0) {
|
|
95
|
+
process.stdout.write(result.stdout);
|
|
96
|
+
}
|
|
97
|
+
if (result.stderr.length > 0) {
|
|
98
|
+
process.stderr.write(result.stderr);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function latestWaypointVersion(options) {
|
|
102
|
+
const npmBinary = options.npmBinary ?? process.env.WAYPOINT_NPM_COMMAND ?? npmBinaryForPlatform();
|
|
103
|
+
const latest = spawnNpmPipe(npmBinary, ["view", "waypoint-codex", "version"]);
|
|
104
|
+
if (latest.status !== 0) {
|
|
86
105
|
return null;
|
|
87
106
|
}
|
|
88
|
-
const version = latest.stdout
|
|
107
|
+
const version = latest.stdout.trim();
|
|
89
108
|
return version ? version : null;
|
|
90
109
|
}
|
|
110
|
+
function latestWaypointTarballUrl(options) {
|
|
111
|
+
const tarball = spawnNpmPipe(options.npmBinary, ["view", `waypoint-codex@${options.version}`, "dist.tarball"]);
|
|
112
|
+
if (tarball.status !== 0) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const tarballUrl = tarball.stdout.trim();
|
|
116
|
+
return tarballUrl.length > 0 ? tarballUrl : null;
|
|
117
|
+
}
|
|
118
|
+
function appendCacheBust(url) {
|
|
119
|
+
try {
|
|
120
|
+
const parsed = new URL(url);
|
|
121
|
+
parsed.searchParams.set("waypointCacheBust", `${Date.now()}`);
|
|
122
|
+
return parsed.toString();
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
const separator = url.includes("?") ? "&" : "?";
|
|
126
|
+
return `${url}${separator}waypointCacheBust=${Date.now()}`;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function isTransientTarball404(result) {
|
|
130
|
+
const combined = `${result.stdout}\n${result.stderr}`;
|
|
131
|
+
return /E404/.test(combined) && /waypoint-codex-.*\.tgz/i.test(combined);
|
|
132
|
+
}
|
|
133
|
+
function installLatestWaypointCli(options) {
|
|
134
|
+
const primary = spawnNpmPipe(options.npmBinary, ["install", "-g", "waypoint-codex@latest"]);
|
|
135
|
+
if (primary.status === 0) {
|
|
136
|
+
writePipedOutput(primary, options.stdio);
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
if (!isTransientTarball404(primary)) {
|
|
140
|
+
writePipedOutput(primary, options.stdio);
|
|
141
|
+
return primary.status;
|
|
142
|
+
}
|
|
143
|
+
const latestVersion = options.knownLatestVersion ?? latestWaypointVersion({ npmBinary: options.npmBinary });
|
|
144
|
+
if (!latestVersion) {
|
|
145
|
+
writePipedOutput(primary, options.stdio);
|
|
146
|
+
return primary.status;
|
|
147
|
+
}
|
|
148
|
+
const tarballUrl = latestWaypointTarballUrl({
|
|
149
|
+
npmBinary: options.npmBinary,
|
|
150
|
+
version: latestVersion,
|
|
151
|
+
});
|
|
152
|
+
if (!tarballUrl) {
|
|
153
|
+
writePipedOutput(primary, options.stdio);
|
|
154
|
+
return primary.status;
|
|
155
|
+
}
|
|
156
|
+
if (options.stdio === "inherit") {
|
|
157
|
+
console.log(`Waypoint npm install hit a transient tarball 404 for ${latestVersion}. Retrying with cache-busted URL...`);
|
|
158
|
+
}
|
|
159
|
+
const fallback = spawnNpmPipe(options.npmBinary, ["install", "-g", appendCacheBust(tarballUrl)]);
|
|
160
|
+
writePipedOutput(fallback, options.stdio);
|
|
161
|
+
return fallback.status;
|
|
162
|
+
}
|
|
91
163
|
function hasWaypointConfig(projectRoot) {
|
|
92
164
|
return existsSync(path.join(projectRoot, ".waypoint/config.toml"));
|
|
93
165
|
}
|
|
@@ -95,11 +167,12 @@ export function upgradeWaypoint(options) {
|
|
|
95
167
|
const nodeBinary = options.nodeBinary ?? process.execPath;
|
|
96
168
|
const npmBinary = options.npmBinary ?? process.env.WAYPOINT_NPM_COMMAND ?? npmBinaryForPlatform();
|
|
97
169
|
const stdio = options.stdio ?? "inherit";
|
|
98
|
-
const
|
|
170
|
+
const updateStatus = installLatestWaypointCli({
|
|
171
|
+
npmBinary,
|
|
99
172
|
stdio,
|
|
100
173
|
});
|
|
101
|
-
if (
|
|
102
|
-
return
|
|
174
|
+
if (updateStatus !== 0) {
|
|
175
|
+
return updateStatus;
|
|
103
176
|
}
|
|
104
177
|
if (options.skipRepoRefresh) {
|
|
105
178
|
console.log("Waypoint CLI updated. Skipped repo refresh.");
|
|
@@ -129,11 +202,13 @@ export function maybeUpgradeWaypointBeforeInit(options) {
|
|
|
129
202
|
return null;
|
|
130
203
|
}
|
|
131
204
|
console.log(`Waypoint CLI ${options.currentVersion} is older than latest ${latestVersion}. Updating before init...`);
|
|
132
|
-
const
|
|
205
|
+
const updateStatus = installLatestWaypointCli({
|
|
206
|
+
npmBinary,
|
|
133
207
|
stdio,
|
|
208
|
+
knownLatestVersion: latestVersion,
|
|
134
209
|
});
|
|
135
|
-
if (
|
|
136
|
-
return
|
|
210
|
+
if (updateStatus !== 0) {
|
|
211
|
+
return updateStatus;
|
|
137
212
|
}
|
|
138
213
|
const reexecArgs = options.initArgs.includes("--skip-cli-update")
|
|
139
214
|
? options.initArgs
|
package/package.json
CHANGED
|
@@ -1,81 +1,71 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pr-review
|
|
3
|
-
description:
|
|
3
|
+
description: Run and close the full PR review loop with CodeRabbit and Codex reviewers. Use when a PR already has review activity or when you need to request, wait for, triage, fix, and re-request automated review until no meaningful issues remain and CI/CD is green.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# PR
|
|
6
|
+
# PR review
|
|
7
7
|
|
|
8
|
-
Use this skill to drive
|
|
8
|
+
Use this skill to drive an open PR through reviewer and CI/CD convergence. This is a loop, not a one-shot comment sweep.
|
|
9
9
|
|
|
10
|
-
## When
|
|
10
|
+
## When To Use
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
12
|
+
- Use when PR comments already exist (human or automated).
|
|
13
|
+
- Use when CodeRabbit or Codex review is expected for the PR.
|
|
14
|
+
- Use when CI/CD checks are part of merge readiness.
|
|
14
15
|
|
|
15
|
-
##
|
|
16
|
+
## Core Loop
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
- If CI is red or pending, inspect the failed check logs before triaging review comments so you do not chase comment fixes while a separate blocker is breaking the branch.
|
|
19
|
-
- If automated review is still running, wait for it to finish instead of racing it.
|
|
20
|
-
- Treat placeholder messages such as CodeRabbit's "review in progress" as unfinished state, not as a meaningful review result.
|
|
21
|
-
- If an automated reviewer like CodeRabbit is still pending, in progress, or has not reached a green/completed check state yet, keep waiting before you conclude there are no findings.
|
|
22
|
-
- Once the automated reviewer check turns green/completed, reread the review comments and threads because the real findings may only appear after the placeholder state clears.
|
|
23
|
-
- If comments are still arriving, do not prematurely declare the loop complete.
|
|
24
|
-
- For stacked or non-`main` PRs, explicitly compare the PR head against its base branch and make sure later fixes on the base branch have actually been merged or rebased forward. Do not assume a sibling/base PR fix is already present in the dependent PR.
|
|
25
|
-
- Keep waiting as long as required. Do not interrupt or abandon the review loop just because CI, reviewers, or automated checks are taking a long time.
|
|
18
|
+
Run this loop until exit criteria are satisfied.
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
1. Load PR state:
|
|
21
|
+
- collect all current review threads and comments, including existing comments present before the skill started
|
|
22
|
+
- collect CI/CD status for required checks
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
24
|
+
2. Triage and act:
|
|
25
|
+
- treat each reviewer finding as actionable unless it is clearly a false positive
|
|
26
|
+
- fix all non-false-positive findings in code/docs/tests
|
|
27
|
+
- if CI/CD has failures, fix those failures as part of the same loop
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
3. Thread discipline for every addressed or skipped finding:
|
|
30
|
+
- post an inline reply on that thread explaining the fix or why it is a false positive
|
|
31
|
+
- resolve the thread after replying
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
4. Push and re-request automated review:
|
|
34
|
+
- push commits
|
|
35
|
+
- post comment: `@coderabbitai review`
|
|
36
|
+
- post comment: `@codex review`
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
38
|
+
5. Wait for review/check updates:
|
|
39
|
+
- wait up to 30 minutes total
|
|
40
|
+
- check every 5 minutes using a sleep interval (`sleep 300`)
|
|
41
|
+
- on each check, re-read both review and CI/CD status
|
|
42
|
+
- if meaningful findings or CI/CD failures appear, continue the loop immediately
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
## Exit Criteria
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
You may end the loop only when all are true:
|
|
46
47
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
- if CI or review is still in flight, keep waiting instead of assuming your last push ended the process
|
|
53
|
-
- before declaring the PR clear or ready, make sure the required Waypoint reviewer agents for this slice have actually run and that their real findings, if any, were handled
|
|
48
|
+
- no unresolved meaningful CodeRabbit findings remain
|
|
49
|
+
- no unresolved meaningful Codex findings remain
|
|
50
|
+
- every addressed or skipped finding has an inline reply and is resolved
|
|
51
|
+
- CI/CD is green (or explicitly non-blocking per repo policy)
|
|
52
|
+
- the latest reviewer rounds contain no meaningful new issues
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
Never cut the loop short by forcing a partial return from still-running review or verification systems.
|
|
57
|
-
The loop is not complete while any meaningful review thread still lacks an inline response.
|
|
58
|
-
The loop is also not complete if required Waypoint reviewer-agent passes for the current slice have not been run yet.
|
|
54
|
+
## Required Behavior
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
- Do not ignore existing comments that were already open when the skill was invoked.
|
|
57
|
+
- Do not stop after one pass if reviewer bots are still producing new findings.
|
|
58
|
+
- Do not mark false positives without a concrete reason in the inline reply.
|
|
59
|
+
- Do not leave handled threads unresolved.
|
|
60
|
+
- Do not declare completion while CI/CD is failing for actionable reasons.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
## Output Contract
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
- what was intentionally declined
|
|
66
|
-
- what verification ran
|
|
67
|
-
- whether the PR is clear or still waiting on reviewer response
|
|
64
|
+
Before finishing, report:
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- Do not declare the PR clear if the required repo-level reviewer passes have not actually run.
|
|
76
|
-
|
|
77
|
-
## Keep This Skill Sharp
|
|
78
|
-
|
|
79
|
-
- Add new gotchas when the same PR-review failure mode, automation blind spot, or reviewer-state confusion keeps recurring.
|
|
80
|
-
- Tighten the description if the skill fires before review has actually started or misses real prompts about "address these PR comments" or "close the loop on this PR."
|
|
81
|
-
- If the workflow keeps repeating the same review-system quirks, preserve them in the skill instead of letting them stay as one-off chat lessons.
|
|
66
|
+
- total loop rounds executed
|
|
67
|
+
- fixes made for reviewer findings
|
|
68
|
+
- false positives skipped with rationale
|
|
69
|
+
- CI/CD failures fixed
|
|
70
|
+
- links or identifiers for final reviewer rounds checked
|
|
71
|
+
- final status: `clear` or `still blocked`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "PR Review"
|
|
3
|
-
short_description: "Close the review loop
|
|
4
|
-
default_prompt: "Use $pr-review
|
|
3
|
+
short_description: "Close the review loop with CodeRabbit, Codex, and CI/CD"
|
|
4
|
+
default_prompt: "Use $pr-review: address all existing PR review findings, fix actionable CI/CD failures, reply inline and resolve each handled thread, push fixes, comment '@coderabbitai review' and '@codex review', then poll every 5 minutes for up to 30 minutes per round until no meaningful new issues remain."
|