@quikit/quikpilot-runner 9.2.0-rc.6 → 9.2.0-rc.7
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 +12 -0
- package/dist/index.js +149 -5
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,18 @@ gains `targeting.loop_start`, `targeting.loop_turn`, `targeting.loop_refused`, `
|
|
|
43
43
|
and counts only, never content). Without the variable nothing changes. The workflow file is unchanged; the `env:` line
|
|
44
44
|
is the only edit, and it is optional.
|
|
45
45
|
|
|
46
|
+
**9.2.0 (release candidates) — repository commands no longer see the runner's credentials (always on).** Your setup,
|
|
47
|
+
lint, format and test commands, and the baseline checks, run code nobody has reviewed yet (new tests, a dependency's install
|
|
48
|
+
script). They used to inherit the runner's whole environment, which includes the variables GitHub gives a job that has
|
|
49
|
+
`id-token: write` and the addresses the runner reports to. They now run with an allow-listed environment: the search path,
|
|
50
|
+
home and locale, proxy and certificate settings, the toolchain locations the `setup-*` actions export (`JAVA_HOME`, `GOROOT`,
|
|
51
|
+
`CARGO_HOME`, `pythonLocation`, `PNPM_HOME`, ...), and the non-secret `GITHUB_*` and `RUNNER_*` context such as
|
|
52
|
+
`GITHUB_WORKSPACE`. Withheld: `ACTIONS_*`, `GITHUB_TOKEN`, the files that steer later steps of the job (`GITHUB_ENV`,
|
|
53
|
+
`GITHUB_PATH`, `GITHUB_OUTPUT`, `GITHUB_STATE`, `GITHUB_STEP_SUMMARY`), anything whose name reads like a credential, and the
|
|
54
|
+
runner's own inputs (`TOKEN_URL`, `RUN_ID`, ...). The job log says once, by name only, how many variables were withheld. A
|
|
55
|
+
command that needs a variable outside the list will no longer find it. The workflow file is unchanged. This is the second layer
|
|
56
|
+
of QUIKTR-1502; the first is that QuikTrack accepts one token exchange per start of a run.
|
|
57
|
+
|
|
46
58
|
**9.2.0 (release candidates) — the AI can look at the code and edit as it writes it (off by default).** Set
|
|
47
59
|
`QUIKPILOT_CODEGEN_MODE: loop` in the runner step's `env:` and the code-writing step stops making one blind call per file:
|
|
48
60
|
over several short turns the AI may use five tools, the three read-only ones above plus `edit_file` (replace one piece of
|
package/dist/index.js
CHANGED
|
@@ -94,10 +94,149 @@ async function reportBack(params) {
|
|
|
94
94
|
|
|
95
95
|
// src/commands.ts
|
|
96
96
|
var import_node_child_process = require("node:child_process");
|
|
97
|
+
|
|
98
|
+
// src/commandEnv.ts
|
|
99
|
+
var ALLOWED_NAMES = /* @__PURE__ */ new Set([
|
|
100
|
+
// Identity, locale and scratch space.
|
|
101
|
+
"PATH",
|
|
102
|
+
"Path",
|
|
103
|
+
"HOME",
|
|
104
|
+
"USER",
|
|
105
|
+
"USERNAME",
|
|
106
|
+
"LOGNAME",
|
|
107
|
+
"SHELL",
|
|
108
|
+
"HOSTNAME",
|
|
109
|
+
"TMPDIR",
|
|
110
|
+
"TMP",
|
|
111
|
+
"TEMP",
|
|
112
|
+
"TZ",
|
|
113
|
+
"LANG",
|
|
114
|
+
"LANGUAGE",
|
|
115
|
+
"TERM",
|
|
116
|
+
"COLORTERM",
|
|
117
|
+
"NO_COLOR",
|
|
118
|
+
"FORCE_COLOR",
|
|
119
|
+
"DISPLAY",
|
|
120
|
+
"CI",
|
|
121
|
+
// Windows system variables, for the developer machine.
|
|
122
|
+
"SystemRoot",
|
|
123
|
+
"SYSTEMROOT",
|
|
124
|
+
"windir",
|
|
125
|
+
"COMSPEC",
|
|
126
|
+
"PATHEXT",
|
|
127
|
+
"USERPROFILE",
|
|
128
|
+
"APPDATA",
|
|
129
|
+
"LOCALAPPDATA",
|
|
130
|
+
// Network settings a hosted or self-hosted runner may rely on.
|
|
131
|
+
"HTTP_PROXY",
|
|
132
|
+
"HTTPS_PROXY",
|
|
133
|
+
"NO_PROXY",
|
|
134
|
+
"ALL_PROXY",
|
|
135
|
+
"http_proxy",
|
|
136
|
+
"https_proxy",
|
|
137
|
+
"no_proxy",
|
|
138
|
+
"all_proxy",
|
|
139
|
+
"SSL_CERT_FILE",
|
|
140
|
+
"SSL_CERT_DIR",
|
|
141
|
+
"NODE_EXTRA_CA_CERTS",
|
|
142
|
+
"REQUESTS_CA_BUNDLE",
|
|
143
|
+
"CURL_CA_BUNDLE",
|
|
144
|
+
// Toolchain locations the setup-* actions and the runner image export.
|
|
145
|
+
"NODE_OPTIONS",
|
|
146
|
+
"NODE_PATH",
|
|
147
|
+
"NVM_DIR",
|
|
148
|
+
"ImageOS",
|
|
149
|
+
"ImageVersion",
|
|
150
|
+
"AGENT_TOOLSDIRECTORY",
|
|
151
|
+
"CONDA",
|
|
152
|
+
"pythonLocation",
|
|
153
|
+
"PKG_CONFIG_PATH",
|
|
154
|
+
"LD_LIBRARY_PATH",
|
|
155
|
+
"CARGO_HOME",
|
|
156
|
+
"RUSTUP_HOME",
|
|
157
|
+
"GOPATH",
|
|
158
|
+
"GOMODCACHE",
|
|
159
|
+
"GOCACHE",
|
|
160
|
+
"GOFLAGS",
|
|
161
|
+
"JAVA_HOME",
|
|
162
|
+
"GRADLE_HOME",
|
|
163
|
+
"GRADLE_USER_HOME",
|
|
164
|
+
"MAVEN_HOME",
|
|
165
|
+
"M2_HOME",
|
|
166
|
+
"ANDROID_HOME",
|
|
167
|
+
"ANDROID_SDK_ROOT",
|
|
168
|
+
"GEM_HOME",
|
|
169
|
+
"GEM_PATH",
|
|
170
|
+
"BUNDLE_PATH",
|
|
171
|
+
"PIPX_HOME",
|
|
172
|
+
"PIPX_BIN_DIR",
|
|
173
|
+
"POETRY_HOME",
|
|
174
|
+
"PNPM_HOME",
|
|
175
|
+
"BUN_INSTALL",
|
|
176
|
+
"DENO_INSTALL",
|
|
177
|
+
"DENO_DIR",
|
|
178
|
+
"VOLTA_HOME",
|
|
179
|
+
"COREPACK_HOME",
|
|
180
|
+
"PYENV_ROOT",
|
|
181
|
+
"RBENV_ROOT"
|
|
182
|
+
]);
|
|
183
|
+
var ALLOWED_PREFIXES = [
|
|
184
|
+
"LC_",
|
|
185
|
+
"RUNNER_",
|
|
186
|
+
"GITHUB_",
|
|
187
|
+
"JAVA_HOME_",
|
|
188
|
+
"GOROOT",
|
|
189
|
+
"ANDROID_NDK",
|
|
190
|
+
"Python",
|
|
191
|
+
// Python_ROOT_DIR, Python2_ROOT_DIR, Python3_ROOT_DIR
|
|
192
|
+
"XDG_",
|
|
193
|
+
"DOTNET_",
|
|
194
|
+
"VCPKG_",
|
|
195
|
+
"npm_config_",
|
|
196
|
+
"NPM_CONFIG_"
|
|
197
|
+
];
|
|
198
|
+
var ALWAYS_WITHHELD = /* @__PURE__ */ new Set([
|
|
199
|
+
"GITHUB_TOKEN",
|
|
200
|
+
"GITHUB_ENV",
|
|
201
|
+
"GITHUB_PATH",
|
|
202
|
+
"GITHUB_OUTPUT",
|
|
203
|
+
"GITHUB_STATE",
|
|
204
|
+
"GITHUB_STEP_SUMMARY"
|
|
205
|
+
]);
|
|
206
|
+
var CREDENTIAL_NAME = /(token|secret|password|passwd|credential|private_?key|api_?key)/i;
|
|
207
|
+
function isAllowed(name) {
|
|
208
|
+
if (ALWAYS_WITHHELD.has(name) || CREDENTIAL_NAME.test(name)) return false;
|
|
209
|
+
if (ALLOWED_NAMES.has(name)) return true;
|
|
210
|
+
return ALLOWED_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
211
|
+
}
|
|
212
|
+
function commandEnv(source = process.env) {
|
|
213
|
+
const out = {};
|
|
214
|
+
for (const [name, value] of Object.entries(source)) {
|
|
215
|
+
if (value === void 0) continue;
|
|
216
|
+
if (isAllowed(name)) out[name] = value;
|
|
217
|
+
}
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
220
|
+
function withheldNames(source = process.env) {
|
|
221
|
+
return Object.entries(source).filter(([name, value]) => value !== void 0 && !isAllowed(name)).map(([name]) => name).sort();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// src/commands.ts
|
|
225
|
+
var withheldLogged = false;
|
|
226
|
+
function repositoryCommandEnv() {
|
|
227
|
+
if (!withheldLogged) {
|
|
228
|
+
withheldLogged = true;
|
|
229
|
+
const names = withheldNames();
|
|
230
|
+
if (names.length > 0) {
|
|
231
|
+
console.log(`Repository commands run without ${names.length} environment variable(s): ${names.join(", ")}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return commandEnv();
|
|
235
|
+
}
|
|
97
236
|
function runCommand(command, label) {
|
|
98
237
|
if (!command) return;
|
|
99
238
|
try {
|
|
100
|
-
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit" });
|
|
239
|
+
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit", env: repositoryCommandEnv() });
|
|
101
240
|
} catch (err) {
|
|
102
241
|
throw new Error(`${label} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
103
242
|
}
|
|
@@ -105,7 +244,7 @@ function runCommand(command, label) {
|
|
|
105
244
|
function runTestCommand(command) {
|
|
106
245
|
if (!command) return "success";
|
|
107
246
|
try {
|
|
108
|
-
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit" });
|
|
247
|
+
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit", env: repositoryCommandEnv() });
|
|
109
248
|
return "success";
|
|
110
249
|
} catch {
|
|
111
250
|
return "failure";
|
|
@@ -114,7 +253,7 @@ function runTestCommand(command) {
|
|
|
114
253
|
function runTestCommandAsync(command) {
|
|
115
254
|
if (!command) return Promise.resolve("success");
|
|
116
255
|
return new Promise((resolve5) => {
|
|
117
|
-
const child = (0, import_node_child_process.spawn)(command, { shell: "/bin/bash", stdio: "inherit" });
|
|
256
|
+
const child = (0, import_node_child_process.spawn)(command, { shell: "/bin/bash", stdio: "inherit", env: repositoryCommandEnv() });
|
|
118
257
|
child.on("exit", (code) => resolve5(code === 0 ? "success" : "failure"));
|
|
119
258
|
child.on("error", () => resolve5("failure"));
|
|
120
259
|
});
|
|
@@ -128,7 +267,12 @@ function runCommandWithTimeout(command, timeoutMs) {
|
|
|
128
267
|
clearTimeout(timer);
|
|
129
268
|
resolve5(outcome);
|
|
130
269
|
};
|
|
131
|
-
const child = (0, import_node_child_process.spawn)(command, {
|
|
270
|
+
const child = (0, import_node_child_process.spawn)(command, {
|
|
271
|
+
shell: "/bin/bash",
|
|
272
|
+
stdio: "inherit",
|
|
273
|
+
detached: true,
|
|
274
|
+
env: repositoryCommandEnv()
|
|
275
|
+
});
|
|
132
276
|
const timer = setTimeout(() => {
|
|
133
277
|
try {
|
|
134
278
|
if (child.pid !== void 0) process.kill(-child.pid, "SIGKILL");
|
|
@@ -3607,7 +3751,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
|
|
|
3607
3751
|
var REPORT_COPY = "final-test-report.xml";
|
|
3608
3752
|
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
3609
3753
|
var MAX_FILES = 200;
|
|
3610
|
-
var RUNNER_VERSION = true ? "9.2.0-rc.
|
|
3754
|
+
var RUNNER_VERSION = true ? "9.2.0-rc.7" : "dev";
|
|
3611
3755
|
function safeDestination(base, repoPath) {
|
|
3612
3756
|
if (!repoPath || (0, import_node_path9.isAbsolute)(repoPath)) return null;
|
|
3613
3757
|
const destination = (0, import_node_path9.resolve)(base, repoPath);
|