@orkestrel/scaffold 0.0.133 → 0.0.135
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/agents/skills/orkestrel-dispatch/scripts/bench.js +61 -96
- package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +48 -76
- package/dist/agents/skills/orkestrel-dispatch/scripts/chain.js +27 -66
- package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +31 -64
- package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +43 -57
- package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +43 -86
- package/dist/agents/skills/orkestrel-dispatch/scripts/patch.js +68 -104
- package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +35 -69
- package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +47 -84
- package/dist/agents/skills/orkestrel-falsify/scripts/mutate.js +134 -116
- package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +38 -90
- package/dist/agents/skills/orkestrel-harden/scripts/interleave.js +39 -103
- package/dist/agents/skills/orkestrel-harden/scripts/measure.js +40 -89
- package/dist/agents/skills/orkestrel-harden/scripts/titles.js +41 -87
- package/dist/agents/skills/orkestrel-parallel/scripts/cases.js +43 -88
- package/dist/agents/skills/orkestrel-parallel/scripts/lane.js +1568 -213
- package/dist/agents/skills/orkestrel-publish/scripts/compare.js +40 -60
- package/dist/agents/skills/orkestrel-publish/scripts/pins.js +47 -81
- package/dist/agents/skills/orkestrel-publish/scripts/steps.js +66 -104
- package/dist/agents/skills/orkestrel-publish/scripts/swap.js +74 -88
- package/dist/agents/skills/orkestrel-publish/scripts/wave.js +387 -109
- package/dist/agents/skills/orkestrel-publish/scripts/window.js +55 -96
- package/dist/agents/skills/orkestrel-scout/scripts/map.js +54 -101
- package/dist/bin/main.js +275 -33
- package/dist/bin/main.js.map +1 -1
- package/dist/host/AGENTS.md +1 -1
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +81 -97
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +64 -72
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/chain.ts +41 -63
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +56 -79
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +61 -74
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +59 -89
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/patch.ts +87 -106
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +57 -76
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +73 -88
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +2 -2
- package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +167 -119
- package/dist/host/agents/skills/orkestrel-harden/references/methods.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +58 -75
- package/dist/host/agents/skills/orkestrel-harden/scripts/interleave.ts +55 -99
- package/dist/host/agents/skills/orkestrel-harden/scripts/measure.ts +59 -90
- package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +60 -80
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +4 -4
- package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +71 -108
- package/dist/host/agents/skills/orkestrel-parallel/scripts/lane.ts +1990 -274
- package/dist/host/agents/skills/orkestrel-publish/references/release.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +28 -7
- package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +58 -79
- package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +66 -87
- package/dist/host/agents/skills/orkestrel-publish/scripts/steps.ts +84 -102
- package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +92 -99
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +483 -127
- package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +82 -120
- package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
- package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +85 -112
- package/dist/host/claude/agents/orkestrel.md +16 -16
- package/dist/host/claude/rules/architecture.md +1 -1
- package/dist/host/claude/rules/documentation.md +1 -1
- package/dist/host/claude/rules/patterns.md +7 -4
- package/dist/host/claude/rules/styles.md +1 -1
- package/dist/host/claude/rules/tests.md +3 -3
- package/dist/host/claude/rules/workspace.md +50 -37
- package/dist/host/configs/helpers.ts +117 -71
- package/dist/host/dotfiles/oxlintrc.json +6 -0
- package/dist/host/guides/agent.md +989 -395
- package/dist/host/guides/database.md +357 -342
- package/dist/host/guides/form.md +79 -4
- package/dist/host/guides/middleware.md +5 -5
- package/dist/host/guides/ollama.md +41 -42
- package/dist/host/guides/scaffold.md +170 -70
- package/dist/host/guides/study.md +12 -12
- package/dist/host/guides/table.md +20 -6
- package/dist/host/guides/test.md +166 -52
- package/dist/host/guides/toolbox.md +127 -81
- package/dist/host/guides/workspace.md +21 -14
- package/dist/host/manifest.json +54 -54
- package/dist/host/tests/config.test.ts +251 -7
- package/dist/host/tests/policy.test.ts +14 -21
- package/dist/host/tests/setupPolicy.ts +43 -36
- package/dist/src/core/index.cjs +533 -139
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +223 -16
- package/dist/src/core/index.d.ts +223 -16
- package/dist/src/core/index.js +524 -139
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +23 -14
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +3 -2
- package/dist/src/server/index.d.ts +3 -2
- package/dist/src/server/index.js +24 -15
- package/dist/src/server/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,116 +1,72 @@
|
|
|
1
1
|
// Check a Vitest JSON report against named red and green cases. Run from the checkout root:
|
|
2
2
|
// node .agents/skills/orkestrel-parallel/scripts/cases.ts --report FILE.json [--passed NAME ...] [--failed NAME ...]
|
|
3
3
|
// The report is Vitest's `--reporter=json` output. A name matches every case whose full name (its
|
|
4
|
-
// `describe` titles and its own title, joined by spaces) or whose own title equals it exactly;
|
|
5
|
-
// that opens with
|
|
6
|
-
// passed and each `--failed NAME` requires every one to have failed; a name that
|
|
7
|
-
// missing. A failed case that no name matches is refused, so a run that fails
|
|
8
|
-
// expected reads as a difference. A test file that failed with no failed case
|
|
9
|
-
// or a hook threw) is an unnamed failure named by its file, and a report whose
|
|
10
|
-
// while no case and no file failed is a difference too. Name no case to require
|
|
11
|
-
// failure. Both flags repeat and a name may not be given to both. The script
|
|
12
|
-
// line, one line per difference, and `ok` or `differences=N`. The script
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
import {
|
|
4
|
+
// `describe` titles and its own title, joined by spaces) or whose own title equals it exactly; give
|
|
5
|
+
// a name that opens with `-` in the `--passed=NAME` form. Each `--passed NAME` requires every case
|
|
6
|
+
// it matches to have passed and each `--failed NAME` requires every one to have failed; a name that
|
|
7
|
+
// matches no case is missing. A failed case that no name matches is refused, so a run that fails
|
|
8
|
+
// more than the request expected reads as a difference. A test file that failed with no failed case
|
|
9
|
+
// (it did not collect, or a hook threw) is an unnamed failure named by its file, and a report whose
|
|
10
|
+
// `success` is false while no case and no file failed is a difference too. Name no case to require
|
|
11
|
+
// a report with no failure. Both flags repeat and a name may not be given to both. The script
|
|
12
|
+
// prints one summary line, one line per difference, and `ok` or `differences=N`. The script reads
|
|
13
|
+
// its flags with `parseArgs` in strict mode. Exit 0 when the report matches the names, 3 when it
|
|
14
|
+
// does not, 2 when the report cannot be read as a Vitest report, 64 on usage.
|
|
15
|
+
import type { ParseArgsOptionsConfig } from 'node:util'
|
|
16
|
+
import { readFileSync, realpathSync, statSync } from 'node:fs'
|
|
17
17
|
import { relative } from 'node:path'
|
|
18
|
-
|
|
19
|
-
/** Lists the flags that take a value. */
|
|
20
|
-
export const VALUE_FLAGS: readonly string[] = ['--report', '--passed', '--failed']
|
|
21
|
-
|
|
22
|
-
/** Lists every flag the script reads, value flags and switches alike. */
|
|
23
|
-
export const FLAGS: readonly string[] = VALUE_FLAGS
|
|
18
|
+
import { parseArgs } from 'node:util'
|
|
24
19
|
|
|
25
20
|
/** Holds the usage line printed when a call names no report. */
|
|
26
21
|
export const USAGE =
|
|
27
22
|
'usage: cases.ts --report FILE.json [--passed NAME ...] [--failed NAME ...]; --passed and --failed repeat'
|
|
28
23
|
|
|
29
|
-
/**
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Names the value flags a caller gave with no value, at any occurrence.
|
|
39
|
-
*
|
|
40
|
-
* @param argv - The arguments after the script path.
|
|
41
|
-
* @param names - The flags that take a value.
|
|
42
|
-
* @returns Each named flag that appears last or is followed by another flag, in argument order.
|
|
43
|
-
*/
|
|
44
|
-
export function readMissingFlags(
|
|
45
|
-
argv: readonly string[],
|
|
46
|
-
names: readonly string[],
|
|
47
|
-
): readonly string[] {
|
|
48
|
-
return names.filter((name) =>
|
|
49
|
-
argv.some((argument, index) => argument === name && isMissingValue(argv, index)),
|
|
50
|
-
)
|
|
51
|
-
}
|
|
24
|
+
/** Declares every flag the script reads, for `parseArgs`. */
|
|
25
|
+
export const OPTIONS: ParseArgsOptionsConfig = Object.freeze({
|
|
26
|
+
report: Object.freeze({ type: 'string' }),
|
|
27
|
+
passed: Object.freeze({ type: 'string', multiple: true }),
|
|
28
|
+
failed: Object.freeze({ type: 'string', multiple: true }),
|
|
29
|
+
})
|
|
52
30
|
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*/
|
|
60
|
-
export function isMissingValue(argv: readonly string[], index: number): boolean {
|
|
61
|
-
const value = argv[index + 1]
|
|
62
|
-
return value === undefined || value.startsWith('--')
|
|
31
|
+
/** Describes the arguments `parseArgs` read: each flag's value by name, and the positionals. */
|
|
32
|
+
export interface Arguments {
|
|
33
|
+
readonly values: Readonly<
|
|
34
|
+
Record<string, string | boolean | ReadonlyArray<string | boolean> | undefined>
|
|
35
|
+
>
|
|
36
|
+
readonly positionals: readonly string[]
|
|
63
37
|
}
|
|
64
38
|
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* A `--flag=value` argument is unknown, because the script reads no such form. A bare `--` ends the
|
|
70
|
-
* scan.
|
|
71
|
-
*
|
|
72
|
-
* @param argv - The arguments after the script path.
|
|
73
|
-
* @param flags - Every flag the script reads, value flags and switches alike.
|
|
74
|
-
* @returns Each argument that opens with `--` and is not a read flag, in argument order.
|
|
75
|
-
*/
|
|
76
|
-
export function readUnknownFlags(
|
|
77
|
-
argv: readonly string[],
|
|
78
|
-
flags: readonly string[],
|
|
79
|
-
): readonly string[] {
|
|
80
|
-
const end = argv.indexOf('--')
|
|
81
|
-
return (end === -1 ? argv : argv.slice(0, end)).filter(
|
|
82
|
-
(argument) => argument.startsWith('--') && !flags.includes(argument),
|
|
83
|
-
)
|
|
84
|
-
}
|
|
39
|
+
/** Describes how `parseArgs` read the arguments: the arguments, or the message it refused them with. */
|
|
40
|
+
export type ArgumentsResult =
|
|
41
|
+
| { readonly success: true; readonly value: Arguments }
|
|
42
|
+
| { readonly success: false; readonly error: string }
|
|
85
43
|
|
|
86
44
|
/**
|
|
87
|
-
*
|
|
45
|
+
* Parses the arguments in strict mode against `OPTIONS`.
|
|
88
46
|
*
|
|
89
47
|
* @param argv - The arguments after the script path.
|
|
90
|
-
* @
|
|
91
|
-
* @returns The values in order, empty when the flag never appears.
|
|
48
|
+
* @returns The values and positionals, or the message `parseArgs` refused the arguments with.
|
|
92
49
|
*/
|
|
93
|
-
export function
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
50
|
+
export function parseArguments(argv: readonly string[]): ArgumentsResult {
|
|
51
|
+
try {
|
|
52
|
+
const { values, positionals } = parseArgs({
|
|
53
|
+
args: [...argv],
|
|
54
|
+
options: OPTIONS,
|
|
55
|
+
strict: true,
|
|
56
|
+
allowPositionals: false,
|
|
57
|
+
})
|
|
58
|
+
return { success: true, value: { values, positionals } }
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) }
|
|
61
|
+
}
|
|
98
62
|
}
|
|
99
63
|
|
|
100
|
-
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*/
|
|
107
|
-
export function readPositionals(
|
|
108
|
-
argv: readonly string[],
|
|
109
|
-
valueFlags: readonly string[],
|
|
110
|
-
): readonly string[] {
|
|
111
|
-
return argv.filter(
|
|
112
|
-
(argument, index) => !argument.startsWith('--') && !valueFlags.includes(argv[index - 1] ?? ''),
|
|
113
|
-
)
|
|
64
|
+
/** Describes one test case a report holds. */
|
|
65
|
+
export interface Case {
|
|
66
|
+
readonly file: string
|
|
67
|
+
readonly fullName: string
|
|
68
|
+
readonly title: string
|
|
69
|
+
readonly status: string
|
|
114
70
|
}
|
|
115
71
|
|
|
116
72
|
/**
|
|
@@ -325,6 +281,18 @@ export function readReport(path: string): unknown {
|
|
|
325
281
|
}
|
|
326
282
|
}
|
|
327
283
|
|
|
284
|
+
/**
|
|
285
|
+
* Collects the strings a repeatable flag's value holds.
|
|
286
|
+
*
|
|
287
|
+
* @param value - The value `parseArgs` read for a flag declared with `multiple: true`.
|
|
288
|
+
* @returns Each string in order, empty when the flag never appears.
|
|
289
|
+
*/
|
|
290
|
+
export function collectStrings(value: unknown): readonly string[] {
|
|
291
|
+
return Array.isArray(value)
|
|
292
|
+
? value.filter((member): member is string => typeof member === 'string')
|
|
293
|
+
: []
|
|
294
|
+
}
|
|
295
|
+
|
|
328
296
|
/**
|
|
329
297
|
* Runs the script on its arguments.
|
|
330
298
|
*
|
|
@@ -333,21 +301,16 @@ export function readReport(path: string): unknown {
|
|
|
333
301
|
* cannot be read as a Vitest report, 64 on usage.
|
|
334
302
|
*/
|
|
335
303
|
export function main(argv: readonly string[]): number {
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
console.error(`cases: ${
|
|
339
|
-
return 64
|
|
340
|
-
}
|
|
341
|
-
const missing = readMissingFlags(argv, VALUE_FLAGS)
|
|
342
|
-
if (missing.length > 0) {
|
|
343
|
-
console.error(`cases: ${missing.join(', ')} given with no value`)
|
|
304
|
+
const parsed = parseArguments(argv)
|
|
305
|
+
if (!parsed.success) {
|
|
306
|
+
console.error(`cases: ${parsed.error}; ${USAGE}`)
|
|
344
307
|
return 64
|
|
345
308
|
}
|
|
346
|
-
const
|
|
347
|
-
const path =
|
|
348
|
-
const passed =
|
|
349
|
-
const failed =
|
|
350
|
-
if (path === undefined
|
|
309
|
+
const { values } = parsed.value
|
|
310
|
+
const path = typeof values.report === 'string' ? values.report : undefined
|
|
311
|
+
const passed = collectStrings(values.passed)
|
|
312
|
+
const failed = collectStrings(values.failed)
|
|
313
|
+
if (path === undefined) {
|
|
351
314
|
console.error(USAGE)
|
|
352
315
|
return 64
|
|
353
316
|
}
|
|
@@ -358,7 +321,7 @@ export function main(argv: readonly string[]): number {
|
|
|
358
321
|
)
|
|
359
322
|
return 64
|
|
360
323
|
}
|
|
361
|
-
if (
|
|
324
|
+
if (statSync(path, { throwIfNoEntry: false })?.isFile() !== true) {
|
|
362
325
|
console.error(`cases: ${quote(path)} is not a readable file`)
|
|
363
326
|
return 2
|
|
364
327
|
}
|