@orkestrel/scaffold 0.0.76 → 0.0.78

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 (154) hide show
  1. package/dist/agents/skills/orkestrel-dispatch/scripts/bench.js +204 -0
  2. package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +102 -0
  3. package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +95 -0
  4. package/dist/agents/skills/orkestrel-dispatch/scripts/helpers.js +207 -0
  5. package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +108 -0
  6. package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +114 -0
  7. package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +108 -0
  8. package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +156 -0
  9. package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +196 -0
  10. package/dist/agents/skills/orkestrel-publish/scripts/compare.js +206 -0
  11. package/dist/agents/skills/orkestrel-publish/scripts/pins.js +93 -0
  12. package/dist/agents/skills/orkestrel-publish/scripts/wave.js +458 -0
  13. package/dist/agents/skills/orkestrel-publish/scripts/window.js +188 -0
  14. package/dist/agents/skills/orkestrel-scout/scripts/map.js +300 -0
  15. package/dist/agents/templates/brief.md +55 -0
  16. package/dist/bin/main.js +4 -2
  17. package/dist/bin/main.js.map +1 -1
  18. package/dist/host/AGENTS.md +77 -135
  19. package/dist/host/agents/orchestration.md +147 -927
  20. package/dist/host/agents/skills/enterprise-bootstrap/SKILL.md +2 -2
  21. package/dist/host/agents/skills/enterprise-bootstrap/references/inspection.md +1 -1
  22. package/dist/host/agents/skills/{orkestrel-align-packages → orkestrel-align}/SKILL.md +6 -13
  23. package/dist/host/agents/skills/{orkestrel-align-packages → orkestrel-align}/agents/openai.yaml +1 -1
  24. package/dist/host/agents/skills/{orkestrel-align-packages → orkestrel-align}/references/fleet.md +5 -7
  25. package/dist/host/agents/skills/{orkestrel-build-application → orkestrel-build}/SKILL.md +11 -22
  26. package/dist/host/agents/skills/{orkestrel-build-application → orkestrel-build}/agents/openai.yaml +1 -1
  27. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +8 -16
  28. package/dist/host/agents/skills/orkestrel-debrief/references/instruction-audit.md +3 -3
  29. package/dist/host/agents/skills/orkestrel-debrief/references/retention.md +13 -13
  30. package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +61 -0
  31. package/dist/host/agents/skills/orkestrel-dispatch/agents/openai.yaml +4 -0
  32. package/dist/host/agents/skills/orkestrel-dispatch/references/bench.md +25 -0
  33. package/dist/host/agents/skills/orkestrel-dispatch/references/launch.md +32 -0
  34. package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +259 -0
  35. package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +110 -0
  36. package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +115 -0
  37. package/dist/host/agents/skills/orkestrel-dispatch/scripts/helpers.ts +239 -0
  38. package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +124 -0
  39. package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +123 -0
  40. package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +129 -0
  41. package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +157 -0
  42. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +42 -193
  43. package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +38 -108
  44. package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +35 -134
  45. package/dist/host/agents/skills/{orkestrel-harden-package → orkestrel-harden}/SKILL.md +10 -14
  46. package/dist/host/agents/skills/{orkestrel-harden-package → orkestrel-harden}/agents/openai.yaml +1 -1
  47. package/dist/host/agents/skills/{orkestrel-harden-package → orkestrel-harden}/references/hardening.md +3 -4
  48. package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +228 -0
  49. package/dist/host/agents/skills/{orkestrel-prove-journey → orkestrel-journey}/SKILL.md +15 -23
  50. package/dist/host/agents/skills/orkestrel-journey/agents/openai.yaml +4 -0
  51. package/dist/host/agents/skills/{orkestrel-prove-journey → orkestrel-journey}/references/captures.md +1 -1
  52. package/dist/host/agents/skills/{orkestrel-polish-surface → orkestrel-polish}/SKILL.md +25 -33
  53. package/dist/host/agents/skills/{orkestrel-polish-surface → orkestrel-polish}/agents/openai.yaml +1 -1
  54. package/dist/host/agents/skills/{orkestrel-polish-surface → orkestrel-polish}/references/capture-harness.md +3 -3
  55. package/dist/host/agents/skills/orkestrel-publish/SKILL.md +33 -20
  56. package/dist/host/agents/skills/orkestrel-publish/references/release.md +39 -0
  57. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +22 -21
  58. package/dist/host/agents/skills/orkestrel-publish/references/window.md +27 -14
  59. package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +220 -0
  60. package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +114 -0
  61. package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +629 -0
  62. package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +242 -0
  63. package/dist/host/agents/skills/orkestrel-scout/SKILL.md +28 -0
  64. package/dist/host/agents/skills/orkestrel-scout/agents/openai.yaml +4 -0
  65. package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +352 -0
  66. package/dist/host/agents/templates/brief.md +21 -142
  67. package/dist/host/agents/transports/claude-cli.md +21 -0
  68. package/dist/host/agents/transports/codex.md +38 -159
  69. package/dist/host/agents/transports/cursor.md +16 -65
  70. package/dist/host/claude/AGENTS.md +38 -0
  71. package/dist/host/claude/agents/analyst.md +14 -53
  72. package/dist/host/claude/agents/astra.md +26 -0
  73. package/dist/host/claude/agents/builder.md +14 -30
  74. package/dist/host/claude/agents/checker.md +13 -57
  75. package/dist/host/claude/agents/distiller.md +11 -26
  76. package/dist/host/claude/agents/grok.md +12 -35
  77. package/dist/host/claude/agents/opus.md +14 -30
  78. package/dist/host/claude/agents/planner.md +10 -44
  79. package/dist/host/claude/agents/researcher.md +11 -30
  80. package/dist/host/claude/agents/reviewer.md +11 -95
  81. package/dist/host/claude/agents/scout.md +9 -23
  82. package/dist/host/claude/agents/verifier.md +15 -33
  83. package/dist/host/claude/rules/documentation.md +8 -2
  84. package/dist/host/claude/rules/portability.md +7 -1
  85. package/dist/host/claude/rules/quality.md +36 -96
  86. package/dist/host/claude/rules/styles.md +3 -0
  87. package/dist/host/claude/rules/tests.md +6 -3
  88. package/dist/host/claude/rules/workspace.md +19 -15
  89. package/dist/host/claude/rules/writing.md +57 -108
  90. package/dist/host/claude/settings.json +5 -3
  91. package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +1 -1
  92. package/dist/host/claude/skills/{orkestrel-align-packages → orkestrel-align}/SKILL.md +2 -2
  93. package/dist/host/claude/skills/{orkestrel-build-application → orkestrel-build}/SKILL.md +2 -2
  94. package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +11 -0
  95. package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +2 -1
  96. package/dist/host/claude/skills/{orkestrel-harden-package → orkestrel-harden}/SKILL.md +2 -2
  97. package/dist/host/claude/skills/{orkestrel-prove-journey → orkestrel-journey}/SKILL.md +2 -2
  98. package/dist/host/claude/skills/orkestrel-polish/SKILL.md +12 -0
  99. package/dist/host/claude/skills/orkestrel-scout/SKILL.md +11 -0
  100. package/dist/host/codex/agents/analyst.toml +15 -32
  101. package/dist/host/codex/agents/astra.toml +25 -0
  102. package/dist/host/codex/agents/builder.toml +13 -20
  103. package/dist/host/codex/agents/checker.toml +13 -27
  104. package/dist/host/codex/agents/distiller.toml +9 -22
  105. package/dist/host/codex/agents/grok.toml +11 -30
  106. package/dist/host/codex/agents/opus.toml +14 -22
  107. package/dist/host/codex/agents/orkestrel.toml +1 -1
  108. package/dist/host/codex/agents/planner.toml +11 -28
  109. package/dist/host/codex/agents/researcher.toml +10 -22
  110. package/dist/host/codex/agents/reviewer.toml +11 -27
  111. package/dist/host/codex/agents/scout.toml +11 -17
  112. package/dist/host/codex/agents/verifier.toml +16 -12
  113. package/dist/host/codex/config.toml +20 -23
  114. package/dist/host/cursor/mcp.json +0 -4
  115. package/dist/host/cursor/rules/orchestration.mdc +12 -20
  116. package/dist/host/dotfiles/mcp.json +0 -4
  117. package/dist/host/dotfiles/oxlintrc.json +7 -0
  118. package/dist/host/guides/probe.md +9 -9
  119. package/dist/host/guides/scaffold.md +117 -71
  120. package/dist/host/guides/test.md +1 -1
  121. package/dist/host/manifest.json +322 -185
  122. package/dist/host/scripts/codex.sh +2 -2
  123. package/dist/host/tests/config.test.ts +68 -46
  124. package/dist/host/tests/policy.test.ts +1 -5
  125. package/dist/host/tests/setupPolicy.ts +179 -4
  126. package/dist/src/core/index.cjs +255 -84
  127. package/dist/src/core/index.cjs.map +1 -1
  128. package/dist/src/core/index.d.cts +94 -29
  129. package/dist/src/core/index.d.ts +94 -29
  130. package/dist/src/core/index.js +253 -85
  131. package/dist/src/core/index.js.map +1 -1
  132. package/dist/src/server/index.cjs +55 -9
  133. package/dist/src/server/index.cjs.map +1 -1
  134. package/dist/src/server/index.d.cts +29 -4
  135. package/dist/src/server/index.d.ts +29 -4
  136. package/dist/src/server/index.js +56 -11
  137. package/dist/src/server/index.js.map +1 -1
  138. package/package.json +15 -11
  139. package/dist/host/CLAUDE.md +0 -61
  140. package/dist/host/agents/skills/orkestrel-prove-journey/agents/openai.yaml +0 -4
  141. package/dist/host/agents/transports/claude.md +0 -49
  142. package/dist/host/claude/agents/application.md +0 -36
  143. package/dist/host/claude/agents/sol.md +0 -61
  144. package/dist/host/claude/skills/orkestrel-polish-surface/SKILL.md +0 -12
  145. package/dist/host/codex/agents/application.toml +0 -25
  146. package/dist/host/codex/agents/sol.toml +0 -19
  147. /package/dist/host/agents/skills/{orkestrel-align-packages → orkestrel-align}/references/integration.md +0 -0
  148. /package/dist/host/agents/skills/{orkestrel-harden-package → orkestrel-harden}/references/centralization.md +0 -0
  149. /package/dist/host/agents/skills/{orkestrel-harden-package → orkestrel-harden}/references/contract.md +0 -0
  150. /package/dist/host/agents/skills/{orkestrel-harden-package → orkestrel-harden}/references/research.md +0 -0
  151. /package/dist/host/agents/skills/{orkestrel-prove-journey → orkestrel-journey}/references/decide.md +0 -0
  152. /package/dist/host/agents/skills/{orkestrel-prove-journey → orkestrel-journey}/references/layer.md +0 -0
  153. /package/dist/host/agents/skills/{orkestrel-prove-journey → orkestrel-journey}/references/statechart.md +0 -0
  154. /package/dist/host/agents/skills/{orkestrel-prove-journey → orkestrel-journey}/references/styles.md +0 -0
