orizu 0.5.25 → 0.5.27

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.
Files changed (155) hide show
  1. package/dist/artifacts-git-runtime.d.ts +34 -0
  2. package/dist/artifacts-git-runtime.d.ts.map +1 -0
  3. package/dist/artifacts-git-runtime.js +312 -0
  4. package/dist/cloudflare-artifacts-git-remote.d.ts +5 -0
  5. package/dist/cloudflare-artifacts-git-remote.d.ts.map +1 -0
  6. package/dist/cloudflare-artifacts-git-remote.js +21 -0
  7. package/dist/git-credential.d.ts.map +1 -1
  8. package/dist/git-credential.js +1 -1
  9. package/dist/git-recovery-environment.d.ts +1 -0
  10. package/dist/git-recovery-environment.d.ts.map +1 -1
  11. package/dist/git-recovery-environment.js +1 -1
  12. package/dist/help.d.ts.map +1 -1
  13. package/dist/help.js +44 -11
  14. package/dist/hosted-boot.d.ts +75 -2
  15. package/dist/hosted-boot.d.ts.map +1 -1
  16. package/dist/hosted-boot.js +585 -102
  17. package/dist/hosted-bootstrap.d.ts +2 -0
  18. package/dist/hosted-bootstrap.d.ts.map +1 -1
  19. package/dist/hosted-bootstrap.js +12 -3
  20. package/dist/hosted-harness-opencode.d.ts.map +1 -1
  21. package/dist/hosted-harness-opencode.js +114 -15
  22. package/dist/hosted-harness.d.ts +3 -0
  23. package/dist/hosted-harness.d.ts.map +1 -1
  24. package/dist/hosted-harness.js +4 -1
  25. package/dist/hosted-harvest.d.ts +30 -9
  26. package/dist/hosted-harvest.d.ts.map +1 -1
  27. package/dist/hosted-harvest.js +222 -28
  28. package/dist/hosted-loop-lifecycle.d.ts +15 -3
  29. package/dist/hosted-loop-lifecycle.d.ts.map +1 -1
  30. package/dist/hosted-loop-lifecycle.js +6 -4
  31. package/dist/hosted-loop.d.ts +47 -7
  32. package/dist/hosted-loop.d.ts.map +1 -1
  33. package/dist/hosted-loop.js +298 -58
  34. package/dist/hosted-question-limits.d.ts +7 -0
  35. package/dist/hosted-question-limits.d.ts.map +1 -0
  36. package/dist/hosted-question-limits.js +6 -0
  37. package/dist/hosted-question.d.ts +27 -0
  38. package/dist/hosted-question.d.ts.map +1 -0
  39. package/dist/hosted-question.js +118 -0
  40. package/dist/hosted-run-event-sink.d.ts +10 -5
  41. package/dist/hosted-run-event-sink.d.ts.map +1 -1
  42. package/dist/hosted-run-event-sink.js +12 -8
  43. package/dist/hosted-runtime-assets.d.ts +16 -7
  44. package/dist/hosted-runtime-assets.d.ts.map +1 -1
  45. package/dist/hosted-runtime-assets.js +40 -12
  46. package/dist/hosted-session-cli.d.ts.map +1 -1
  47. package/dist/hosted-session-cli.js +10 -19
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +91 -5
  50. package/dist/instruction-set-gepa-launch.d.ts +1 -1
  51. package/dist/instruction-set-gepa-launch.d.ts.map +1 -1
  52. package/dist/instruction-set-gepa-launch.js +5 -3
  53. package/dist/instruction-set-loader.d.ts.map +1 -1
  54. package/dist/instruction-set-loader.js +63 -2
  55. package/dist/instruction-set-lock/index.d.ts +51 -0
  56. package/dist/instruction-set-lock/index.d.ts.map +1 -0
  57. package/dist/instruction-set-lock/index.js +459 -0
  58. package/dist/instruction-set-lock/schema.v1.d.ts +136 -0
  59. package/dist/instruction-set-lock/schema.v1.d.ts.map +1 -0
  60. package/dist/instruction-set-lock/schema.v1.js +155 -0
  61. package/dist/instruction-set-provenance.d.ts +26 -0
  62. package/dist/instruction-set-provenance.d.ts.map +1 -0
  63. package/dist/instruction-set-provenance.js +68 -0
  64. package/dist/instruction-set-sync/helpers.d.ts +22 -0
  65. package/dist/instruction-set-sync/helpers.d.ts.map +1 -0
  66. package/dist/instruction-set-sync/helpers.js +677 -0
  67. package/dist/instruction-set-sync/index.d.ts +60 -0
  68. package/dist/instruction-set-sync/index.d.ts.map +1 -0
  69. package/dist/instruction-set-sync/index.js +689 -0
  70. package/dist/instruction-set-update/index.d.ts +42 -0
  71. package/dist/instruction-set-update/index.d.ts.map +1 -0
  72. package/dist/instruction-set-update/index.js +445 -0
  73. package/dist/instruction-set-verify/index.d.ts +27 -0
  74. package/dist/instruction-set-verify/index.d.ts.map +1 -0
  75. package/dist/instruction-set-verify/index.js +865 -0
  76. package/dist/instruction-sets-cli.d.ts +1 -4
  77. package/dist/instruction-sets-cli.d.ts.map +1 -1
  78. package/dist/instruction-sets-cli.js +220 -109
  79. package/dist/model-config-fields.d.ts +35 -0
  80. package/dist/model-config-fields.d.ts.map +1 -0
  81. package/dist/model-config-fields.js +28 -0
  82. package/dist/optimizations-list-cli.d.ts.map +1 -1
  83. package/dist/optimizations-list-cli.js +7 -4
  84. package/dist/score-format.d.ts +2 -0
  85. package/dist/score-format.d.ts.map +1 -0
  86. package/dist/score-format.js +18 -0
  87. package/dist/workbench-repo-contract.d.ts +65 -0
  88. package/dist/workbench-repo-contract.d.ts.map +1 -0
  89. package/dist/workbench-repo-contract.js +250 -0
  90. package/dist/workspace-bootstrap-job.d.ts +45 -0
  91. package/dist/workspace-bootstrap-job.d.ts.map +1 -0
  92. package/dist/workspace-bootstrap-job.js +431 -0
  93. package/dist/workspace-bootstrap-seed.d.ts +74 -0
  94. package/dist/workspace-bootstrap-seed.d.ts.map +1 -0
  95. package/dist/workspace-bootstrap-seed.js +209 -0
  96. package/package.json +3 -3
  97. package/src/artifacts-git-runtime.ts +360 -0
  98. package/src/cloudflare-artifacts-git-remote.ts +24 -0
  99. package/src/git-credential.ts +1 -2
  100. package/src/git-recovery-environment.ts +1 -1
  101. package/src/help.ts +44 -11
  102. package/src/hosted-boot.ts +644 -109
  103. package/src/hosted-bootstrap.ts +14 -3
  104. package/src/hosted-harness-opencode.ts +118 -19
  105. package/src/hosted-harness.ts +4 -1
  106. package/src/hosted-harvest.ts +258 -33
  107. package/src/hosted-loop-lifecycle.ts +19 -5
  108. package/src/hosted-loop.ts +328 -63
  109. package/src/hosted-question-limits.ts +6 -0
  110. package/src/hosted-question.ts +145 -0
  111. package/src/hosted-run-event-sink.ts +24 -12
  112. package/src/hosted-runtime-assets.ts +51 -11
  113. package/src/hosted-session-cli.ts +10 -24
  114. package/src/index.ts +87 -5
  115. package/src/instruction-set-gepa-launch.ts +4 -4
  116. package/src/instruction-set-loader.ts +53 -2
  117. package/src/instruction-set-lock/index.ts +561 -0
  118. package/src/instruction-set-lock/schema.v1.json +141 -0
  119. package/src/instruction-set-lock/schema.v1.ts +155 -0
  120. package/src/instruction-set-provenance.ts +89 -0
  121. package/src/instruction-set-sync/helpers.ts +707 -0
  122. package/src/instruction-set-sync/index.ts +791 -0
  123. package/src/instruction-set-update/index.ts +488 -0
  124. package/src/instruction-set-verify/index.ts +1067 -0
  125. package/src/instruction-sets-cli.ts +226 -114
  126. package/src/model-config-fields.ts +31 -0
  127. package/src/optimizations-list-cli.ts +7 -4
  128. package/src/score-format.ts +16 -0
  129. package/src/workbench-repo-contract.ts +314 -0
  130. package/src/workspace-bootstrap-job.ts +611 -0
  131. package/src/workspace-bootstrap-seed.ts +350 -0
  132. package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +46 -2
  133. package/vendor/skills/orizu/SKILL.md +54 -112
  134. package/vendor/skills/orizu/flows/expand.md +27 -0
  135. package/vendor/skills/orizu/flows/first-win.md +31 -0
  136. package/vendor/skills/orizu/flows/onboard.md +31 -0
  137. package/vendor/skills/orizu/flows/promote.md +37 -0
  138. package/vendor/skills/orizu/flows/recurse.md +23 -0
  139. package/vendor/skills/orizu/flows/triage.md +37 -0
  140. package/vendor/skills/orizu/references/assess-and-plan.md +5 -5
  141. package/vendor/skills/orizu/references/authority-map.md +20 -0
  142. package/vendor/skills/orizu/references/building-apps.md +7 -1
  143. package/vendor/skills/orizu/references/building-judges.md +15 -16
  144. package/vendor/skills/orizu/references/cli-reference.md +166 -41
  145. package/vendor/skills/orizu/references/dataset-design.md +16 -6
  146. package/vendor/skills/orizu/references/eval-strategy.md +18 -15
  147. package/vendor/skills/orizu/references/instructions-after-prompts.md +5 -5
  148. package/vendor/skills/orizu/references/migrate-existing-gepa-setup.md +15 -12
  149. package/vendor/skills/orizu/references/migrate-hand-rolled-instruction-layout.md +252 -0
  150. package/vendor/skills/orizu/references/optimization-reports.md +16 -15
  151. package/vendor/skills/orizu/references/optimization-with-gepa.md +5 -3
  152. package/vendor/skills/orizu/references/orizu-in-your-codebase.md +195 -0
  153. package/vendor/skills/orizu/references/primer.md +22 -24
  154. package/vendor/skills/orizu/references/prompt-control-plane.md +34 -31
  155. package/vendor/skills/orizu/references/vocabulary.md +27 -0
