@orbit-build/cli 1.6.6 → 1.6.8
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/index.js +333 -44
- package/package.json +1 -1
- package/skills/cumcm-draft/SKILL.md +9 -10
- package/skills/cumcm-draft/agents/openai.yaml +1 -1
- package/skills/cumcm-draft/assets/project-template/.cumcm/profile.json +2 -1
- package/skills/cumcm-draft/references/code-and-output-style.md +4 -4
- package/skills/cumcm-draft/references/latex-figures-tables.md +3 -2
- package/skills/cumcm-draft/references/project-architecture.md +9 -8
- package/skills/cumcm-draft/scripts/audit_paper.py +1 -1
- package/skills/cumcm-draft/scripts/bootstrap_project.py +2 -1
- package/skills/cumcm-draft/scripts/project_utils.py +2 -1
- package/skills/cumcm-draft/scripts/validate_project.py +53 -16
package/dist/index.js
CHANGED
|
@@ -247529,6 +247529,7 @@ import { createHash as createHash5, createPublicKey as createPublicKey3, verify
|
|
|
247529
247529
|
import { existsSync as existsSync33, lstatSync as lstatSync32, readFileSync as readFileSync2 } from "fs";
|
|
247530
247530
|
import { dirname as dirname22, resolve as resolve23, win32 } from "path";
|
|
247531
247531
|
import { z as z24 } from "zod";
|
|
247532
|
+
import { posix } from "path";
|
|
247532
247533
|
var SafePathSegmentSchema = z13.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/);
|
|
247533
247534
|
var CheckpointIdSchema = z13.string().regex(/^cp_[a-f0-9]{32}$/);
|
|
247534
247535
|
var PersistedCheckpointMetadataSchema = z13.object({
|
|
@@ -248300,6 +248301,200 @@ function isSensitiveSnapshotPath(filePath) {
|
|
|
248300
248301
|
function toErrorMessage2(error) {
|
|
248301
248302
|
return error instanceof Error ? error.message : String(error);
|
|
248302
248303
|
}
|
|
248304
|
+
var MACOS_RUNTIME_BASE_POLICY = String.raw`
|
|
248305
|
+
(version 1)
|
|
248306
|
+
(deny default)
|
|
248307
|
+
|
|
248308
|
+
(allow process-exec)
|
|
248309
|
+
(allow process-fork)
|
|
248310
|
+
(allow signal (target same-sandbox))
|
|
248311
|
+
(allow process-info* (target same-sandbox))
|
|
248312
|
+
|
|
248313
|
+
(allow sysctl-read)
|
|
248314
|
+
(allow sysctl-write (sysctl-name "kern.grade_cputype"))
|
|
248315
|
+
(allow system-mac-syscall (mac-policy-name "vnguard"))
|
|
248316
|
+
(allow system-mac-syscall
|
|
248317
|
+
(require-all
|
|
248318
|
+
(mac-policy-name "Sandbox")
|
|
248319
|
+
(mac-syscall-number 67)))
|
|
248320
|
+
|
|
248321
|
+
(allow iokit-open
|
|
248322
|
+
(iokit-registry-entry-class "RootDomainUserClient"))
|
|
248323
|
+
|
|
248324
|
+
(allow ipc-posix-sem)
|
|
248325
|
+
(allow ipc-posix-shm-read-data
|
|
248326
|
+
ipc-posix-shm-write-create
|
|
248327
|
+
ipc-posix-shm-write-unlink
|
|
248328
|
+
(ipc-posix-name-regex #"^/__KMP_REGISTERED_LIB_[0-9]+$"))
|
|
248329
|
+
(allow ipc-posix-shm-read*
|
|
248330
|
+
(ipc-posix-name-prefix "apple.cfprefs."))
|
|
248331
|
+
(allow ipc-posix-shm-read*
|
|
248332
|
+
(ipc-posix-name "apple.shm.notification_center"))
|
|
248333
|
+
|
|
248334
|
+
(allow mach-lookup
|
|
248335
|
+
(global-name "com.apple.PowerManagement.control")
|
|
248336
|
+
(global-name "com.apple.analyticsd")
|
|
248337
|
+
(global-name "com.apple.analyticsd.messagetracer")
|
|
248338
|
+
(global-name "com.apple.appsleep")
|
|
248339
|
+
(global-name "com.apple.bsd.dirhelper")
|
|
248340
|
+
(global-name "com.apple.cfprefsd.agent")
|
|
248341
|
+
(global-name "com.apple.cfprefsd.daemon")
|
|
248342
|
+
(global-name "com.apple.diagnosticd")
|
|
248343
|
+
(global-name "com.apple.dt.automationmode.reader")
|
|
248344
|
+
(global-name "com.apple.espd")
|
|
248345
|
+
(global-name "com.apple.logd")
|
|
248346
|
+
(global-name "com.apple.logd.events")
|
|
248347
|
+
(global-name "com.apple.runningboard")
|
|
248348
|
+
(global-name "com.apple.secinitd")
|
|
248349
|
+
(global-name "com.apple.system.DirectoryService.libinfo_v1")
|
|
248350
|
+
(global-name "com.apple.system.logger")
|
|
248351
|
+
(global-name "com.apple.system.notification_center")
|
|
248352
|
+
(global-name "com.apple.system.opendirectoryd.libinfo")
|
|
248353
|
+
(global-name "com.apple.system.opendirectoryd.membership")
|
|
248354
|
+
(global-name "com.apple.trustd")
|
|
248355
|
+
(global-name "com.apple.trustd.agent")
|
|
248356
|
+
(global-name "com.apple.xpc.activity.unmanaged")
|
|
248357
|
+
(local-name "com.apple.cfprefsd.agent"))
|
|
248358
|
+
(allow user-preference-read)
|
|
248359
|
+
|
|
248360
|
+
(allow pseudo-tty)
|
|
248361
|
+
(allow file-read* file-write* file-ioctl (literal "/dev/ptmx"))
|
|
248362
|
+
(allow file-read* file-write*
|
|
248363
|
+
(require-all
|
|
248364
|
+
(regex #"^/dev/ttys[0-9]+")
|
|
248365
|
+
(extension "com.apple.sandbox.pty")))
|
|
248366
|
+
(allow file-ioctl (regex #"^/dev/ttys[0-9]+"))
|
|
248367
|
+
`;
|
|
248368
|
+
var MACOS_PLATFORM_FILESYSTEM_POLICY = String.raw`
|
|
248369
|
+
(allow file-read* file-test-existence
|
|
248370
|
+
(subpath "/Library/Apple")
|
|
248371
|
+
(subpath "/Library/Filesystems/NetFSPlugins")
|
|
248372
|
+
(subpath "/Library/Preferences")
|
|
248373
|
+
(subpath "/Library/Preferences/Logging")
|
|
248374
|
+
(subpath "/private/var/db")
|
|
248375
|
+
(subpath "/usr/lib")
|
|
248376
|
+
(subpath "/usr/share")
|
|
248377
|
+
(subpath "/var/db"))
|
|
248378
|
+
|
|
248379
|
+
(allow file-map-executable
|
|
248380
|
+
(subpath "/Library/Apple/System/Library/Frameworks")
|
|
248381
|
+
(subpath "/Library/Apple/System/Library/PrivateFrameworks")
|
|
248382
|
+
(subpath "/Library/Apple/usr/lib")
|
|
248383
|
+
(subpath "/System/Library/Extensions")
|
|
248384
|
+
(subpath "/System/Library/Frameworks")
|
|
248385
|
+
(subpath "/System/Library/PrivateFrameworks")
|
|
248386
|
+
(subpath "/System/Library/SubFrameworks")
|
|
248387
|
+
(subpath "/System/iOSSupport/System/Library/Frameworks")
|
|
248388
|
+
(subpath "/System/iOSSupport/System/Library/PrivateFrameworks")
|
|
248389
|
+
(subpath "/System/iOSSupport/System/Library/SubFrameworks")
|
|
248390
|
+
(subpath "/usr/lib"))
|
|
248391
|
+
|
|
248392
|
+
(allow file-read-metadata file-test-existence
|
|
248393
|
+
(literal "/etc")
|
|
248394
|
+
(literal "/tmp")
|
|
248395
|
+
(literal "/var")
|
|
248396
|
+
(literal "/private/etc/localtime"))
|
|
248397
|
+
(allow file-read-metadata file-test-existence
|
|
248398
|
+
(path-ancestors "/System/Volumes/Data/private"))
|
|
248399
|
+
(allow file-read* file-test-existence (literal "/"))
|
|
248400
|
+
|
|
248401
|
+
(allow file-read* file-test-existence
|
|
248402
|
+
(literal "/dev/autofs_nowait")
|
|
248403
|
+
(literal "/dev/random")
|
|
248404
|
+
(literal "/dev/urandom")
|
|
248405
|
+
(literal "/private/etc/master.passwd")
|
|
248406
|
+
(literal "/private/etc/passwd")
|
|
248407
|
+
(literal "/private/etc/protocols")
|
|
248408
|
+
(literal "/private/etc/services"))
|
|
248409
|
+
(allow file-read* file-test-existence file-write-data
|
|
248410
|
+
(literal "/dev/null")
|
|
248411
|
+
(literal "/dev/zero"))
|
|
248412
|
+
(allow file-read-data file-test-existence file-write-data
|
|
248413
|
+
(subpath "/dev/fd"))
|
|
248414
|
+
(allow file-read* file-test-existence file-write-data file-ioctl
|
|
248415
|
+
(literal "/dev/dtracehelper"))
|
|
248416
|
+
|
|
248417
|
+
(allow file-read* file-test-existence file-write* (subpath "/tmp"))
|
|
248418
|
+
(allow file-read* file-test-existence file-write* (subpath "/private/tmp"))
|
|
248419
|
+
(allow file-read* file-test-existence file-write* (subpath "/var/tmp"))
|
|
248420
|
+
(allow file-read* file-test-existence file-write* (subpath "/private/var/tmp"))
|
|
248421
|
+
|
|
248422
|
+
(allow file-read* (subpath "/etc"))
|
|
248423
|
+
(allow file-read* (subpath "/private/etc"))
|
|
248424
|
+
(allow file-read-metadata (subpath "/var"))
|
|
248425
|
+
(allow file-read-metadata (subpath "/private/var"))
|
|
248426
|
+
|
|
248427
|
+
(allow file-read-data file-read-metadata (subpath "/bin"))
|
|
248428
|
+
(allow file-read-data file-read-metadata (subpath "/sbin"))
|
|
248429
|
+
(allow file-read-data file-read-metadata (subpath "/usr/bin"))
|
|
248430
|
+
(allow file-read-data file-read-metadata (subpath "/usr/sbin"))
|
|
248431
|
+
(allow file-read-data file-read-metadata (subpath "/usr/libexec"))
|
|
248432
|
+
(allow file-read* (subpath "/opt/homebrew/lib"))
|
|
248433
|
+
(allow file-read* (subpath "/usr/local/lib"))
|
|
248434
|
+
|
|
248435
|
+
(allow file-read* (regex #"^/dev/fd/(0|1|2)$"))
|
|
248436
|
+
(allow file-write* (regex #"^/dev/fd/(1|2)$"))
|
|
248437
|
+
(allow file-read* file-write* (literal "/dev/tty"))
|
|
248438
|
+
(allow file-read-metadata (literal "/dev"))
|
|
248439
|
+
(allow file-read-metadata (regex #"^/dev/.*$"))
|
|
248440
|
+
(allow file-read-metadata (literal "/dev/stdin"))
|
|
248441
|
+
(allow file-read-metadata (literal "/dev/stdout"))
|
|
248442
|
+
(allow file-read-metadata (literal "/dev/stderr"))
|
|
248443
|
+
(allow file-read-metadata (regex #"^/dev/tty[^/]*$"))
|
|
248444
|
+
(allow file-read-metadata (regex #"^/dev/pty[^/]*$"))
|
|
248445
|
+
|
|
248446
|
+
(allow file-read-metadata (literal "/System/Volumes") (vnode-type DIRECTORY))
|
|
248447
|
+
(allow file-read-metadata (literal "/System/Volumes/Data") (vnode-type DIRECTORY))
|
|
248448
|
+
(allow file-read-metadata (literal "/System/Volumes/Data/Users") (vnode-type DIRECTORY))
|
|
248449
|
+
|
|
248450
|
+
(allow file-read* (extension "com.apple.app-sandbox.read"))
|
|
248451
|
+
(allow file-read* file-write* (extension "com.apple.app-sandbox.read-write"))
|
|
248452
|
+
`;
|
|
248453
|
+
var SYSTEM_READABLE_ROOTS = ["/System", "/usr", "/bin", "/sbin", "/dev"];
|
|
248454
|
+
function createMacOsSeatbeltProfile(options) {
|
|
248455
|
+
const runtimeRoots = macOsRuntimeReadOnlyRoots(
|
|
248456
|
+
options.invocation.file,
|
|
248457
|
+
options.environment
|
|
248458
|
+
);
|
|
248459
|
+
const readableRoots = /* @__PURE__ */ new Set([
|
|
248460
|
+
...SYSTEM_READABLE_ROOTS,
|
|
248461
|
+
options.cwd,
|
|
248462
|
+
...options.writableRoots,
|
|
248463
|
+
...options.readOnlyRoots,
|
|
248464
|
+
...runtimeRoots
|
|
248465
|
+
]);
|
|
248466
|
+
const lines = [
|
|
248467
|
+
MACOS_RUNTIME_BASE_POLICY.trim(),
|
|
248468
|
+
MACOS_PLATFORM_FILESYSTEM_POLICY.trim(),
|
|
248469
|
+
options.network === "deny" ? "(deny network*)" : "(allow network*)"
|
|
248470
|
+
];
|
|
248471
|
+
for (const root of readableRoots) {
|
|
248472
|
+
const value = profileString(root);
|
|
248473
|
+
lines.push(
|
|
248474
|
+
`(allow file-read* file-test-existence (subpath ${value}))`,
|
|
248475
|
+
`(allow file-read-metadata file-test-existence (path-ancestors ${value}))`
|
|
248476
|
+
);
|
|
248477
|
+
}
|
|
248478
|
+
for (const root of runtimeRoots) {
|
|
248479
|
+
lines.push(`(allow file-map-executable (subpath ${profileString(root)}))`);
|
|
248480
|
+
}
|
|
248481
|
+
for (const root of options.writableRoots) {
|
|
248482
|
+
lines.push(`(allow file-write* (subpath ${profileString(root)}))`);
|
|
248483
|
+
}
|
|
248484
|
+
return lines.join("\n");
|
|
248485
|
+
}
|
|
248486
|
+
function macOsRuntimeReadOnlyRoots(command, environment) {
|
|
248487
|
+
const roots = [];
|
|
248488
|
+
if (posix.isAbsolute(command)) roots.push(posix.dirname(command));
|
|
248489
|
+
for (const candidate of (environment.PATH ?? "").split(":")) {
|
|
248490
|
+
if (!candidate || !posix.isAbsolute(candidate)) continue;
|
|
248491
|
+
if (!roots.includes(candidate)) roots.push(candidate);
|
|
248492
|
+
}
|
|
248493
|
+
return roots;
|
|
248494
|
+
}
|
|
248495
|
+
function profileString(value) {
|
|
248496
|
+
return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
248497
|
+
}
|
|
248303
248498
|
var ProcessSandboxModeSchema = z24.enum(["off", "auto", "required"]);
|
|
248304
248499
|
var ProcessSandboxNetworkSchema = z24.enum(["inherit", "deny", "allow"]);
|
|
248305
248500
|
var ProcessSandboxBackendSchema = z24.enum([
|
|
@@ -248420,15 +248615,17 @@ function sandboxInvocation(invocation, request) {
|
|
|
248420
248615
|
const selected = capabilities.selectedBackend;
|
|
248421
248616
|
if (selected === "macos-sandbox-exec") {
|
|
248422
248617
|
const executable2 = request.environment?.ORBIT_SANDBOX_EXEC_PATH ?? "/usr/bin/sandbox-exec";
|
|
248423
|
-
const profile =
|
|
248618
|
+
const profile = createMacOsSeatbeltProfile({
|
|
248619
|
+
invocation,
|
|
248424
248620
|
cwd,
|
|
248425
248621
|
writableRoots,
|
|
248426
248622
|
readOnlyRoots,
|
|
248427
|
-
network
|
|
248428
|
-
|
|
248623
|
+
network,
|
|
248624
|
+
environment: request.environment ?? process.env
|
|
248625
|
+
});
|
|
248429
248626
|
return {
|
|
248430
248627
|
file: executable2,
|
|
248431
|
-
args: ["-p", profile, invocation.file, ...invocation.args],
|
|
248628
|
+
args: ["-p", profile, "--", invocation.file, ...invocation.args],
|
|
248432
248629
|
backend: selected,
|
|
248433
248630
|
networkIsolation: network === "deny",
|
|
248434
248631
|
degraded: false
|
|
@@ -248576,32 +248773,6 @@ function verifyWindowsSandboxHelper(options) {
|
|
|
248576
248773
|
return void 0;
|
|
248577
248774
|
}
|
|
248578
248775
|
}
|
|
248579
|
-
function createMacOsProfile(cwd, writableRoots, readOnlyRoots, network) {
|
|
248580
|
-
const readable2 = [
|
|
248581
|
-
"/System",
|
|
248582
|
-
"/usr",
|
|
248583
|
-
"/bin",
|
|
248584
|
-
"/sbin",
|
|
248585
|
-
"/private/tmp",
|
|
248586
|
-
"/dev",
|
|
248587
|
-
cwd,
|
|
248588
|
-
...writableRoots,
|
|
248589
|
-
...readOnlyRoots
|
|
248590
|
-
];
|
|
248591
|
-
const lines = ["(version 1)", "(deny default)", "(allow process*)"];
|
|
248592
|
-
if (network === "deny") {
|
|
248593
|
-
lines.push("(deny network*)");
|
|
248594
|
-
} else {
|
|
248595
|
-
lines.push("(allow network*)");
|
|
248596
|
-
}
|
|
248597
|
-
for (const root of new Set(readable2)) {
|
|
248598
|
-
lines.push(`(allow file-read* (subpath ${profileString(root)}))`);
|
|
248599
|
-
}
|
|
248600
|
-
for (const root of writableRoots) {
|
|
248601
|
-
lines.push(`(allow file-write* (subpath ${profileString(root)}))`);
|
|
248602
|
-
}
|
|
248603
|
-
return lines.join(" ");
|
|
248604
|
-
}
|
|
248605
248776
|
function createBubblewrapArgs(invocation, cwd, writableRoots, readOnlyRoots, network) {
|
|
248606
248777
|
const args = [
|
|
248607
248778
|
"--die-with-parent",
|
|
@@ -248637,9 +248808,6 @@ function runtimeReadOnlyRoots(command) {
|
|
|
248637
248808
|
}
|
|
248638
248809
|
return roots;
|
|
248639
248810
|
}
|
|
248640
|
-
function profileString(value) {
|
|
248641
|
-
return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
248642
|
-
}
|
|
248643
248811
|
|
|
248644
248812
|
// src/runtime/CacheDiagnostics.ts
|
|
248645
248813
|
import { existsSync as existsSync13, readdirSync as readdirSync7 } from "fs";
|
|
@@ -253124,13 +253292,26 @@ var PROCESS_OUTPUT_MAX_BYTES = 8 * 1024 * 1024;
|
|
|
253124
253292
|
function safeProcessFailureMessage(message2) {
|
|
253125
253293
|
return redactSecrets(message2).replace(/[\r\n]+/g, " ").slice(0, 2e3);
|
|
253126
253294
|
}
|
|
253127
|
-
function readProcessFailureMessage(result) {
|
|
253295
|
+
function readProcessFailureMessage(result, context = {}) {
|
|
253296
|
+
const message2 = rawProcessFailureMessage(result);
|
|
253297
|
+
if (context.sandboxBackend === "macos-sandbox-exec" && message2.includes("sandbox-exec -p")) {
|
|
253298
|
+
const signal = message2.match(/\bSIG[A-Z0-9]+\b/)?.[0];
|
|
253299
|
+
return signal ? `The macOS sandboxed process was terminated by ${signal}.` : "The macOS sandboxed process failed before command completion.";
|
|
253300
|
+
}
|
|
253301
|
+
return safeProcessFailureMessage(message2);
|
|
253302
|
+
}
|
|
253303
|
+
function processOutputLimitExceeded(result) {
|
|
253304
|
+
if (typeof result !== "object" || result === null) return false;
|
|
253305
|
+
const record2 = result;
|
|
253306
|
+
return record2.isMaxBuffer === true || /maxBuffer exceeded/i.test(rawProcessFailureMessage(result));
|
|
253307
|
+
}
|
|
253308
|
+
function rawProcessFailureMessage(result) {
|
|
253128
253309
|
if (typeof result !== "object" || result === null) {
|
|
253129
253310
|
return "The child process failed.";
|
|
253130
253311
|
}
|
|
253131
253312
|
const record2 = result;
|
|
253132
253313
|
const message2 = typeof record2.shortMessage === "string" ? record2.shortMessage : typeof record2.message === "string" ? record2.message : "The child process failed.";
|
|
253133
|
-
return
|
|
253314
|
+
return message2;
|
|
253134
253315
|
}
|
|
253135
253316
|
function firstExistingPath(candidates, pathExists = existsSync7) {
|
|
253136
253317
|
for (const candidate of candidates) {
|
|
@@ -253292,8 +253473,10 @@ var BashTool = class {
|
|
|
253292
253473
|
error: "Command execution was interrupted by the user."
|
|
253293
253474
|
};
|
|
253294
253475
|
}
|
|
253295
|
-
const failureMessage = readProcessFailureMessage(result
|
|
253296
|
-
|
|
253476
|
+
const failureMessage = readProcessFailureMessage(result, {
|
|
253477
|
+
sandboxBackend: sandboxed.backend
|
|
253478
|
+
});
|
|
253479
|
+
const outputLimitExceeded = result.failed && processOutputLimitExceeded(result);
|
|
253297
253480
|
const exitCode = result.exitCode ?? (result.failed ? 1 : 0);
|
|
253298
253481
|
const displayStdout = redactSecrets(
|
|
253299
253482
|
LogTruncator.truncate(stdout2, 150, 2e4)
|
|
@@ -253465,8 +253648,10 @@ var RunTestsTool = class {
|
|
|
253465
253648
|
error: "Test execution was interrupted by the user."
|
|
253466
253649
|
};
|
|
253467
253650
|
}
|
|
253468
|
-
const failureMessage = readProcessFailureMessage(result
|
|
253469
|
-
|
|
253651
|
+
const failureMessage = readProcessFailureMessage(result, {
|
|
253652
|
+
sandboxBackend: sandboxed.backend
|
|
253653
|
+
});
|
|
253654
|
+
const outputLimitExceeded = result.failed && processOutputLimitExceeded(result);
|
|
253470
253655
|
const exitCode = result.exitCode ?? (result.failed ? 1 : 0);
|
|
253471
253656
|
const terminalSuccess = detectTrustedTerminalSuccess(
|
|
253472
253657
|
testCommand,
|
|
@@ -293180,10 +293365,38 @@ var WEB_UI_APPROVAL_STYLES = String.raw`
|
|
|
293180
293365
|
}
|
|
293181
293366
|
|
|
293182
293367
|
@media (max-width: 560px) {
|
|
293183
|
-
.approval-panel {
|
|
293184
|
-
|
|
293185
|
-
|
|
293186
|
-
|
|
293368
|
+
.approval-panel {
|
|
293369
|
+
margin-bottom: 8px;
|
|
293370
|
+
padding: 12px;
|
|
293371
|
+
border-radius: 14px;
|
|
293372
|
+
}
|
|
293373
|
+
|
|
293374
|
+
.approval-panel-head {
|
|
293375
|
+
gap: 9px;
|
|
293376
|
+
}
|
|
293377
|
+
|
|
293378
|
+
.approval-reason {
|
|
293379
|
+
margin: 8px 0 0;
|
|
293380
|
+
font-size: 11.5px;
|
|
293381
|
+
}
|
|
293382
|
+
|
|
293383
|
+
.approval-preview {
|
|
293384
|
+
max-height: min(128px, 20dvh);
|
|
293385
|
+
margin-top: 9px;
|
|
293386
|
+
padding-block: 7px;
|
|
293387
|
+
font-size: 10.75px;
|
|
293388
|
+
}
|
|
293389
|
+
|
|
293390
|
+
.approval-actions {
|
|
293391
|
+
display: grid;
|
|
293392
|
+
grid-template-columns: 1fr 1fr;
|
|
293393
|
+
margin-top: 10px;
|
|
293394
|
+
}
|
|
293395
|
+
|
|
293396
|
+
.approval-button {
|
|
293397
|
+
width: 100%;
|
|
293398
|
+
height: 40px;
|
|
293399
|
+
}
|
|
293187
293400
|
}
|
|
293188
293401
|
`;
|
|
293189
293402
|
|
|
@@ -295410,7 +295623,9 @@ button:focus-visible,
|
|
|
295410
295623
|
input:focus-visible,
|
|
295411
295624
|
select:focus-visible,
|
|
295412
295625
|
textarea:focus-visible,
|
|
295413
|
-
summary:focus-visible
|
|
295626
|
+
summary:focus-visible,
|
|
295627
|
+
a:focus-visible,
|
|
295628
|
+
[tabindex]:focus-visible {
|
|
295414
295629
|
outline: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
|
|
295415
295630
|
outline-offset: 2px;
|
|
295416
295631
|
}
|
|
@@ -297110,6 +297325,15 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297110
297325
|
.registered-project-remove {
|
|
297111
297326
|
opacity: 1;
|
|
297112
297327
|
}
|
|
297328
|
+
|
|
297329
|
+
.icon-button,
|
|
297330
|
+
.details-button,
|
|
297331
|
+
.connection-state,
|
|
297332
|
+
.new-project-button,
|
|
297333
|
+
.approval-button {
|
|
297334
|
+
min-width: 40px;
|
|
297335
|
+
min-height: 40px;
|
|
297336
|
+
}
|
|
297113
297337
|
}
|
|
297114
297338
|
|
|
297115
297339
|
@media (min-width: 901px) {
|
|
@@ -297331,6 +297555,22 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297331
297555
|
}
|
|
297332
297556
|
|
|
297333
297557
|
@media (max-width: 560px) {
|
|
297558
|
+
.message-scroll,
|
|
297559
|
+
.project-chat-body,
|
|
297560
|
+
.project-list,
|
|
297561
|
+
.inspector-content,
|
|
297562
|
+
.workspace-view {
|
|
297563
|
+
scrollbar-gutter: auto;
|
|
297564
|
+
}
|
|
297565
|
+
|
|
297566
|
+
.message-scroll {
|
|
297567
|
+
scrollbar-width: none;
|
|
297568
|
+
}
|
|
297569
|
+
|
|
297570
|
+
.message-scroll::-webkit-scrollbar {
|
|
297571
|
+
display: none;
|
|
297572
|
+
}
|
|
297573
|
+
|
|
297334
297574
|
.project-dialog-card {
|
|
297335
297575
|
padding: 17px;
|
|
297336
297576
|
}
|
|
@@ -297478,6 +297718,26 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297478
297718
|
border-radius: 16px;
|
|
297479
297719
|
}
|
|
297480
297720
|
|
|
297721
|
+
.prompt-queue {
|
|
297722
|
+
gap: 4px;
|
|
297723
|
+
margin-inline: 4px;
|
|
297724
|
+
padding: 6px;
|
|
297725
|
+
}
|
|
297726
|
+
|
|
297727
|
+
.prompt-queue-list {
|
|
297728
|
+
max-height: 76px;
|
|
297729
|
+
}
|
|
297730
|
+
|
|
297731
|
+
.prompt-queue-row {
|
|
297732
|
+
min-height: 27px;
|
|
297733
|
+
font-size: 10.5px;
|
|
297734
|
+
}
|
|
297735
|
+
|
|
297736
|
+
.prompt-queue-actions button {
|
|
297737
|
+
width: 24px;
|
|
297738
|
+
height: 24px;
|
|
297739
|
+
}
|
|
297740
|
+
|
|
297481
297741
|
.composer-hint {
|
|
297482
297742
|
display: none;
|
|
297483
297743
|
}
|
|
@@ -297615,6 +297875,28 @@ var WEB_UI_RESPONSIVE_STYLES = String.raw`
|
|
|
297615
297875
|
}
|
|
297616
297876
|
}
|
|
297617
297877
|
|
|
297878
|
+
@media (prefers-contrast: more) {
|
|
297879
|
+
:root {
|
|
297880
|
+
--border: color-mix(in srgb, var(--ink-strong) 24%, transparent);
|
|
297881
|
+
--border-strong: color-mix(in srgb, var(--ink-strong) 38%, transparent);
|
|
297882
|
+
}
|
|
297883
|
+
|
|
297884
|
+
button:focus-visible,
|
|
297885
|
+
input:focus-visible,
|
|
297886
|
+
select:focus-visible,
|
|
297887
|
+
textarea:focus-visible,
|
|
297888
|
+
summary:focus-visible,
|
|
297889
|
+
a:focus-visible,
|
|
297890
|
+
[tabindex]:focus-visible {
|
|
297891
|
+
outline-width: 3px;
|
|
297892
|
+
}
|
|
297893
|
+
|
|
297894
|
+
.topbar,
|
|
297895
|
+
.composer {
|
|
297896
|
+
backdrop-filter: none;
|
|
297897
|
+
}
|
|
297898
|
+
}
|
|
297899
|
+
|
|
297618
297900
|
@media (forced-colors: active) {
|
|
297619
297901
|
button,
|
|
297620
297902
|
input,
|
|
@@ -298168,6 +298450,12 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
298168
298450
|
border-radius: 12px;
|
|
298169
298451
|
}
|
|
298170
298452
|
|
|
298453
|
+
.project-section:has(.project-toggle[aria-expanded="false"]) {
|
|
298454
|
+
min-height: 0;
|
|
298455
|
+
flex: 0 0 auto;
|
|
298456
|
+
grid-template-rows: auto;
|
|
298457
|
+
}
|
|
298458
|
+
|
|
298171
298459
|
.recent-projects-shell {
|
|
298172
298460
|
min-width: 0;
|
|
298173
298461
|
min-height: 0;
|
|
@@ -298788,6 +299076,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
298788
299076
|
padding: 0 clamp(18px, 2vw, 30px);
|
|
298789
299077
|
border-bottom: 1px solid var(--border);
|
|
298790
299078
|
background: color-mix(in srgb, var(--surface-glass) 97%, white);
|
|
299079
|
+
box-shadow: 0 1px 0 color-mix(in srgb, var(--surface-raised) 68%, transparent);
|
|
298791
299080
|
backdrop-filter: blur(24px) saturate(125%);
|
|
298792
299081
|
z-index: 15;
|
|
298793
299082
|
}
|
package/package.json
CHANGED
|
@@ -188,9 +188,9 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
|
|
|
188
188
|
|
|
189
189
|
### 3. Implement and run
|
|
190
190
|
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
- Put genuinely cross-question configuration/loading/plotting/validation logic
|
|
192
|
+
under `code/always/`. Keep question-owned logic under its `code/qN/` directory;
|
|
193
|
+
do not copy a module into `always` merely to make the tree look modular. Give every generated artifact one producing subproblem and
|
|
194
194
|
store it in `results/qN`. Downstream questions may read an upstream qN result;
|
|
195
195
|
do not create `results/always`, `results/shared`, or another ownerless result
|
|
196
196
|
directory. Keep each `main.py` orchestral. After reading the problem, name
|
|
@@ -239,13 +239,12 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
|
|
|
239
239
|
and reproducibility metadata belong under `.cumcm/`, not `results/`.
|
|
240
240
|
- Give every final figure a descriptive Chinese filename and Chinese title,
|
|
241
241
|
axes, legend, annotations, and category labels. Configure a CJK font fallback
|
|
242
|
-
such as Microsoft YaHei, SimHei, or Noto Sans CJK SC.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
itself is correct.
|
|
242
|
+
such as Microsoft YaHei, SimHei, or Noto Sans CJK SC. Generate PNG only,
|
|
243
|
+
at 300 dpi or higher, and update every paper/support reference. Do not leave
|
|
244
|
+
PDF, SVG, JPG, or EPS siblings in `figures/`; those formats belong to source
|
|
245
|
+
inputs or transient build output, not final figure delivery. Names such as
|
|
246
|
+
`summary.png`, `plot.png`, `figure.png`, `output.png`, or `final.png` are
|
|
247
|
+
invalid even when the graphic itself is correct.
|
|
249
248
|
- Preserve a non-Chinese filename, header, or worksheet name only when the
|
|
250
249
|
problem statement or supplied fill-in template fixes it. Do not translate or
|
|
251
250
|
silently reshape that prescribed schema. Register the exact output path,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "cumcm-draft"
|
|
3
3
|
short_description: "Complete CUMCM paper, code, PDF, AI record, and support ZIP"
|
|
4
|
-
default_prompt: "Use $cumcm-draft to ask which Python or Conda interpreter to use, audit the current official CUMCM rules, build responsibility-based q1/q2 code without project-local finalizers or Python caches, generate Chinese-named tables and Chinese
|
|
4
|
+
default_prompt: "Use $cumcm-draft to ask which Python or Conda interpreter to use, audit the current official CUMCM rules, build responsibility-based q1/q2 code with genuinely shared modules under code/always without project-local finalizers or Python caches, generate Chinese-named tables and 300-dpi Chinese PNG figures, keep final PDFs/TeX and required qN submission copies under happy/, inspect the full Chinese paper, and package the matching PDF/ZIP pair."
|
|
5
5
|
policy:
|
|
6
6
|
allow_implicit_invocation: false
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"require_chinese_headers": true,
|
|
19
19
|
"require_chinese_sheet_names": true,
|
|
20
20
|
"require_chinese_figure_filenames": true,
|
|
21
|
-
"
|
|
21
|
+
"require_png_figures": true,
|
|
22
|
+
"min_png_dpi": 300,
|
|
22
23
|
"require_utf8_sig_csv": true,
|
|
23
24
|
"fixed_schema_exceptions": []
|
|
24
25
|
},
|
|
@@ -14,7 +14,7 @@ code/
|
|
|
14
14
|
├── forecasting.py
|
|
15
15
|
├── evaluation.py
|
|
16
16
|
└── reporting.py
|
|
17
|
-
└──
|
|
17
|
+
└── always/ # genuinely shared cross-question logic only
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
The names above are examples, not a fixed template. Another question may need
|
|
@@ -119,9 +119,9 @@ For each `figures/qN`:
|
|
|
119
119
|
- save only figures used or directly useful in the paper;
|
|
120
120
|
- use descriptive Chinese filenames; reject generic names such as
|
|
121
121
|
`summary.png`, `plot.png`, `figure.png`, `output.png`, and `final.png`;
|
|
122
|
-
- generate
|
|
123
|
-
-
|
|
124
|
-
|
|
122
|
+
- generate final figures as PNG at 300 dpi or higher;
|
|
123
|
+
- remove stale PDF, SVG, JPG, and EPS siblings from `figures/` so the final
|
|
124
|
+
figure contract is unambiguous;
|
|
125
125
|
- write figure titles, axes, legends, annotations, and categories in Chinese;
|
|
126
126
|
- use Chinese-capable fonts and minus-sign handling;
|
|
127
127
|
- label axes and colorbars with units;
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
|
|
36
36
|
## Figures
|
|
37
37
|
|
|
38
|
-
- Generate
|
|
39
|
-
-
|
|
38
|
+
- Generate every final figure as PNG at 300 dpi or higher.
|
|
39
|
+
- Do not leave PDF, SVG, JPG, or EPS siblings in `figures/`; keep transient
|
|
40
|
+
vector exports under `.cumcm/build/` when an analysis tool needs them.
|
|
40
41
|
- Use Chinese filenames and Chinese titles, axes, legends, annotations, and
|
|
41
42
|
category labels, with a CJK-capable font fallback.
|
|
42
43
|
- Make labels readable at final printed size.
|
|
@@ -22,7 +22,7 @@ project-root/
|
|
|
22
22
|
│ │ ├── forecasting.py # examples; names follow real responsibilities
|
|
23
23
|
│ │ └── evaluation.py
|
|
24
24
|
│ ├── q2/
|
|
25
|
-
│ └──
|
|
25
|
+
│ └── always/ # genuinely shared cross-question logic only
|
|
26
26
|
├── results/
|
|
27
27
|
│ ├── q1/ # Chinese-named tables, metrics, models, workbooks
|
|
28
28
|
│ ├── q2/
|
|
@@ -53,8 +53,9 @@ or `happy/build/`.
|
|
|
53
53
|
role. Record that they were blank.
|
|
54
54
|
- A required filled table belongs in `results/qN`, even when its blank template
|
|
55
55
|
came from `question/`.
|
|
56
|
-
-
|
|
57
|
-
|
|
56
|
+
- Put genuinely shared behavior in `code/always`; keep question-specific logic
|
|
57
|
+
in `code/qN`. Do not duplicate a module into `always` merely to make the
|
|
58
|
+
tree look modular, and do not put result artifacts there.
|
|
58
59
|
- Each `code/qN/main.py` must run independently after prerequisites exist,
|
|
59
60
|
both through `code/run_all.py` and as a direct script from its qN directory.
|
|
60
61
|
- `main.py` orchestrates loading, domain computation, validation, and reporting.
|
|
@@ -86,11 +87,11 @@ or `happy/build/`.
|
|
|
86
87
|
- Use descriptive Chinese filenames for generated tabular artifacts under
|
|
87
88
|
`results/qN`; use Chinese CSV/TSV headers and Chinese Excel worksheet/table
|
|
88
89
|
headers, with units where applicable.
|
|
89
|
-
- Use descriptive Chinese figure filenames such as `需求预测误差对比.
|
|
90
|
-
`价格弹性敏感性分析.
|
|
91
|
-
categories in Chinese. Generate
|
|
92
|
-
|
|
93
|
-
`figure.png`, `output.png`, and `final.png` are invalid.
|
|
90
|
+
- Use descriptive Chinese PNG figure filenames such as `需求预测误差对比.png`
|
|
91
|
+
or `价格弹性敏感性分析.png`. Write titles, axes, legends, annotations, and
|
|
92
|
+
categories in Chinese. Generate at least 300 dpi PNG output and remove stale
|
|
93
|
+
PDF, SVG, JPG, and EPS siblings. Generic names such as `summary.png`,
|
|
94
|
+
`plot.png`, `figure.png`, `output.png`, and `final.png` are invalid.
|
|
94
95
|
- Preserve a prescribed non-Chinese result schema only when the problem fixes
|
|
95
96
|
it, and document the narrow exception in
|
|
96
97
|
`.cumcm/profile.json.result_artifacts.fixed_schema_exceptions`.
|
|
@@ -11,7 +11,7 @@ from typing import Any
|
|
|
11
11
|
from project_utils import build_directory, delivery_directory, generated_directory
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
FIGURE_SUFFIXES = {".
|
|
14
|
+
FIGURE_SUFFIXES = {".png"}
|
|
15
15
|
PROBLEM_SUFFIXES = {".pdf", ".doc", ".docx", ".csv", ".tsv", ".xls", ".xlsx"}
|
|
16
16
|
INVENTORY_EXCLUDED_PARTS = {"__pycache__", ".pytest_cache", ".mypy_cache", ".ruff_cache", ".orbit", "_work"}
|
|
17
17
|
FIGURE_STALE_TOLERANCE_SECONDS = 30.0
|
|
@@ -47,6 +47,7 @@ def main() -> None:
|
|
|
47
47
|
for directory in (
|
|
48
48
|
root / "question",
|
|
49
49
|
root / "code",
|
|
50
|
+
root / "code" / "always",
|
|
50
51
|
delivery_directory(root),
|
|
51
52
|
control_directory(root),
|
|
52
53
|
control_directory(root) / "build",
|
|
@@ -415,7 +416,7 @@ def solve(inputs):
|
|
|
415
416
|
|
|
416
417
|
|
|
417
418
|
def evaluate_and_report(inputs, solution) -> None:
|
|
418
|
-
# TODO[{name}] 完成验证,并输出中文命名的CSV/XLSX及
|
|
419
|
+
# TODO[{name}] 完成验证,并输出中文命名的CSV/XLSX及300 dpi PNG图。
|
|
419
420
|
raise NotImplementedError("请实现问题{name}的评价与报告")
|
|
420
421
|
''',
|
|
421
422
|
}
|
|
@@ -27,7 +27,8 @@ DEFAULT_PROFILE: dict[str, Any] = {
|
|
|
27
27
|
"require_chinese_headers": True,
|
|
28
28
|
"require_chinese_sheet_names": True,
|
|
29
29
|
"require_chinese_figure_filenames": True,
|
|
30
|
-
"
|
|
30
|
+
"require_png_figures": True,
|
|
31
|
+
"min_png_dpi": 300,
|
|
31
32
|
"require_utf8_sig_csv": True,
|
|
32
33
|
"fixed_schema_exceptions": [],
|
|
33
34
|
},
|
|
@@ -8,6 +8,7 @@ import io
|
|
|
8
8
|
import json
|
|
9
9
|
import posixpath
|
|
10
10
|
import re
|
|
11
|
+
import struct
|
|
11
12
|
import subprocess
|
|
12
13
|
import sys
|
|
13
14
|
import zipfile
|
|
@@ -40,7 +41,7 @@ SUPPORT_EXCLUDED_PARTS = {
|
|
|
40
41
|
}
|
|
41
42
|
NESTED_ARCHIVE_SUFFIXES = {".zip", ".rar", ".7z"}
|
|
42
43
|
TABULAR_RESULT_SUFFIXES = {".csv", ".tsv", ".xls", ".xlsx"}
|
|
43
|
-
FIGURE_SUFFIXES = {".
|
|
44
|
+
FIGURE_SUFFIXES = {".png"}
|
|
44
45
|
GENERIC_FIGURE_STEMS = {
|
|
45
46
|
"chart",
|
|
46
47
|
"figure",
|
|
@@ -539,45 +540,81 @@ def result_artifact_contract_errors(
|
|
|
539
540
|
def figure_artifact_contract_errors(
|
|
540
541
|
root: Path, profile: dict[str, object]
|
|
541
542
|
) -> list[str]:
|
|
542
|
-
"""Require final figures to
|
|
543
|
+
"""Require final figures to be descriptive, valid, high-resolution PNGs."""
|
|
543
544
|
errors: list[str] = []
|
|
544
545
|
if profile.get("require_chinese_figure_filenames", True) is not True:
|
|
545
546
|
errors.append(
|
|
546
547
|
"result_artifacts.require_chinese_figure_filenames must be true"
|
|
547
548
|
)
|
|
549
|
+
if profile.get("require_png_figures", True) is not True:
|
|
550
|
+
errors.append("result_artifacts.require_png_figures must be true")
|
|
551
|
+
minimum_dpi = profile.get("min_png_dpi", 300)
|
|
552
|
+
if (
|
|
553
|
+
isinstance(minimum_dpi, bool)
|
|
554
|
+
or not isinstance(minimum_dpi, (int, float))
|
|
555
|
+
or minimum_dpi < 300
|
|
556
|
+
):
|
|
557
|
+
errors.append("result_artifacts.min_png_dpi must be a number >= 300")
|
|
558
|
+
minimum_dpi = 300
|
|
548
559
|
figures = root / "figures"
|
|
549
560
|
if not figures.is_dir() or figures.is_symlink():
|
|
550
561
|
return errors
|
|
551
|
-
formats_by_stem: dict[str, set[str]] = {}
|
|
552
562
|
for path in figures.rglob("*"):
|
|
553
563
|
if not path.is_file() or path.is_symlink():
|
|
554
564
|
continue
|
|
555
565
|
relative = path.relative_to(root).as_posix()
|
|
556
566
|
if path.suffix.lower() not in FIGURE_SUFFIXES:
|
|
557
567
|
errors.append(
|
|
558
|
-
f"figures
|
|
568
|
+
f"final figures must be PNG only; remove or move this artifact: {relative}"
|
|
559
569
|
)
|
|
560
570
|
continue
|
|
561
571
|
stem = path.stem.strip()
|
|
562
|
-
key = path.relative_to(figures).with_suffix("").as_posix().casefold()
|
|
563
|
-
formats_by_stem.setdefault(key, set()).add(path.suffix.lower())
|
|
564
572
|
if stem.lower() in GENERIC_FIGURE_STEMS or not has_chinese(stem):
|
|
565
573
|
errors.append(
|
|
566
574
|
f"figure filename must be descriptive Chinese, not a generic name: {relative}"
|
|
567
575
|
)
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
dpi = png_dpi(path)
|
|
577
|
+
if dpi is None:
|
|
578
|
+
errors.append(
|
|
579
|
+
f"PNG figure must contain valid resolution metadata at or above {minimum_dpi:g} dpi: {relative}"
|
|
580
|
+
)
|
|
581
|
+
# PNG stores pixels-per-metre as an integer; allow the sub-dpi
|
|
582
|
+
# quantization error produced by an exact 300 dpi export.
|
|
583
|
+
elif dpi + 0.5 < float(minimum_dpi):
|
|
584
|
+
errors.append(
|
|
585
|
+
f"PNG figure resolution is {dpi:.1f} dpi, below the required {minimum_dpi:g} dpi: {relative}"
|
|
586
|
+
)
|
|
578
587
|
return errors
|
|
579
588
|
|
|
580
589
|
|
|
590
|
+
def png_dpi(path: Path) -> float | None:
|
|
591
|
+
"""Read PNG pHYs metadata without requiring Pillow at validation time."""
|
|
592
|
+
try:
|
|
593
|
+
with path.open("rb") as stream:
|
|
594
|
+
if stream.read(8) != b"\x89PNG\r\n\x1a\n":
|
|
595
|
+
return None
|
|
596
|
+
while True:
|
|
597
|
+
length_bytes = stream.read(4)
|
|
598
|
+
if len(length_bytes) != 4:
|
|
599
|
+
return None
|
|
600
|
+
length = struct.unpack(">I", length_bytes)[0]
|
|
601
|
+
chunk_type = stream.read(4)
|
|
602
|
+
if len(chunk_type) != 4:
|
|
603
|
+
return None
|
|
604
|
+
data = stream.read(length)
|
|
605
|
+
if len(data) != length or len(stream.read(4)) != 4:
|
|
606
|
+
return None
|
|
607
|
+
if chunk_type == b"pHYs" and len(data) >= 9:
|
|
608
|
+
pixels_x, pixels_y, unit = struct.unpack(">IIB", data[:9])
|
|
609
|
+
if unit != 1 or not pixels_x or not pixels_y:
|
|
610
|
+
return None
|
|
611
|
+
return min(pixels_x, pixels_y) * 0.0254
|
|
612
|
+
if chunk_type == b"IEND":
|
|
613
|
+
return None
|
|
614
|
+
except (OSError, struct.error):
|
|
615
|
+
return None
|
|
616
|
+
|
|
617
|
+
|
|
581
618
|
def fixed_schema_congruence_errors(
|
|
582
619
|
target: Path, source: Path, allowances: set[str], relative: str
|
|
583
620
|
) -> list[str]:
|