vibe-coding-master 0.7.18 → 0.7.19
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.
|
@@ -11,7 +11,7 @@ The hard ceiling is 60 minutes per job, enforced by the job worker itself. No ap
|
|
|
11
11
|
|
|
12
12
|
## Protocol
|
|
13
13
|
|
|
14
|
-
1. Start the command with an explicit ceiling: \`.ai/tools/run-long-check --timeout <duration> -- <command>\`. Pick the ceiling from \`docs/TESTING.md\` guidance or a realistic estimate, never above 60m. The tool prints the job id and creates job state under \`.ai/vcm/jobs/<job-id>/\`.
|
|
14
|
+
1. Start the command with an explicit ceiling: \`.ai/tools/run-long-check --timeout <duration> -- <command>\`. Pass the validation executable and its arguments directly. Do not use a shell command-string wrapper, pipeline its output, or append another command: run-long-check already captures stdout/stderr, and shell wrappers can hide the validation exit code. Pick the ceiling from \`docs/TESTING.md\` guidance or a realistic estimate, never above 60m. The tool prints the job id and creates job state under \`.ai/vcm/jobs/<job-id>/\`.
|
|
15
15
|
2. In the same turn, run \`.ai/tools/watch-job <job-id>\`. The default watch window is 8 minutes.
|
|
16
16
|
3. If watch-job exits 125, the job is still running: run \`.ai/tools/watch-job <job-id>\` again immediately. Do not end the turn between windows.
|
|
17
17
|
4. Repeat until watch-job reports a terminal result.
|
package/package.json
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
Usage:
|
|
5
5
|
.ai/tools/run-long-check [--timeout <duration>] -- <command> [args...]
|
|
6
6
|
|
|
7
|
+
Pass the validation executable and its arguments directly. Shell command-string
|
|
8
|
+
wrappers are rejected because they can hide the validation command's exit code.
|
|
9
|
+
|
|
7
10
|
The command runs in a detached worker process group. The worker itself
|
|
8
11
|
enforces the job ceiling (--timeout, max 60m) and a supervision lease: when
|
|
9
12
|
no foreground watcher renews .ai/vcm/jobs/<job-id>/lease, the worker kills
|
|
@@ -28,6 +31,7 @@ QUEUED_STALE_SECONDS = 60
|
|
|
28
31
|
ACTIVE_STATUSES = {"queued", "starting", "running"}
|
|
29
32
|
DEFAULT_LEASE_START_GRACE_SECONDS = 300
|
|
30
33
|
DEFAULT_LEASE_RENEW_GRACE_SECONDS = 120
|
|
34
|
+
SHELL_EXECUTABLES = {"sh", "bash", "zsh", "dash", "ksh", "fish", "csh", "tcsh"}
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
def root_dir() -> Path:
|
|
@@ -83,6 +87,25 @@ def job_id() -> str:
|
|
|
83
87
|
return f"{timestamp}-{uuid.uuid4().hex[:8]}"
|
|
84
88
|
|
|
85
89
|
|
|
90
|
+
def shell_command_wrapper(command: list[str]) -> str | None:
|
|
91
|
+
if not command:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
candidates = range(len(command)) if Path(command[0]).name == "env" else range(1)
|
|
95
|
+
for index in candidates:
|
|
96
|
+
executable = Path(command[index]).name
|
|
97
|
+
if executable not in SHELL_EXECUTABLES:
|
|
98
|
+
continue
|
|
99
|
+
if any(
|
|
100
|
+
option.startswith("-")
|
|
101
|
+
and not option.startswith("--")
|
|
102
|
+
and "c" in option[1:]
|
|
103
|
+
for option in command[index + 1:]
|
|
104
|
+
):
|
|
105
|
+
return executable
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
|
|
86
109
|
def process_exists(pid: int) -> bool:
|
|
87
110
|
try:
|
|
88
111
|
os.kill(pid, 0)
|
|
@@ -394,7 +417,23 @@ def main() -> int:
|
|
|
394
417
|
)
|
|
395
418
|
return 2
|
|
396
419
|
|
|
397
|
-
|
|
420
|
+
command = argv[index + 1:]
|
|
421
|
+
shell_wrapper = shell_command_wrapper(command)
|
|
422
|
+
if shell_wrapper:
|
|
423
|
+
print(
|
|
424
|
+
f"error: {shell_wrapper} command-string wrappers are not allowed; "
|
|
425
|
+
"pass the validation executable and its arguments directly so its "
|
|
426
|
+
"exit code remains authoritative",
|
|
427
|
+
file=sys.stderr,
|
|
428
|
+
)
|
|
429
|
+
print(
|
|
430
|
+
"run-long-check already captures stdout/stderr; do not add pipelines "
|
|
431
|
+
"or trailing commands to trim output",
|
|
432
|
+
file=sys.stderr,
|
|
433
|
+
)
|
|
434
|
+
return 2
|
|
435
|
+
|
|
436
|
+
return start_job(command, timeout_seconds)
|
|
398
437
|
|
|
399
438
|
|
|
400
439
|
if __name__ == "__main__":
|