@@ -0,0 +1,34 @@
1
+ export interface GitCommandResult {
2
+ exitCode: number;
3
+ stdout: string;
4
+ stderr: string;
5
+ timedOut?: boolean;
6
+ cancelled?: boolean;
7
+ }
8
+ export interface GitAuth {
9
+ askPassPath: string;
10
+ token: string;
11
+ }
12
+ export interface GitRunOptions {
13
+ cwd: string;
14
+ auth?: GitAuth;
15
+ env?: NodeJS.ProcessEnv;
16
+ timeoutMs?: number;
17
+ signal?: AbortSignal;
18
+ commitIdentityEnv?: Readonly<Record<string, string>>;
19
+ }
20
+ export type GitRunner = (args: string[], options: GitRunOptions) => Promise<GitCommandResult>;
21
+ export declare function assertCommitIdentityEnv(overlay: Readonly<Record<string, string>>): void;
22
+ export declare function parseArtifactTokenExpiry(token: string): number | null;
23
+ export declare function credentialSecretVariants(secrets: readonly (string | undefined)[]): string[];
24
+ export declare function redactSecrets(value: string, secrets: readonly (string | undefined)[]): string;
25
+ export declare function createEphemeralAskPass(root: string): Promise<{
26
+ path: string;
27
+ dispose: () => Promise<void>;
28
+ }>;
29
+ export declare function buildGitAuthEnvironment(auth: GitAuth, base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
30
+ export declare function assertSafeGitInvocation(args: readonly string[], secrets?: readonly string[]): void;
31
+ export declare const defaultGitRunner: GitRunner;
32
+ export declare function gitOk(runGit: GitRunner, args: string[], options: GitRunOptions, operation: string): Promise<string>;
33
+ export declare function revParse(runGit: GitRunner, cwd: string, ref: string): Promise<string>;
34
+ //# sourceMapping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AC,EAAE,GAAG,MAAM,CAK7F;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAsBzD;AAUD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,OAAO,EACb,IAAI,GAAE,MAAM,CAAC,UAAwB,GACpC,MAAM,CAAC,UAAU,CAkBnB;AAgBD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,SAAS,MAAM,EAAO,GAC9B,IAAI,CAYN;AAWD,eAAO,MAAM,gBAAgB,EAAE,SAoI3B,CAAA;AAEJ,wBAAsB,KAAK,CACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3F"}
@@ -0,0 +1,312 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { chmod, mkdir, rm, writeFile } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+ const ARTIFACT_TOKEN_BODY = /^[^\s\u0000-\u001f\u007f]{16,1024}$/;
5
+ const ARTIFACT_TOKEN_ADVISORY_SUFFIX = '?expires=';
6
+ const ARTIFACT_TOKEN_BARE_BODY = /art_v1_[0-9a-fA-F]{40}/;
7
+ const DEFAULT_GIT_TIMEOUT_MS = 30_000;
8
+ const GIT_TERMINATION_GRACE_MS = 1_000;
9
+ const GIT_CONTEXT_ENV_KEYS = [
10
+ 'GIT_DIR',
11
+ 'GIT_WORK_TREE',
12
+ 'GIT_INDEX_FILE',
13
+ 'GIT_OBJECT_DIRECTORY',
14
+ 'GIT_COMMON_DIR',
15
+ 'GIT_NAMESPACE',
16
+ ];
17
+ const GIT_CHILD_ENV_ALLOWLIST = [
18
+ 'PATH',
19
+ 'TMPDIR',
20
+ 'TMP',
21
+ 'TEMP',
22
+ 'SYSTEMROOT',
23
+ 'WINDIR',
24
+ 'COMSPEC',
25
+ 'PATHEXT',
26
+ 'LANG',
27
+ 'TZ',
28
+ 'SSL_CERT_FILE',
29
+ 'SSL_CERT_DIR',
30
+ 'CURL_CA_BUNDLE',
31
+ 'GIT_SSL_CAINFO',
32
+ ];
33
+ const COMMIT_IDENTITY_ENV_PATTERN = /^GIT_(AUTHOR|COMMITTER)_(NAME|EMAIL|DATE)$/;
34
+ export function assertCommitIdentityEnv(overlay) {
35
+ for (const key of Object.keys(overlay)) {
36
+ if (!COMMIT_IDENTITY_ENV_PATTERN.test(key)) {
37
+ throw new Error(`Refusing Git environment overlay ${JSON.stringify(key)}: only ` +
38
+ 'GIT_AUTHOR_/GIT_COMMITTER_ NAME, EMAIL and DATE may be set');
39
+ }
40
+ }
41
+ }
42
+ export function parseArtifactTokenExpiry(token) {
43
+ const separator = token.lastIndexOf(ARTIFACT_TOKEN_ADVISORY_SUFFIX);
44
+ if (separator !== -1) {
45
+ const body = token.slice(0, separator);
46
+ const suffix = token.slice(separator + ARTIFACT_TOKEN_ADVISORY_SUFFIX.length);
47
+ if (!ARTIFACT_TOKEN_BODY.test(body) || !/^\d{1,15}$/.test(suffix)) {
48
+ throw new Error('Artifacts returned an unexpected token format');
49
+ }
50
+ const expiry = Number(suffix);
51
+ if (!Number.isSafeInteger(expiry)) {
52
+ throw new Error('Artifacts returned an invalid token expiry');
53
+ }
54
+ return expiry;
55
+ }
56
+ if (!ARTIFACT_TOKEN_BODY.test(token)) {
57
+ throw new Error('Artifacts returned an unexpected token format');
58
+ }
59
+ return null;
60
+ }
61
+ export function credentialSecretVariants(secrets) {
62
+ const variants = new Set();
63
+ for (const secret of secrets) {
64
+ if (!secret)
65
+ continue;
66
+ variants.add(secret);
67
+ const bareBody = ARTIFACT_TOKEN_BARE_BODY.exec(secret)?.[0];
68
+ if (bareBody)
69
+ variants.add(bareBody);
70
+ }
71
+ return [...variants];
72
+ }
73
+ export function redactSecrets(value, secrets) {
74
+ return credentialSecretVariants(secrets)
75
+ .filter((secret) => secret.length >= 4)
76
+ .sort((left, right) => right.length - left.length)
77
+ .reduce((redacted, secret) => redacted.split(secret).join('[REDACTED]'), value);
78
+ }
79
+ export async function createEphemeralAskPass(root) {
80
+ const authDir = join(root, 'git-auth');
81
+ await mkdir(authDir, { recursive: true, mode: 0o700 });
82
+ await chmod(authDir, 0o700);
83
+ const path = join(authDir, 'askpass.sh');
84
+ const script = `#!/bin/sh
85
+ case "$1" in
86
+ *sername*) printf '%s\\n' x ;;
87
+ *assword*)
88
+ IFS= read -r password <&3 || exit 1
89
+ [ -n "$password" ] || exit 1
90
+ printf '%s\\n' "$password"
91
+ ;;
92
+ *) exit 1 ;;
93
+ esac
94
+ `;
95
+ await writeFile(path, script, { mode: 0o700 });
96
+ await chmod(path, 0o700);
97
+ return {
98
+ path,
99
+ dispose: () => rm(authDir, { recursive: true, force: true }),
100
+ };
101
+ }
102
+ function minimalGitChildEnvironment(base) {
103
+ const selected = { NODE_ENV: base.NODE_ENV };
104
+ for (const key of GIT_CHILD_ENV_ALLOWLIST) {
105
+ if (base[key] !== undefined)
106
+ selected[key] = base[key];
107
+ }
108
+ return selected;
109
+ }
110
+ export function buildGitAuthEnvironment(auth, base = process.env) {
111
+ parseArtifactTokenExpiry(auth.token);
112
+ const env = {
113
+ ...minimalGitChildEnvironment(base),
114
+ LC_ALL: 'C',
115
+ GIT_TERMINAL_PROMPT: '0',
116
+ GIT_ASKPASS: auth.askPassPath,
117
+ GIT_ASKPASS_REQUIRE: 'force',
118
+ GIT_CONFIG_NOSYSTEM: '1',
119
+ GIT_CONFIG_GLOBAL: '/dev/null',
120
+ GIT_CONFIG_COUNT: '2',
121
+ GIT_CONFIG_KEY_0: 'credential.helper',
122
+ GIT_CONFIG_VALUE_0: '',
123
+ GIT_CONFIG_KEY_1: 'credential.useHttpPath',
124
+ GIT_CONFIG_VALUE_1: 'true',
125
+ };
126
+ for (const key of GIT_CONTEXT_ENV_KEYS)
127
+ delete env[key];
128
+ return env;
129
+ }
130
+ function buildUnauthenticatedGitEnvironment(base = process.env) {
131
+ const env = {
132
+ ...minimalGitChildEnvironment(base),
133
+ LC_ALL: 'C',
134
+ GIT_TERMINAL_PROMPT: '0',
135
+ GIT_CONFIG_NOSYSTEM: '1',
136
+ GIT_CONFIG_GLOBAL: '/dev/null',
137
+ };
138
+ for (const key of GIT_CONTEXT_ENV_KEYS)
139
+ delete env[key];
140
+ return env;
141
+ }
142
+ export function assertSafeGitInvocation(args, secrets = []) {
143
+ const joined = args.join('\u0000');
144
+ for (const secret of credentialSecretVariants(secrets)) {
145
+ if (joined.includes(secret))
146
+ throw new Error('Refusing to place a credential in Git argv');
147
+ }
148
+ for (const arg of args) {
149
+ if (!/^https?:\/\//i.test(arg))
150
+ continue;
151
+ const url = new URL(arg);
152
+ if (url.username || url.password) {
153
+ throw new Error('Refusing a Git remote URL containing userinfo');
154
+ }
155
+ }
156
+ }
157
+ function signalGitProcess(child, signal) {
158
+ try {
159
+ if (process.platform !== 'win32' && child.pid)
160
+ process.kill(-child.pid, signal);
161
+ else
162
+ child.kill(signal);
163
+ }
164
+ catch {
165
+ // The process may have exited between the state check and the signal.
166
+ }
167
+ }
168
+ export const defaultGitRunner = (args, { cwd, auth, env: suppliedEnv, commitIdentityEnv, timeoutMs = DEFAULT_GIT_TIMEOUT_MS, signal }) => new Promise((resolve, reject) => {
169
+ if (!Number.isInteger(timeoutMs) || timeoutMs <= 0) {
170
+ reject(new Error('Git timeout must be a positive integer'));
171
+ return;
172
+ }
173
+ const secrets = auth ? [auth.token] : [];
174
+ assertSafeGitInvocation(args, secrets);
175
+ if (signal?.aborted) {
176
+ resolve({
177
+ exitCode: 130,
178
+ stdout: '',
179
+ stderr: 'Git operation cancelled',
180
+ cancelled: true,
181
+ });
182
+ return;
183
+ }
184
+ const baseEnv = auth
185
+ ? buildGitAuthEnvironment(auth, suppliedEnv)
186
+ : buildUnauthenticatedGitEnvironment(suppliedEnv);
187
+ let env = baseEnv;
188
+ if (commitIdentityEnv) {
189
+ assertCommitIdentityEnv(commitIdentityEnv);
190
+ env = { ...baseEnv, ...commitIdentityEnv };
191
+ }
192
+ const spawnArgs = auth ? ['-c', 'core.hooksPath=/dev/null', ...args] : args;
193
+ const child = spawn('git', spawnArgs, {
194
+ cwd,
195
+ env,
196
+ detached: process.platform !== 'win32',
197
+ stdio: auth ? ['ignore', 'pipe', 'pipe', 'pipe'] : ['ignore', 'pipe', 'pipe'],
198
+ });
199
+ let stdout = '';
200
+ let stderr = '';
201
+ let termination = null;
202
+ let settled = false;
203
+ let killTimer = null;
204
+ let hardStopTimer = null;
205
+ let timeoutTimer = null;
206
+ const cleanup = () => {
207
+ if (timeoutTimer)
208
+ clearTimeout(timeoutTimer);
209
+ if (killTimer)
210
+ clearTimeout(killTimer);
211
+ if (hardStopTimer)
212
+ clearTimeout(hardStopTimer);
213
+ signal?.removeEventListener('abort', cancel);
214
+ };
215
+ const finish = (exitCode) => {
216
+ if (settled)
217
+ return;
218
+ settled = true;
219
+ cleanup();
220
+ resolve({
221
+ exitCode,
222
+ stdout: redactSecrets(stdout, secrets),
223
+ stderr: redactSecrets(stderr, secrets),
224
+ timedOut: termination === 'timeout' || undefined,
225
+ cancelled: termination === 'cancelled' || undefined,
226
+ });
227
+ };
228
+ const terminate = (reason) => {
229
+ if (termination || settled)
230
+ return;
231
+ termination = reason;
232
+ signalGitProcess(child, 'SIGTERM');
233
+ killTimer = setTimeout(() => signalGitProcess(child, 'SIGKILL'), GIT_TERMINATION_GRACE_MS);
234
+ killTimer.unref?.();
235
+ hardStopTimer = setTimeout(() => finish(reason === 'timeout' ? 124 : 130), GIT_TERMINATION_GRACE_MS * 2);
236
+ hardStopTimer.unref?.();
237
+ };
238
+ const fail = (error) => {
239
+ if (settled)
240
+ return;
241
+ settled = true;
242
+ cleanup();
243
+ signalGitProcess(child, 'SIGKILL');
244
+ reject(error);
245
+ };
246
+ const cancel = () => terminate('cancelled');
247
+ timeoutTimer = setTimeout(() => terminate('timeout'), timeoutMs);
248
+ timeoutTimer.unref?.();
249
+ signal?.addEventListener('abort', cancel, { once: true });
250
+ if (signal?.aborted)
251
+ cancel();
252
+ const childStdout = child.stdout;
253
+ const childStderr = child.stderr;
254
+ if (!childStdout || !childStderr) {
255
+ fail(new Error('Could not capture Git process output'));
256
+ return;
257
+ }
258
+ childStdout.setEncoding('utf8');
259
+ childStderr.setEncoding('utf8');
260
+ childStdout.on('data', (chunk) => {
261
+ stdout += chunk;
262
+ });
263
+ childStderr.on('data', (chunk) => {
264
+ stderr += chunk;
265
+ });
266
+ child.on('error', (error) => {
267
+ if (termination) {
268
+ finish(termination === 'timeout' ? 124 : 130);
269
+ return;
270
+ }
271
+ fail(error);
272
+ });
273
+ child.on('close', (code) => {
274
+ finish(termination === 'timeout' ? 124 : termination === 'cancelled' ? 130 : (code ?? 1));
275
+ });
276
+ if (auth) {
277
+ const credentialPipe = child.stdio[3];
278
+ if (!credentialPipe) {
279
+ fail(new Error('Could not establish one-use Git credential pipe'));
280
+ return;
281
+ }
282
+ credentialPipe.on('error', () => {
283
+ /* EPIPE if Git fails before auth. */
284
+ });
285
+ if (termination) {
286
+ credentialPipe.destroy();
287
+ return;
288
+ }
289
+ try {
290
+ credentialPipe.end(`${auth.token}\n`);
291
+ }
292
+ catch (error) {
293
+ fail(error instanceof Error ? error : new Error('Could not write the one-use Git credential'));
294
+ }
295
+ }
296
+ });
297
+ export async function gitOk(runGit, args, options, operation) {
298
+ const result = await runGit(args, options);
299
+ if (result.timedOut)
300
+ throw new Error(`${operation} timed out`);
301
+ if (result.cancelled)
302
+ throw new Error(`${operation} cancelled`);
303
+ if (result.exitCode !== 0) {
304
+ const secrets = options.auth ? [options.auth.token] : [];
305
+ const detail = redactSecrets((result.stderr || result.stdout).trim(), secrets);
306
+ throw new Error(detail ? `${operation} failed: ${detail}` : `${operation} failed`);
307
+ }
308
+ return result.stdout.trim();
309
+ }
310
+ export async function revParse(runGit, cwd, ref) {
311
+ return gitOk(runGit, ['rev-parse', '--verify', ref], { cwd }, `resolve ${ref}`);
312
+ }
@@ -0,0 +1,5 @@
1
+ export declare const CLOUDFLARE_ARTIFACTS_HOST_PATTERN: RegExp;
2
+ export declare const CLOUDFLARE_ARTIFACTS_GIT_PATH_PATTERN: RegExp;
3
+ export declare function parseCanonicalCredentialFreeHttpsUrl(remote: unknown): URL | null;
4
+ export declare function isValidCloudflareArtifactsGitRemote(remote: unknown): remote is string;
5
+ //# sourceMappingURL=cloudflare-artifacts-git-remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare-artifacts-git-remote.d.ts","sourceRoot":"","sources":["../src/cloudflare-artifacts-git-remote.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,QACC,CAAA;AAE/C,eAAO,MAAM,qCAAqC,QACmC,CAAA;AAErF,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,CAWhF;AAED,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,CAIrF"}
@@ -0,0 +1,21 @@
1
+ export const CLOUDFLARE_ARTIFACTS_HOST_PATTERN = /^[0-9a-f]{32}\.artifacts\.cloudflare\.net$/u;
2
+ export const CLOUDFLARE_ARTIFACTS_GIT_PATH_PATTERN = /^\/git\/[A-Za-z0-9][A-Za-z0-9._-]{0,255}\/[A-Za-z0-9][A-Za-z0-9._-]{0,255}\.git$/u;
3
+ export function parseCanonicalCredentialFreeHttpsUrl(remote) {
4
+ if (typeof remote !== 'string')
5
+ return null;
6
+ try {
7
+ const parsed = new URL(remote);
8
+ return parsed.protocol === 'https:' && !parsed.username && !parsed.password &&
9
+ !parsed.port && !parsed.search && !parsed.hash && parsed.toString() === remote
10
+ ? parsed
11
+ : null;
12
+ }
13
+ catch {
14
+ return null;
15
+ }
16
+ }
17
+ export function isValidCloudflareArtifactsGitRemote(remote) {
18
+ const parsed = parseCanonicalCredentialFreeHttpsUrl(remote);
19
+ return parsed !== null && CLOUDFLARE_ARTIFACTS_HOST_PATTERN.test(parsed.hostname) &&
20
+ CLOUDFLARE_ARTIFACTS_GIT_PATH_PATTERN.test(parsed.pathname);
21
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"git-credential.d.ts","sourceRoot":"","sources":["../src/git-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAE1F,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,oBAAoB,CAAA;IAC9B,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,MAAM,CAAA;CACrB;AAmBD,eAAO,MAAM,mBAAmB,4BAGtB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;IAC7C,QAAQ,CAAC,OAAO,EAAE,gB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CAAA;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,MAAM,CAAA;CACrB;AAiBD,eAAO,MAAM,mBAAmB,4BAGtB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;IAC7C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC1C;AAQD;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,uBAAuB,GAAG,IAAI,CA8BhC;AAED,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,EAAE,eAAe,GAClB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU1E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0BrE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAKrE;AA0RD,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA+FvF"}
@@ -19,10 +19,10 @@
19
19
  */
20
20
  import { existsSync } from 'fs';
21
21
  import { dirname, join } from 'path';
22
+ import { CLOUDFLARE_ARTIFACTS_HOST_PATTERN as ARTIFACTS_HOST } from './cloudflare-artifacts-git-remote.js';
22
23
  import { authedFetch } from './http.js';
23
24
  import { readJsonManifest } from './workspace.js';
24
25
  const GITHUB_HOST = 'github.com';
25
- const ARTIFACTS_HOST = /^[0-9a-f]{32}\.artifacts\.cloudflare\.net$/;
26
26
  /**
27
27
  * ALI-1285: the Artifacts contract declares the credential OPAQUE
28
28
  * (`plaintext: string`) with no documented body format. Pinning
@@ -16,6 +16,7 @@ export interface HardenedGitEnvironmentInput {
16
16
  credentialHelper?: RecoveryCredentialHelperInvocation;
17
17
  sourceEnv?: NodeJS.ProcessEnv;
18
18
  }
19
+ export declare function shellQuote(value: string): string;
19
20
  /**
20
21
  * Construct, rather than scrub, the environment. Only PATH crosses the
21
22
  * boundary from the parent process. Provider tokens, cloud credentials,
@@ -1 +1 @@
1
- {"version":3,"file":"git-recovery-environment.d.ts","sourceRoot":"","sources":["../src/git-recovery-environment.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAA;AAElD,MAAM,WAAW,kCAAkC;IACjD;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACjD,gBAAgB,CAAC,EAAE,kCAAkC,CAAA;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAC9B;AA0GD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,2BAA2B,GACjC,MAAM,CAAC,UAAU,CA6CnB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBrB"}
1
+ {"version":3,"file":"git-recovery-environment.d.ts","sourceRoot":"","sources":["../src/git-recovery-environment.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAA;AAElD,MAAM,WAAW,kCAAkC;IACjD;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACjD,gBAAgB,CAAC,EAAE,kCAAkC,CAAA;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAC9B;AAoCD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAoED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,2BAA2B,GACjC,MAAM,CAAC,UAAU,CA6CnB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBrB"}
@@ -20,7 +20,7 @@ function normalizeProtocols(protocols) {
20
20
  }
21
21
  return normalized;
22
22
  }
23
- function shellQuote(value) {
23
+ export function shellQuote(value) {
24
24
  return `'${value.replace(/'/g, "'\\''")}'`;
25
25
  }
26
26
  function credentialHelperConfigValue(helper) {
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,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AE,EAAE,CAAA;IACpB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAuCD,eAAO,MAAM,YAAY,EAAE,aAAa,EAsqCvC,CAAA;AAUD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,GAAG,SAAS,CAMxE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAWrE;AAOD,wBAAgB,cAAc,IAAI,MAAM,CA0CvC;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAoBtD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA4B5D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAgBxD;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;EAoB9C"}
package/dist/help.js CHANGED
@@ -52,18 +52,45 @@ export const COMMAND_DOCS = [
52
52
  { path: ['instructions', 'profiles', 'new'], aliases: [['instruction-sets', 'profiles', 'new']], usage: 'orizu instructions profiles new <set> --project <team/project> --model-config <identity> [--json]', summary: 'Create a model-config profile seeded from the instruction-set default.', group: 'Instruction sets', options: [{ name: '--model-config <identity>', help: 'Model config identity for the new profile.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions profiles new planner --project core/evals --model-config anthropic/claude-haiku'] },
53
53
  { path: ['instructions', 'profiles', 'promote'], aliases: [['instruction-sets', 'profiles', 'promote']], usage: 'orizu instructions profiles promote <set> --project <team/project> --model-config <identity> --version <n> [--json]', summary: 'Move one profile version to production.', group: 'Instruction sets', options: [{ name: '--model-config <identity>', help: 'Profile model config.', required: true }, { name: '--version <n>', help: 'Profile version to promote.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions profiles promote planner --project core/evals --model-config anthropic/claude-haiku --version 2'] },
54
54
  { path: ['instructions', 'profiles', 'rollback'], aliases: [['instruction-sets', 'profiles', 'rollback']], usage: 'orizu instructions profiles rollback <set> --project <team/project> --model-config <identity> --to <n> [--json]', summary: 'Create a rollback version and move profile production to it.', group: 'Instruction sets', options: [{ name: '--model-config <identity>', help: 'Profile model config.', required: true }, { name: '--to <n>', help: 'Historical profile version to copy.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions profiles rollback planner --project core/evals --model-config anthropic/claude-haiku --to 1'] },
55
- { path: ['instructions', 'default', 'show'], aliases: [['instruction-sets', 'default', 'show']], usage: 'orizu instructions default show <set> --project <team/project> [--json]', summary: 'Show the instruction-set default and its resolution impact.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default show planner --project core/evals'] },
56
- { path: ['instructions', 'default', 'move'], aliases: [['instruction-sets', 'default', 'move']], usage: 'orizu instructions default move <set> --project <team/project> --model-config <identity> --version <n> [--json]', summary: 'Move the instruction-set default to a profile version.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--model-config <identity>', help: 'Target model config.', required: true }, { name: '--version <n>', help: 'Target profile version.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default move planner --project core/evals --model-config anthropic/claude-haiku --version 2'] },
55
+ { path: ['instructions', 'default', 'show'], aliases: [['instruction-sets', 'default', 'show']], usage: 'orizu instructions default show <set> --project <team/project> [--json]', summary: 'Show the Default Profile and its Production state.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default show planner --project core/evals'] },
56
+ { path: ['instructions', 'default', 'move'], aliases: [['instruction-sets', 'default', 'move']], usage: 'orizu instructions default move <set> --project <team/project> --model-config <identity> [--json]', summary: 'Move the instruction-set Default to a Profile.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--model-config <identity>', help: 'Target Profile identity.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default move planner --project core/evals --model-config anthropic/claude-haiku'] },
57
57
  { path: ['instructions', 'shape', 'add'], aliases: [['instruction-sets', 'shape', 'add']], usage: 'orizu instructions shape add <set> --project <team/project> --key <key> --from <manifest> [--json]', summary: 'Add one component key to every instruction-set profile.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--key <key>', help: 'Component key to add.', required: true }, { name: '--from <manifest>', help: 'Manifest containing the component body.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions shape add planner --project core/evals --key skill --from planner.json'] },
58
58
  { path: ['instructions', 'shape', 'remove'], aliases: [['instruction-sets', 'shape', 'remove']], usage: 'orizu instructions shape remove <set> --project <team/project> --key <key> [--json]', summary: 'Remove one component key from every instruction-set profile.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--key <key>', help: 'Component key to remove.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions shape remove planner --project core/evals --key skill'] },
59
59
  {
60
60
  path: ['instructions', 'sync'],
61
61
  aliases: [['instruction-sets', 'sync']],
62
- usage: 'orizu instructions sync <set> --out <dir> [--model-config <identity>] [--project <team/project>] [--json]',
63
- summary: 'Write an instruction set for offline runner loading.',
62
+ usage: 'orizu instructions sync <set|set/profile|set/profile@vN> [--version <n>] [--out <app-root>] [--target <ts>] [--force-helpers] [--project <team/project>] [--json]',
63
+ summary: 'Materialize one Profile Version and update the instruction set Lock.',
64
64
  group: 'Instruction sets',
65
- options: [{ name: '--out <dir>', help: 'Destination parent directory.', required: true }, { name: '--model-config <identity>', help: 'Sync only one profile plus default.' }, { name: '--project <team/project>', help: 'Project slug.' }, { name: '--json', help: 'Print source transport JSON.' }],
66
- examples: ['orizu instructions sync planner --out ./instructions --project core/evals'],
65
+ options: [{ name: '--version <n>', help: 'Exact Profile Version (equivalent to @vN).' }, { name: '--out <app-root>', help: 'App root containing orizu/ (default: current directory).' }, { name: '--target <ts>', help: 'Generated artifact target (default: ts).', choices: ['ts'] }, { name: '--force-helpers', help: 'Overwrite edited vendored Helpers and refresh pristine fingerprints.' }, { name: '--project <team/project>', help: 'Project slug.' }, { name: '--json', help: 'Print source transport JSON.' }],
66
+ examples: ['orizu instructions sync planner/openai/gpt-5.6-luna@v2 --out . --project core/evals'],
67
+ },
68
+ {
69
+ path: ['instructions', 'update'],
70
+ aliases: [['instruction-sets', 'update']],
71
+ usage: 'orizu instructions update [--out <app-root>] [--project <team/project>] [--no-sync] [--yes] [--json]',
72
+ summary: 'Plan or apply fresh Default and Production Pointer resolutions.',
73
+ group: 'Instruction sets',
74
+ options: [{ name: '--out <app-root>', help: 'App root containing orizu/ (default: current directory).' }, { name: '--project <team/project>', help: 'Project slug.' }, { name: '--no-sync', help: 'Record Pointer targets without materializing absent Versions.' }, { name: '--yes', help: 'Apply the printed plan.' }, { name: '--json', help: 'Print the machine-readable plan.' }],
75
+ examples: ['orizu instructions update --out . --project core/evals --yes'],
76
+ },
77
+ {
78
+ path: ['instructions', 'prune'],
79
+ aliases: [['instruction-sets', 'prune']],
80
+ usage: 'orizu instructions prune [--out <app-root>] [--keep <set/profile@vN>]... [--yes] [--json]',
81
+ summary: 'Verify, then plan or remove unreferenced Synced versions.',
82
+ group: 'Instruction sets',
83
+ options: [{ name: '--out <app-root>', help: 'App root containing orizu/ (default: current directory).' }, { name: '--keep <set/profile@vN>', help: 'Retain an exact Version in addition to Lock Pins.', repeatable: true }, { name: '--yes', help: 'Apply the printed plan.' }, { name: '--json', help: 'Print the machine-readable plan.' }],
84
+ examples: ['orizu instructions prune --out . --keep planner/openai/gpt-5.6-luna@v2 --yes'],
85
+ },
86
+ {
87
+ path: ['instructions', 'verify'],
88
+ aliases: [['instruction-sets', 'verify']],
89
+ usage: 'orizu instructions verify [--out <app-root>] [--json]',
90
+ summary: 'Verify the Lock, Synced versions, generated modules, and runtime-loaded bytes offline.',
91
+ group: 'Instruction sets',
92
+ options: [{ name: '--out <app-root>', help: 'App root containing orizu/ (default: current directory).' }, { name: '--json', help: 'Print the machine-readable verification report.' }],
93
+ examples: ['orizu instructions verify --out .'],
67
94
  },
68
95
  { path: ['instructions', 'archive'], aliases: [['instruction-sets', 'archive']], usage: 'orizu instructions archive <slug-or-exact-name> --project <team/project> [--json]', summary: 'Archive an instruction set without changing resolution or sync.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions archive planner --project core/evals'] },
69
96
  { path: ['instructions', 'restore'], aliases: [['instruction-sets', 'restore']], usage: 'orizu instructions restore <slug-or-exact-name> --project <team/project> [--json]', summary: 'Restore an archived instruction set.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions restore planner --project core/evals'] },
@@ -477,7 +504,7 @@ export const COMMAND_DOCS = [
477
504
  },
478
505
  {
479
506
  path: ['scorers', 'detail'],
480
- usage: 'orizu scorers detail <scorer-id-or-name> --project <team/project> [--json]',
507
+ usage: 'orizu scorers detail <scorer-id-or-name> --project <team/project> [--profile-version <id>] [--json]',
481
508
  summary: 'Show scorer details.',
482
509
  group: 'Scorers and runners',
483
510
  },
@@ -489,7 +516,7 @@ export const COMMAND_DOCS = [
489
516
  },
490
517
  {
491
518
  path: ['scorers', 'exec'],
492
- usage: 'orizu scorers exec --scorer-version <id> (--subject-version <prompt-version-id> | --optimization-run <id> --candidate <id>) --dataset-version <id> --split-set <id> --split <name> [--subject-results <jsonl>] [--dependency-score-run <alias=id>] [--dependency-results <alias=path>] [--no-submit] [--out <score.json>] [--project <team/project>] [--json]',
519
+ usage: 'orizu scorers exec --scorer-version <id> (--subject-version <prompt-version-id> | --optimization-run <id> --candidate <id>) --dataset-version <id> --split-set <id> --split <name> [--subject-results <jsonl>] [--dependency-score-run <alias=id>] [--dependency-results <alias=path>] [--no-submit] [--out <score.json>] [--project <team/project>] [--instructions <specifier>] [--instructions-root <dir>] [--json]',
493
520
  summary: 'Execute a scorer locally for a prompt version or optimization candidate.',
494
521
  group: 'Scorers and runners',
495
522
  },
@@ -501,7 +528,7 @@ export const COMMAND_DOCS = [
501
528
  },
502
529
  {
503
530
  path: ['scores', 'submit'],
504
- usage: 'orizu scores submit <results.jsonl|results.json> --scorer-version <id> (--subject-version <prompt-version-id> | --optimization-run <id> --candidate <id>) [--aggregate] [--dataset-version <id> --split-set <id> --split <name>] [--project <team/project>] [--json]',
531
+ usage: 'orizu scores submit <results.jsonl|results.json> --scorer-version <id> (--subject-version <prompt-version-id> | --optimization-run <id> --candidate <id>) [--aggregate] [--dataset-version <id> --split-set <id> --split <name>] [--project <team/project>] [--instructions <specifier>] [--instructions-root <dir>] [--json]',
505
532
  summary: 'Submit score results for a scorer against a prompt version or optimization candidate.',
506
533
  group: 'Scorers and runners',
507
534
  },
@@ -555,10 +582,16 @@ export const COMMAND_DOCS = [
555
582
  },
556
583
  {
557
584
  path: ['runs', 'submit'],
558
- usage: 'orizu runs submit <results.jsonl|results.jsonl.gz> --prompt-version <id> --runner-version <id> --dataset-version <id> --split-set <id> --split <name> [--project <team/project>]',
585
+ usage: 'orizu runs submit <results.jsonl|results.jsonl.gz> --prompt-version <id> --runner-version <id> --dataset-version <id> --split-set <id> --split <name> [--project <team/project>] [--instructions <specifier>] [--instructions-root <dir>]',
559
586
  summary: 'Submit local prompt-run results.',
560
587
  group: 'Scorers and runners',
561
588
  },
589
+ {
590
+ path: ['runs', 'list'],
591
+ usage: 'orizu runs list [--project <team/project>] [--profile-version <id>] [--prompt-version <id>] [--limit <n>] [--json]',
592
+ summary: 'List execution runs, optionally filtered by exact Profile Version or prompt version.',
593
+ group: 'Scorers and runners',
594
+ },
562
595
  {
563
596
  path: ['optimizations', 'start'],
564
597
  usage: 'orizu optimizations start --project <team/project> --optimizer-version <id> --prompt-version <id[,id]> --selection-scorer <id> [--reflection-scorer <id>] [--pareto-scorer <id>] [--best-scorer <id>] --dataset-version <id> --split-set <id> [--train-split <name>] [--validation-split <name>] [--metadata <json|@file>] [--json]',
@@ -567,7 +600,7 @@ export const COMMAND_DOCS = [
567
600
  },
568
601
  {
569
602
  path: ['optimizations', 'list'],
570
- usage: 'orizu optimizations list [--project <team/project>] [--status active|archived|all] [--json]',
603
+ usage: 'orizu optimizations list [--project <team/project>] [--status active|archived|all] [--profile-version <id>] [--json]',
571
604
  summary: 'List optimization runs with explicit archive visibility.',
572
605
  group: 'Optimizations',
573
606
  },