@orkestrel/scaffold 0.0.125 → 0.0.126
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/bin/main.js +47 -14
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/orchestration.md +2 -1
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden/references/methods.md +2 -2
- package/dist/host/agents/skills/orkestrel-journey/SKILL.md +18 -19
- package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +2 -1
- package/dist/host/claude/agents/orkestrel.md +12 -12
- package/dist/host/claude/rules/quality.md +3 -0
- package/dist/host/claude/rules/tests.md +3 -0
- package/dist/host/claude/rules/workspace.md +8 -3
- package/dist/host/guides/agent.md +285 -161
- package/dist/host/guides/ndjson.md +4 -3
- package/dist/host/guides/ollama.md +2 -2
- package/dist/host/guides/program.md +3 -3
- package/dist/host/guides/qualifier.md +1 -1
- package/dist/host/guides/scaffold.md +36 -17
- package/dist/host/guides/study.md +22 -12
- package/dist/host/guides/toolbox.md +1 -1
- package/dist/host/manifest.json +18 -18
- package/dist/src/core/index.cjs +9 -7
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +3 -1
- package/dist/src/core/index.d.ts +3 -1
- package/dist/src/core/index.js +9 -7
- package/dist/src/core/index.js.map +1 -1
- package/package.json +4 -4
package/dist/bin/main.js
CHANGED
|
@@ -10,7 +10,7 @@ import { readdirSync } from "node:fs";
|
|
|
10
10
|
import { parseArgs } from "node:util";
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "@orkestrel/scaffold",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.126",
|
|
14
14
|
description: "Scaffold workspaces with commands: new, audit, surface, repair, catalog, and overwrite.",
|
|
15
15
|
keywords: [
|
|
16
16
|
"audit",
|
|
@@ -118,11 +118,11 @@ var package_default = {
|
|
|
118
118
|
"@orkestrel/test": "^0.0.33",
|
|
119
119
|
"@types/node": "^24.19.2",
|
|
120
120
|
"@vitest/browser-playwright": "^5.1.0",
|
|
121
|
-
"oxfmt": "^0.
|
|
122
|
-
"oxlint": "^1.
|
|
121
|
+
"oxfmt": "^0.77.0",
|
|
122
|
+
"oxlint": "^1.93.0",
|
|
123
123
|
"playwright": "^1.64.1",
|
|
124
124
|
"typescript": "^7.0.2",
|
|
125
|
-
"vite": "^8.3.
|
|
125
|
+
"vite": "^8.3.7",
|
|
126
126
|
"vitest": "^5.1.0"
|
|
127
127
|
},
|
|
128
128
|
engines: { "node": ">=22.18.0" }
|
|
@@ -819,6 +819,10 @@ function sheetTestToQuestion(artifact, present) {
|
|
|
819
819
|
* declared chain is a generated predecessor of it.
|
|
820
820
|
*
|
|
821
821
|
* @remarks
|
|
822
|
+
* A publishing manifest's byte-exact former generated chain also joins the writable region: the
|
|
823
|
+
* planned chain with its generated application and journey invocations after `test:src`. A chain
|
|
824
|
+
* that differs in spacing, order, or another step does not match that predecessor.
|
|
825
|
+
*
|
|
822
826
|
* A declared `test` chain is a generated predecessor when it runs fewer `&&` steps than the
|
|
823
827
|
* planned chain and every step it runs is a planned step, in the planned order. That is the chain
|
|
824
828
|
* a birth or an earlier write left before a structural fact planned another step, such as a root
|
|
@@ -833,11 +837,21 @@ function sheetTestToQuestion(artifact, present) {
|
|
|
833
837
|
*/
|
|
834
838
|
function manifestToWritableScripts(manifest, blueprint) {
|
|
835
839
|
const writable = blueprintToWritableScripts(blueprint);
|
|
836
|
-
const
|
|
840
|
+
const generated = blueprintToScripts(blueprint);
|
|
841
|
+
const planned = generated.test;
|
|
837
842
|
const parsed = parseJSON(manifest);
|
|
838
843
|
const scripts = isRecord(parsed) && isRecord(parsed.scripts) ? parsed.scripts : {};
|
|
839
844
|
const declared = scripts.test;
|
|
840
845
|
if (planned === void 0 || !isString(declared)) return writable;
|
|
846
|
+
if (generated.prepublishOnly !== void 0 && isRecord(parsed) && parsed.private !== true) {
|
|
847
|
+
const helpers = Object.keys(generated).filter((name) => name === "test:app" || /^test:journey(:|$)/u.test(name));
|
|
848
|
+
const former = planned.replace("npm run test:src", ["npm run test:src", ...helpers.map((name) => `npm run ${name}`)].join(" && "));
|
|
849
|
+
if (helpers.length > 0 && declared === former) return [...writable, {
|
|
850
|
+
name: "test",
|
|
851
|
+
command: planned,
|
|
852
|
+
accepted: [declared]
|
|
853
|
+
}];
|
|
854
|
+
}
|
|
841
855
|
const steps = declared.split("&&").map((step) => step.trim());
|
|
842
856
|
const expected = planned.split("&&").map((step) => step.trim());
|
|
843
857
|
if (steps.length >= expected.length) return writable;
|
|
@@ -1253,7 +1267,7 @@ function scanScriptTokens(script) {
|
|
|
1253
1267
|
* Reads the literal Vitest projects, configuration paths, and npm run scripts a shell command names.
|
|
1254
1268
|
*
|
|
1255
1269
|
* @param script - The manifest script text to read.
|
|
1256
|
-
* @param wrappers - Planned wrapper paths mapped to the
|
|
1270
|
+
* @param wrappers - Planned wrapper paths mapped to the projects they run.
|
|
1257
1271
|
* @returns The named projects, configurations, and scripts, or `undefined` when the command
|
|
1258
1272
|
* cannot be read literally.
|
|
1259
1273
|
*
|
|
@@ -1364,8 +1378,8 @@ function scriptToInvocations(script, wrappers = /* @__PURE__ */ new Map()) {
|
|
|
1364
1378
|
*
|
|
1365
1379
|
* @param gate - The script name the walk starts at.
|
|
1366
1380
|
* @param scripts - The manifest's scripts by name; a value that is not a string names no command.
|
|
1367
|
-
* @param wrappers - Planned wrapper paths mapped to the
|
|
1368
|
-
* @returns The script names
|
|
1381
|
+
* @param wrappers - Planned wrapper paths mapped to the projects they run.
|
|
1382
|
+
* @returns The visited script names, their readable invocations and Vitest projects, and the
|
|
1369
1383
|
* visited scripts whose command cannot be read literally.
|
|
1370
1384
|
*
|
|
1371
1385
|
* @remarks
|
|
@@ -1377,8 +1391,8 @@ function scriptToInvocations(script, wrappers = /* @__PURE__ */ new Map()) {
|
|
|
1377
1391
|
* ```ts
|
|
1378
1392
|
* import { collectScriptChain } from './helpers.js'
|
|
1379
1393
|
*
|
|
1380
|
-
* collectScriptChain('test', { test: 'npm run test:src', 'test:src': 'vitest run --project src:core' }, new Map())
|
|
1381
|
-
*
|
|
1394
|
+
* const chain = collectScriptChain('test', { test: 'npm run test:src', 'test:src': 'vitest run --project src:core' }, new Map())
|
|
1395
|
+
* chain.readings.get('test:src') // { projects: ['src:core'], configs: [], scripts: [] }
|
|
1382
1396
|
* ```
|
|
1383
1397
|
*/
|
|
1384
1398
|
function collectScriptChain(gate, scripts, wrappers) {
|
|
@@ -1399,6 +1413,7 @@ function collectScriptChain(gate, scripts, wrappers) {
|
|
|
1399
1413
|
}
|
|
1400
1414
|
return {
|
|
1401
1415
|
visited,
|
|
1416
|
+
readings: new Map(reads.flatMap(({ name, invoked }) => invoked === void 0 ? [] : [[name, invoked]])),
|
|
1402
1417
|
projects: new Set(reads.flatMap(({ invoked }) => invoked?.projects ?? [])),
|
|
1403
1418
|
unreadable: new Set(reads.flatMap(({ name, invoked }) => invoked === void 0 ? [name] : []))
|
|
1404
1419
|
};
|
|
@@ -2638,7 +2653,8 @@ var CLI = class {
|
|
|
2638
2653
|
const planned = new Set(blueprintToProjects(blueprint));
|
|
2639
2654
|
const parsed = parseJSON(manifest);
|
|
2640
2655
|
const scripts = isRecord(parsed) && isRecord(parsed.scripts) ? parsed.scripts : {};
|
|
2641
|
-
const
|
|
2656
|
+
const publishes = !isRecord(parsed) || parsed.private !== true;
|
|
2657
|
+
const gates = publishes ? ["test", "prepublishOnly"] : ["test"];
|
|
2642
2658
|
const gateNames = gates.join(" or ");
|
|
2643
2659
|
const readings = Object.values(scripts).filter((script) => isString(script) && script.includes("vitest")).map((script) => scriptToInvocations(script));
|
|
2644
2660
|
const unresolved = readings.some((invocations) => invocations === void 0);
|
|
@@ -2677,11 +2693,16 @@ var CLI = class {
|
|
|
2677
2693
|
return (scriptToInvocations(script)?.projects ?? []).flatMap((project) => {
|
|
2678
2694
|
const direct = `test:${project}`;
|
|
2679
2695
|
const command = expected[direct];
|
|
2680
|
-
return project === "probe" || project === "studies" || command === void 0 ? [] : [[project, `"${direct}": ${JSON.stringify(command)},`]];
|
|
2696
|
+
return project === "probe" || project === "studies" || publishes && project.startsWith("app:") || command === void 0 ? [] : [[project, `"${direct}": ${JSON.stringify(command)},`]];
|
|
2681
2697
|
});
|
|
2682
2698
|
}));
|
|
2683
|
-
const faces = /* @__PURE__ */ new Set([
|
|
2699
|
+
const faces = /* @__PURE__ */ new Set([
|
|
2700
|
+
...blueprint.app.map((environment) => `app:${environment}`),
|
|
2701
|
+
...blueprintToSheets(blueprint).map((name) => `src:${name}`),
|
|
2702
|
+
...blueprintToFaces(blueprint).flatMap(({ name, axes }) => axes.map((axis) => `${axis}:${name}`))
|
|
2703
|
+
]);
|
|
2684
2704
|
const wrappers = new Map(blueprintToConfigArtifacts(blueprint).flatMap((artifact) => {
|
|
2705
|
+
if (artifact.path === JOURNEY_CONFIG_PATH) return [[artifact.path, "journey"]];
|
|
2685
2706
|
const match = /^configs\/(src|app)\/vite\.([^.]+)\.config\.ts$/u.exec(artifact.path);
|
|
2686
2707
|
const project = match === null ? void 0 : `${match[1]}:${match[2]}`;
|
|
2687
2708
|
return project !== void 0 && faces.has(project) ? [[artifact.path, project]] : [];
|
|
@@ -2696,7 +2717,19 @@ var CLI = class {
|
|
|
2696
2717
|
};
|
|
2697
2718
|
const ungated = [...expectedLines].filter(([project]) => !reachable.has(project)).sort(([left], [right]) => left.localeCompare(right)).filter(([project]) => isString(scripts[`test:${project}`]));
|
|
2698
2719
|
if (ungated.length === 0) {
|
|
2699
|
-
if (
|
|
2720
|
+
if (publishes && !writing) {
|
|
2721
|
+
const helpers = [.../* @__PURE__ */ new Set([...[...chains.values()].flatMap((chain) => [...chain.visited].filter((name) => /^test:(app|journey)(:|$)/u.test(name))), ...[...reachable].filter((project) => /^(app|journey)(:|$)/u.test(project)).map((project) => `test:${project}`)])].sort();
|
|
2722
|
+
if (helpers.length > 0) {
|
|
2723
|
+
const invocations = [...new Map([...chains.values()].flatMap((chain) => [...chain.readings]))].filter(([, reading]) => reading.projects.some((project) => /^(app|journey)(:|$)/u.test(project))).map(([name]) => `${name}: ${scripts[name]}`);
|
|
2724
|
+
return {
|
|
2725
|
+
field: "projects",
|
|
2726
|
+
message: `The publishing manifest at ${target} reaches application or journey suites from ${gateNames}: ${helpers.join(", ")}.${invocations.length > 0 ? ` Reached invocations: ${invocations.join("; ")}.` : ""} Remove their invocations from the gate chains and run them on demand.`,
|
|
2727
|
+
blocking: false,
|
|
2728
|
+
groups: ["configs"]
|
|
2729
|
+
};
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
if (!publishes && !writing && expected["test:journey"] !== void 0 && !chains.get("test")?.visited.has("test:journey")) return {
|
|
2700
2733
|
field: "projects",
|
|
2701
2734
|
message: `The manifest at ${target} does not invoke npm run test:journey from its test chain. Add npm run test:journey after npm run test:app.`,
|
|
2702
2735
|
blocking: false,
|