@@ -355,8 +355,8 @@ function computeDigest(content) {
355
355
  *
356
356
  * @param hex - The exact lowercase hexadecimal bytes to digest.
357
357
  * @returns Sixty-four lowercase hexadecimal digits.
358
- * @throws `ScaffoldError('INVALID', …)` when `hex` is not exact bounded
359
- * lowercase hexadecimal text.
358
+ * @throws Thrown when `hex` is not exact bounded lowercase hexadecimal text; the error is a
359
+ * `ScaffoldError` coded `INVALID`.
360
360
  *
361
361
  * @example
362
362
  * ```ts
@@ -370,6 +370,32 @@ function hexToDigest(hex) {
370
370
  return (0, node_crypto.createHash)("sha256").update(Buffer.from(hex, "hex")).digest("hex");
371
371
  }
372
372
  /**
373
+ * Decodes exact bytes stated in hexadecimal as strict UTF-8 text.
374
+ *
375
+ * @param hex - The exact lowercase hexadecimal bytes to decode.
376
+ * @returns The decoded text, or `undefined` when the bytes are not valid UTF-8.
377
+ * @throws Thrown when `hex` is not exact bounded lowercase hexadecimal text; the error is a
378
+ * `ScaffoldError` coded `INVALID`.
379
+ *
380
+ * @remarks
381
+ * Decoding is strict, so an invalid sequence answers `undefined` rather than
382
+ * text carrying replacement characters: every caller parses or derives from the
383
+ * text next, and a lossy decode would hand it bytes the file never held.
384
+ *
385
+ * @example
386
+ * ```ts
387
+ * import { decodeHexText } from '@orkestrel/scaffold/server'
388
+ *
389
+ * decodeHexText('e282ac0a') // '€\n'
390
+ * decodeHexText('fffe00') // undefined
391
+ * ```
392
+ */
393
+ function decodeHexText(hex) {
394
+ if (!(0, _src_core.isHex)(hex)) throw new _src_core.ScaffoldError("INVALID", "Decode input is not exact hexadecimal bytes", { hex });
395
+ const decoded = (0, _orkestrel_contract.attempt)(() => new TextDecoder("utf-8", { fatal: true }).decode(Buffer.from(hex, "hex")));
396
+ return decoded.success ? decoded.value : void 0;
397
+ }
398
+ /**
373
399
  * Computes the digest of a vendored host's declared membership.
374
400
  *
375
401
  * @param entries - The ordered file membership declarations.
@@ -725,7 +751,7 @@ function isVacant(target) {
725
751
  * ```ts
726
752
  * import { listFiles } from '@orkestrel/scaffold/server'
727
753
  *
728
- * listFiles('./dist/host') // ['AGENTS.md', 'CLAUDE.md', 'LICENSE', …]
754
+ * listFiles('./dist/host') // ['AGENTS.md', 'LICENSE', 'agents', …]
729
755
  * ```
730
756
  */
731
757
  function listFiles(root) {
@@ -1060,9 +1086,7 @@ function readFileHex(root, path, limit = _src_core.MAX_ARTIFACT_BYTES) {
1060
1086
  */
1061
1087
  function readFileText(root, path, limit = _src_core.MAX_ARTIFACT_BYTES) {
1062
1088
  const hex = readFileHex(root, path, limit);
1063
- if (hex === void 0) return void 0;
1064
- const decoded = (0, _orkestrel_contract.attempt)(() => new TextDecoder("utf-8", { fatal: true }).decode(Buffer.from(hex, "hex")));
1065
- return decoded.success ? decoded.value : void 0;
1089
+ return hex === void 0 ? void 0 : decodeHexText(hex);
1066
1090
  }
1067
1091
  /**
1068
1092
  * Reads a target's current bytes at the paths a plan claims.
@@ -1448,7 +1472,9 @@ function stageBytes(host, root, destinations) {
1448
1472
  * whichever path the plan reached first. Refusing here fails the build that
1449
1473
  * produced it, where the maintainer can act, and it names every missing path at
1450
1474
  * once. A directory is the same case — declaring an absent directory as an empty
1451
- * root would create an empty directory in every generated workspace.
1475
+ * root would create an empty directory in every generated workspace. A canon file
1476
+ * member the checkout no longer holds is the one exception: scaffold keeps owning
1477
+ * the path so a target's copy reports foreign, and the stage ships nothing for it.
1452
1478
  *
1453
1479
  * The walk covers `HOST_PATHS`, `CANON_PATHS`, and `REFERENCE_PATHS` together.
1454
1480
  * A plan selects the paths a target receives; the installed package also carries
@@ -1497,7 +1523,7 @@ function stageHost(checkout, host, options) {
1497
1523
  continue;
1498
1524
  }
1499
1525
  if (!isPhysicalDirectory(full)) {
1500
- missing.push(path);
1526
+ if (!_src_core.CANON_PATHS.includes(path)) missing.push(path);
1501
1527
  continue;
1502
1528
  }
1503
1529
  roots.push(path);
@@ -3283,7 +3309,7 @@ var Materializer = class {
3283
3309
  continue;
3284
3310
  }
3285
3311
  const expanded = this.#expand(artifact, remaining);
3286
- for (const one of expanded) remaining -= (one.hex?.length ?? 0) / 2;
3312
+ for (const one of expanded) remaining -= one.origin === "host" ? (one.hex?.length ?? 0) / 2 : (0, _src_core.computeBytes)(one.content);
3287
3313
  artifacts.push(...expanded);
3288
3314
  }
3289
3315
  if (remaining < 0) throw this.#error("TARGET", "The hydrated plan retains more bytes than one plan may.", {
@@ -3445,6 +3471,14 @@ var Materializer = class {
3445
3471
  };
3446
3472
  }
3447
3473
  #hydrated(artifact, path, destination, hex) {
3474
+ if ("pointer" in artifact && artifact.pointer === true) return {
3475
+ path,
3476
+ group: artifact.group,
3477
+ ownership: "content",
3478
+ origin: "computed",
3479
+ ...artifact.environment === void 0 ? {} : { environment: artifact.environment },
3480
+ content: this.#point(path, destination, hex)
3481
+ };
3448
3482
  return {
3449
3483
  path,
3450
3484
  group: artifact.group,
@@ -3455,6 +3489,17 @@ var Materializer = class {
3455
3489
  hex
3456
3490
  };
3457
3491
  }
3492
+ #point(path, destination, hex) {
3493
+ const name = path.endsWith("/SKILL.md") ? path.split("/").at(-2) : void 0;
3494
+ const decoded = decodeHexText(hex);
3495
+ const pointer = name === void 0 || decoded === void 0 ? void 0 : (0, _src_core.renderSkillPointer)(decoded, name);
3496
+ if (pointer === void 0) throw this.#error("TARGET", `The vendored skill at ${destination} cannot derive the pointer at ${path}.`, {
3497
+ host: this.#root,
3498
+ source: destination,
3499
+ path
3500
+ });
3501
+ return pointer;
3502
+ }
3458
3503
  #read(entry, budget) {
3459
3504
  const held = this.#value?.bytes[entry.destination];
3460
3505
  if (held === void 0) return this.#readRoot(entry.storage, budget);
@@ -4511,6 +4556,7 @@ exports.WriteTransaction = WriteTransaction;
4511
4556
  exports.computeDigest = computeDigest;
4512
4557
  exports.computeFileDigest = computeFileDigest;
4513
4558
  exports.computeManifestDigest = computeManifestDigest;
4559
+ exports.decodeHexText = decodeHexText;
4514
4560
  exports.filesToHost = filesToHost;
4515
4561
  exports.hexToDigest = hexToDigest;
4516
4562
  exports.isBranch = isBranch;