@orkestrel/scaffold 0.0.124 → 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.
Files changed (53) hide show
  1. package/dist/agents/skills/orkestrel-publish/scripts/steps.js +523 -0
  2. package/dist/agents/skills/orkestrel-publish/scripts/wave.js +70 -11
  3. package/dist/bin/main.js +51 -18
  4. package/dist/bin/main.js.map +1 -1
  5. package/dist/host/agents/orchestration.md +7 -2
  6. package/dist/host/agents/platforms/windows.md +9 -1
  7. package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +1 -1
  8. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +1 -1
  9. package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +1 -0
  10. package/dist/host/agents/skills/orkestrel-harden/references/methods.md +32 -4
  11. package/dist/host/agents/skills/orkestrel-journey/SKILL.md +18 -19
  12. package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +1 -0
  13. package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +2 -1
  14. package/dist/host/agents/skills/orkestrel-parallel/references/t3.md +5 -1
  15. package/dist/host/agents/skills/orkestrel-publish/SKILL.md +1 -0
  16. package/dist/host/agents/skills/orkestrel-publish/references/release.md +2 -2
  17. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +23 -6
  18. package/dist/host/agents/skills/orkestrel-publish/scripts/steps.ts +654 -0
  19. package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +79 -14
  20. package/dist/host/claude/agents/orkestrel.md +28 -28
  21. package/dist/host/claude/rules/patterns.md +1 -1
  22. package/dist/host/claude/rules/portability.md +2 -0
  23. package/dist/host/claude/rules/quality.md +6 -1
  24. package/dist/host/claude/rules/tests.md +6 -1
  25. package/dist/host/claude/rules/workspace.md +8 -3
  26. package/dist/host/guides/agent.md +575 -346
  27. package/dist/host/guides/brief.md +52 -48
  28. package/dist/host/guides/browser.md +2 -2
  29. package/dist/host/guides/interpret.md +531 -155
  30. package/dist/host/guides/mcp.md +183 -61
  31. package/dist/host/guides/ndjson.md +4 -3
  32. package/dist/host/guides/ollama.md +125 -68
  33. package/dist/host/guides/program.md +117 -39
  34. package/dist/host/guides/qualifier.md +110 -59
  35. package/dist/host/guides/rater.md +85 -32
  36. package/dist/host/guides/scaffold.md +49 -22
  37. package/dist/host/guides/study.md +596 -489
  38. package/dist/host/guides/toolbox.md +159 -80
  39. package/dist/host/guides/workflow.md +44 -25
  40. package/dist/host/manifest.json +41 -35
  41. package/dist/src/core/index.cjs +12 -10
  42. package/dist/src/core/index.cjs.map +1 -1
  43. package/dist/src/core/index.d.cts +3 -1
  44. package/dist/src/core/index.d.ts +3 -1
  45. package/dist/src/core/index.js +12 -10
  46. package/dist/src/core/index.js.map +1 -1
  47. package/dist/src/server/index.cjs +23 -11
  48. package/dist/src/server/index.cjs.map +1 -1
  49. package/dist/src/server/index.d.cts +10 -6
  50. package/dist/src/server/index.d.ts +10 -6
  51. package/dist/src/server/index.js +23 -11
  52. package/dist/src/server/index.js.map +1 -1
  53. package/package.json +7 -7
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.124",
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",
@@ -111,18 +111,18 @@ var package_default = {
111
111
  },
112
112
  devDependencies: {
113
113
  "@microsoft/api-extractor": "^7.60.1",
114
- "@orkestrel/browser": "^0.0.31",
115
- "@orkestrel/guide": "^0.0.29",
114
+ "@orkestrel/browser": "^0.0.32",
115
+ "@orkestrel/guide": "^0.0.30",
116
116
  "@orkestrel/html": "^0.0.15",
117
- "@orkestrel/probe": "^0.0.28",
117
+ "@orkestrel/probe": "^0.0.29",
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.76.0",
122
- "oxlint": "^1.91.0",
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.6",
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 planned = blueprintToScripts(blueprint).test;
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 face projects they run.
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 face projects they run.
1368
- * @returns The script names the walk visited, the Vitest projects those scripts name, and the
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
- * // { visited: Set { 'test', 'test:src' }, projects: Set { 'src:core' }, unreadable: Set {} }
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
  };
@@ -2310,7 +2325,7 @@ var CLI = class {
2310
2325
  ...versions.baseline === void 0 ? {} : { versions: versions.baseline },
2311
2326
  ...host === void 0 ? {} : { host }
2312
2327
  },
2313
- note: "The catalog step did not complete: USAGE: 'catalog' does not take --offline."
2328
+ note: "The catalog step did not complete: the catalog reads upstream and --offline reads none. Every other step ran, and a run without --offline finishes the catalog step."
2314
2329
  };
2315
2330
  }
2316
2331
  async #reconcile(materializer, target, declared, host, hostForced, blueprint) {
@@ -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 gates = !isRecord(parsed) || parsed.private !== true ? ["test", "prepublishOnly"] : ["test"];
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([...blueprintToSheets(blueprint).map((name) => `src:${name}`), ...blueprintToFaces(blueprint).flatMap(({ name, axes }) => axes.map((axis) => `${axis}:${name}`))]);
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 (!writing && expected["test:journey"] !== void 0 && !chains.get("test")?.visited.has("test:journey")) return {
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,