@orkestrel/scaffold 0.0.102 → 0.0.104

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 (89) hide show
  1. package/dist/agents/skills/orkestrel-dispatch/scripts/helpers.js +84 -1
  2. package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +21 -6
  3. package/dist/agents/skills/orkestrel-harden/scripts/titles.js +338 -0
  4. package/dist/agents/skills/orkestrel-publish/scripts/swap.js +3 -39
  5. package/dist/agents/skills/orkestrel-publish/scripts/wave.js +433 -47
  6. package/dist/agents/skills/orkestrel-publish/scripts/window.js +2 -1
  7. package/dist/bin/main.js +16 -9
  8. package/dist/bin/main.js.map +1 -1
  9. package/dist/host/agents/orchestration.md +3 -3
  10. package/dist/host/agents/skills/enterprise-bootstrap/references/components.md +2 -2
  11. package/dist/host/agents/skills/enterprise-bootstrap/references/inspection.md +1 -1
  12. package/dist/host/agents/skills/orkestrel-build/SKILL.md +2 -2
  13. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +2 -2
  14. package/dist/host/agents/skills/orkestrel-debrief/references/field-testing.md +1 -1
  15. package/dist/host/agents/skills/orkestrel-debrief/references/instruction-audit.md +3 -3
  16. package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +10 -10
  17. package/dist/host/agents/skills/orkestrel-dispatch/references/launch.md +1 -0
  18. package/dist/host/agents/skills/orkestrel-dispatch/scripts/helpers.ts +100 -1
  19. package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +27 -6
  20. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +4 -4
  21. package/dist/host/agents/skills/orkestrel-falsify/agents/openai.yaml +1 -1
  22. package/dist/host/agents/skills/orkestrel-falsify/references/brief.md +8 -7
  23. package/dist/host/agents/skills/orkestrel-falsify/references/reconcile.md +6 -6
  24. package/dist/host/agents/skills/orkestrel-harden/SKILL.md +6 -1
  25. package/dist/host/agents/skills/orkestrel-harden/references/bindings.md +1700 -0
  26. package/dist/host/agents/skills/orkestrel-harden/references/contract.md +2 -2
  27. package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +48 -0
  28. package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +4 -2
  29. package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +425 -0
  30. package/dist/host/agents/skills/orkestrel-journey/SKILL.md +2 -2
  31. package/dist/host/agents/skills/orkestrel-journey/references/captures.md +9 -8
  32. package/dist/host/agents/skills/orkestrel-polish/SKILL.md +3 -3
  33. package/dist/host/agents/skills/orkestrel-publish/SKILL.md +2 -2
  34. package/dist/host/agents/skills/orkestrel-publish/references/release.md +1 -0
  35. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +56 -13
  36. package/dist/host/agents/skills/orkestrel-publish/references/window.md +6 -6
  37. package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +5 -49
  38. package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +646 -49
  39. package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +2 -1
  40. package/dist/host/agents/transports/codex.md +1 -1
  41. package/dist/host/claude/agents/orkestrel.md +54 -53
  42. package/dist/host/claude/agents/reviewer.md +4 -4
  43. package/dist/host/claude/rules/documentation.md +2 -1
  44. package/dist/host/claude/rules/patterns.md +1 -1
  45. package/dist/host/claude/rules/quality.md +2 -2
  46. package/dist/host/claude/rules/styles.md +1 -1
  47. package/dist/host/claude/rules/tests.md +34 -8
  48. package/dist/host/claude/rules/typescript.md +29 -0
  49. package/dist/host/claude/rules/workspace.md +35 -28
  50. package/dist/host/claude/rules/writing.md +34 -26
  51. package/dist/host/claude/settings.json +2 -0
  52. package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -1
  53. package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +1 -1
  54. package/dist/host/codex/agents/analyst.toml +3 -3
  55. package/dist/host/codex/agents/reviewer.toml +4 -4
  56. package/dist/host/configs/helpers.ts +4 -16
  57. package/dist/host/configs/policy.ts +13 -2
  58. package/dist/host/dotfiles/editorconfig +0 -1
  59. package/dist/host/dotfiles/gitattributes +0 -1
  60. package/dist/host/dotfiles/gitignore +0 -1
  61. package/dist/host/dotfiles/oxlintrc.json +25 -11
  62. package/dist/host/guides/agent.md +1638 -598
  63. package/dist/host/guides/budget.md +89 -29
  64. package/dist/host/guides/form.md +477 -91
  65. package/dist/host/guides/mcp.md +14 -2
  66. package/dist/host/guides/ollama.md +97 -73
  67. package/dist/host/guides/probe.md +1 -1
  68. package/dist/host/guides/scaffold.md +158 -101
  69. package/dist/host/guides/study.md +2635 -0
  70. package/dist/host/guides/table.md +225 -15
  71. package/dist/host/guides/terminal.md +22 -20
  72. package/dist/host/guides/test.md +689 -255
  73. package/dist/host/manifest.json +88 -64
  74. package/dist/host/tests/config.test.ts +189 -146
  75. package/dist/host/tests/policy.test.ts +39 -1
  76. package/dist/host/tests/setupPolicy.ts +104 -57
  77. package/dist/src/core/index.cjs +1387 -611
  78. package/dist/src/core/index.cjs.map +1 -1
  79. package/dist/src/core/index.d.cts +35 -20
  80. package/dist/src/core/index.d.ts +35 -20
  81. package/dist/src/core/index.js +1385 -612
  82. package/dist/src/core/index.js.map +1 -1
  83. package/dist/src/server/index.cjs +12 -12
  84. package/dist/src/server/index.cjs.map +1 -1
  85. package/dist/src/server/index.d.cts +12 -12
  86. package/dist/src/server/index.d.ts +12 -12
  87. package/dist/src/server/index.js +12 -12
  88. package/dist/src/server/index.js.map +1 -1
  89. package/package.json +4 -4
@@ -5,7 +5,7 @@ import {
5
5
  hasCanonicalSegments,
6
6
  resolveLink,
7
7
  } from '@orkestrel/guide'
8
- import { BASE_DEV_DEPENDENCIES, HOST_PATHS } from '@orkestrel/scaffold'
8
+ import { BASE_DEV_DEPENDENCIES, DISTRIBUTION_SETUP_PATH, HOST_PATHS } from '@orkestrel/scaffold'
9
9
  import { spawnSync } from 'node:child_process'
10
10
  import { createRequire } from 'node:module'
11
11
  import {
@@ -172,7 +172,7 @@ export interface PolicyProject {
172
172
  readonly setup: readonly string[]
173
173
  }
174
174
 
175
- /** Describes one physical negative control, including the population boundary it attacks. */
175
+ /** Describes one physical negative control, including the population boundary it tests. */
176
176
  export interface PolicyControl {
177
177
  readonly label: string
178
178
  readonly membership: string
@@ -1104,9 +1104,28 @@ export function inspectPolicyMirrors(root: string): readonly PolicyViolation[] {
1104
1104
  return [...inspectPolicyMirrorPaths(tests, modules), ...inspectPolicySetup(root)]
1105
1105
  }
1106
1106
 
1107
+ /**
1108
+ * Checks whether a normalized path belongs to a scaffold-owned setup module.
1109
+ * @param path - The workspace-relative module path.
1110
+ * @param root - The workspace root whose manifest determines harness ownership.
1111
+ * @returns True if scaffold owns the module; false otherwise.
1112
+ */
1113
+ export function matchesScaffoldSetup(path: string, root: string): boolean {
1114
+ const normalized = normalizePolicyPath(path)
1115
+ const manifest = readPolicyJSON(join(root, 'package.json'))
1116
+ return (
1117
+ (normalized === DISTRIBUTION_SETUP_PATH &&
1118
+ (!isPolicyRecord(manifest) || manifest.private !== true)) ||
1119
+ HOST_PATHS.some(
1120
+ (vendored) =>
1121
+ normalized === normalizePolicyPath(vendored) ||
1122
+ normalized.startsWith(normalizePolicyPath(vendored) + '/'),
1123
+ )
1124
+ )
1125
+ }
1126
+
1107
1127
  /**
1108
1128
  * Inspects root setup modules and their proofs in both directions.
1109
- *
1110
1129
  * @param root - The workspace root to inspect.
1111
1130
  * @returns Missing modules and uncovered exporting setup modules.
1112
1131
  */
@@ -1125,14 +1144,7 @@ export function inspectPolicySetup(root: string): readonly PolicyViolation[] {
1125
1144
  )
1126
1145
  return [...paths].sort().flatMap((path) => {
1127
1146
  const module = path.endsWith('.test.ts') ? path.replace(/\.test\.ts$/u, '.ts') : path
1128
- if (
1129
- HOST_PATHS.some(
1130
- (vendored) =>
1131
- module === normalizePolicyPath(vendored) ||
1132
- module.startsWith(normalizePolicyPath(vendored) + '/'),
1133
- )
1134
- )
1135
- return []
1147
+ if (matchesScaffoldSetup(module, root)) return []
1136
1148
  if (path.endsWith('.test.ts')) {
1137
1149
  return paths.has(module)
1138
1150
  ? []
@@ -3075,7 +3087,9 @@ export function readPolicySurface(root: string): PolicySurfacePopulation {
3075
3087
  *
3076
3088
  * @remarks
3077
3089
  * Source names claimed by the target's own hosted guide are grandfathered. Setup names have no
3078
- * grandfather. An absent installed host falls back to checkout guides only with catalog coverage.
3090
+ * grandfather. Catalog rows come from beside the guides: when reading installed guides, from the
3091
+ * staged catalog and never from the target's own table, which can list a package without a guide in
3092
+ * that host. An absent installed host falls back to checkout guides only with catalog coverage.
3079
3093
  * Missing comparison evidence and unread barrel statements produce surface violations.
3080
3094
  *
3081
3095
  * @param root - The workspace root to inspect.
@@ -3088,7 +3102,7 @@ export function inspectPolicySurface(root: string): readonly PolicyViolation[] {
3088
3102
  const host = hosted ? installed : root
3089
3103
  const catalog = hosted ? POLICY_SURFACE_CATALOG : POLICY_CATALOG_FILE
3090
3104
  const directory = hosted ? `${POLICY_SURFACE_HOST}/guides` : 'guides'
3091
- const names = new Set([...readPolicyCatalog(host, catalog), ...readPolicyCatalog(root)])
3105
+ const names = new Set(readPolicyCatalog(host, catalog))
3092
3106
  if (!existsSync(join(host, 'guides')) || names.size === 0) {
3093
3107
  return [
3094
3108
  createPolicyViolation(
@@ -3153,12 +3167,7 @@ export function inspectPolicySurface(root: string): readonly PolicyViolation[] {
3153
3167
  .map(normalizePolicyPath)
3154
3168
  .sort()
3155
3169
  .flatMap((path) =>
3156
- path.endsWith('.test.ts') ||
3157
- HOST_PATHS.some(
3158
- (vendored) =>
3159
- path === normalizePolicyPath(vendored) ||
3160
- path.startsWith(`${normalizePolicyPath(vendored)}/`),
3161
- )
3170
+ path.endsWith('.test.ts') || matchesScaffoldSetup(path, root)
3162
3171
  ? []
3163
3172
  : [collectPolicyDeclarations(root, path, readFileSync(join(root, path), 'utf8'))],
3164
3173
  )
@@ -3392,6 +3401,13 @@ export const SETUP_POLICY_CONTROLS: readonly PolicyControl[] = Object.freeze([
3392
3401
  },
3393
3402
  ],
3394
3403
  },
3404
+ {
3405
+ label: 'admits the distribution harness without a sibling proof',
3406
+ membership: 'content-owned distribution setup module outside the mirror population',
3407
+ rule: 'mirror',
3408
+ files: [{ path: 'tests/setupDistribution.ts', content: 'export const DISTRIBUTION = 1\n' }],
3409
+ violations: [],
3410
+ },
3395
3411
  {
3396
3412
  label: 'admits an inventory-vendored setup module without proof',
3397
3413
  membership: 'host-inventory setup modules outside the mirror population',
@@ -3399,12 +3415,30 @@ export const SETUP_POLICY_CONTROLS: readonly PolicyControl[] = Object.freeze([
3399
3415
  files: [{ path: 'tests/setupPolicy.ts', content: 'export const POLICY = 1\n' }],
3400
3416
  violations: [],
3401
3417
  },
3418
+ {
3419
+ label: 'requires a proof for a private workspace distribution module',
3420
+ membership: 'target-owned distribution setup module in a private workspace',
3421
+ rule: 'mirror',
3422
+ files: [
3423
+ { path: 'package.json', content: '{"private":true}\n' },
3424
+ { path: 'tests/setupDistribution.ts', content: 'export const DISTRIBUTION = 1\n' },
3425
+ ],
3426
+ violations: [
3427
+ {
3428
+ rule: 'mirror',
3429
+ path: 'tests/setupDistribution.ts',
3430
+ message:
3431
+ 'exporting setup module requires its sibling proof or an import from tests/setup.test.ts',
3432
+ },
3433
+ ],
3434
+ },
3402
3435
  ])
3403
3436
 
3404
3437
  /** Lists standalone sheet selections and their core-bearing control for the vendored proof. */
3405
3438
  export const SHEET_POLICY_SELECTIONS: ReadonlyArray<
3406
3439
  Pick<Blueprint, 'src' | 'styles' | 'themes'> & {
3407
3440
  readonly conformance?: boolean
3441
+ readonly tree?: boolean
3408
3442
  readonly integration?: boolean
3409
3443
  readonly files?: readonly PolicySource[]
3410
3444
  readonly control?: {
@@ -3416,8 +3450,25 @@ export const SHEET_POLICY_SELECTIONS: ReadonlyArray<
3416
3450
  > = Object.freeze([
3417
3451
  { src: [], styles: true, themes: true },
3418
3452
  { src: [], styles: false, themes: true },
3419
- { src: [], styles: false, themes: true, integration: true },
3453
+ {
3454
+ src: [],
3455
+ styles: false,
3456
+ themes: true,
3457
+ integration: true,
3458
+ control: {
3459
+ before: "existsSync(resolveWorkspacePath('tests/setupStyles.ts'))",
3460
+ after: 'true',
3461
+ failure: './tests/setupStyles.ts',
3462
+ },
3463
+ },
3420
3464
  { src: ['core'], styles: true, themes: true },
3465
+ {
3466
+ src: ['core'],
3467
+ styles: false,
3468
+ themes: false,
3469
+ tree: true,
3470
+ files: [{ path: 'tests/tree.test.ts', content: 'export {}\n' }],
3471
+ },
3421
3472
  {
3422
3473
  src: ['core', 'browser'],
3423
3474
  styles: true,
@@ -3457,10 +3508,10 @@ export const SHEET_POLICY_SELECTIONS: ReadonlyArray<
3457
3508
  styles: true,
3458
3509
  themes: false,
3459
3510
  integration: true,
3511
+ files: [{ path: 'tests/setupStyles.ts', content: 'export {}\n' }],
3460
3512
  control: {
3461
- before:
3462
- "setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts', './tests/setupStyles.ts']",
3463
- after: "setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts']",
3513
+ before: "? ['./tests/setupStyles.ts']",
3514
+ after: '? []',
3464
3515
  failure: './tests/setupStyles.ts',
3465
3516
  },
3466
3517
  },
@@ -4283,7 +4334,7 @@ export const PROSE_POLICY_MANIFEST = '{\n\t"name": "@orkestrel/sample"\n}\n'
4283
4334
  * Lists the physical controls for every prose-population boundary the workspace route reaches.
4284
4335
  *
4285
4336
  * @remarks
4286
- * Each control that attacks an exclusion also writes the arrival file, whose different term proves
4337
+ * Each control that tests an exclusion also writes the arrival file, whose different term proves
4287
4338
  * the sweep ran over the control workspace rather than reporting nothing because it found nothing.
4288
4339
  */
4289
4340
  export const PROSE_POLICY_CONTROLS: readonly PolicyControl[] = Object.freeze([
@@ -4559,15 +4610,22 @@ export function collectFaceWrappers(directory: string): readonly string[] {
4559
4610
  * Inspects sheet setup membership and themes ordering from configuration data.
4560
4611
  * @param project - The resolved sheet project.
4561
4612
  * @param script - The optional chained styles and themes build command.
4613
+ * @param directory - The target workspace root; defaults to the policy root.
4562
4614
  * @returns Missing setup paths and invalid isolation or ordering fields.
4563
4615
  */
4564
- export function inspectSheetConfiguration(project: unknown, script?: string): readonly string[] {
4616
+ export function inspectSheetConfiguration(
4617
+ project: unknown,
4618
+ script?: string,
4619
+ directory: string = POLICY_ROOT,
4620
+ ): readonly string[] {
4565
4621
  const test = readConfigRecord(readConfigRecord(project).test)
4566
4622
  const setup = test.setupFiles
4567
4623
  return [
4568
- ...['./tests/setup.ts', './tests/setupBrowser.ts', './tests/setupStyles.ts'].filter(
4569
- (path) => !Array.isArray(setup) || !setup.includes(path),
4570
- ),
4624
+ ...[
4625
+ './tests/setup.ts',
4626
+ './tests/setupBrowser.ts',
4627
+ ...(existsSync(resolve(directory, 'tests/setupStyles.ts')) ? ['./tests/setupStyles.ts'] : []),
4628
+ ].filter((path) => !Array.isArray(setup) || !setup.includes(path)),
4571
4629
  ...(test.isolate !== false ? ['isolate'] : []),
4572
4630
  ...(script !== undefined &&
4573
4631
  (!script.includes('vite.styles.config.ts') ||
@@ -4578,35 +4636,24 @@ export function inspectSheetConfiguration(project: unknown, script?: string): re
4578
4636
  ]
4579
4637
  }
4580
4638
 
4581
- /** Lists artifact-loader paths and the computed ESM imports each boundary admits. */
4582
- export const ARTIFACT_IMPORT_CASES: ReadonlyArray<readonly [string, boolean]> = Object.freeze([
4583
- ['src/server/artifacts/Artifacts.ts', true],
4584
- ['src/server/artifacts/nested/inspect.mts', true],
4585
- ['src/server/artifacts/inspect.js', true],
4586
- ['src/server/artifacts/inspect.mjs', true],
4587
- ['src/server/artifacts-lookalike/inspect.ts', false],
4588
- ['src/browser/artifacts/inspect.ts', false],
4589
- ['src/core/artifacts/inspect.ts', false],
4590
- ['app/server/artifacts/inspect.ts', false],
4591
- ['src/server/artifacts/inspect.cts', false],
4592
- ['src/server/artifacts/inspect.cjs', false],
4593
- ['tools/artifacts/inspect.ts', true],
4594
- ['tools/artifacts/nested/inspect.mts', true],
4595
- ['tools/artifacts/inspect.js', true],
4596
- ['tools/artifacts/inspect.mjs', true],
4597
- ['.orkestrel/sample/instruments/tools/artifacts/inspect.ts', true],
4598
- ['.orkestrel/sample/instruments/harness/tools/artifacts/nested/inspect.mts', true],
4599
- ['.orkestrel/sample/instruments/harness/tools/artifacts/inspect.js', true],
4600
- ['.orkestrel/sample/instruments/harness/tools/artifacts/inspect.mjs', true],
4601
- ['src/server/inspect.ts', false],
4602
- ['src/server/tools/artifacts/inspect.ts', false],
4603
- ['configs/inspect.ts', false],
4604
- ['scripts/inspect.ts', false],
4605
- ['.orkestrel/sample/instruments/harness/inspect.ts', false],
4606
- ['tools/artifacts-lookalike/inspect.ts', false],
4607
- ['.orkestrel/sample/instruments/harness/tools/artifacts-lookalike/inspect.ts', false],
4608
- ['tools/artifacts/inspect.cts', false],
4609
- ['tools/artifacts/inspect.cjs', false],
4639
+ /** Lists source, application, test, configuration, script, and campaign paths for uniform computed-import proofs. */
4640
+ export const COMPUTED_IMPORT_PATHS: readonly string[] = Object.freeze([
4641
+ 'src/core/load.ts',
4642
+ 'src/browser/load.ts',
4643
+ 'src/server/load.ts',
4644
+ 'src/server/load.mts',
4645
+ 'src/server/load.js',
4646
+ 'src/server/load.mjs',
4647
+ 'src/server/load.cts',
4648
+ 'src/server/load.cjs',
4649
+ 'app/server/load.ts',
4650
+ 'tests/load.ts',
4651
+ 'tests/src/server/load.test.ts',
4652
+ 'configs/load.ts',
4653
+ 'scripts/load.ts',
4654
+ '.orkestrel/sample/load.ts',
4655
+ '.orkestrel/sample/instruments/harness/load.ts',
4656
+ '.orkestrel/sample/instruments/harness/load.mts',
4610
4657
  ])
4611
4658
 
4612
4659
  /**