@empire-builder-kit/nx 1.0.0-rc.45 → 1.0.0-rc.47

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 (187) hide show
  1. package/generators.json +11 -1
  2. package/package.json +3 -3
  3. package/src/aws-authority/stage-authority.d.ts +30 -2
  4. package/src/aws-authority/stage-authority.js +220 -25
  5. package/src/developer-agent/generator-planning.js +109 -9
  6. package/src/developer-agent/model.d.ts +7 -3
  7. package/src/developer-agent/model.js +1 -0
  8. package/src/developer-agent/operation-registry.d.ts +1 -0
  9. package/src/developer-agent/operation-registry.js +44 -3
  10. package/src/developer-agent/planning.js +5 -2
  11. package/src/developer-agent/preview-changes.js +10 -0
  12. package/src/developer-agent/validation.js +7 -3
  13. package/src/developer-agent/workspace-inspection.js +51 -4
  14. package/src/executors/deployment-plan/deployment-plan.js +3 -0
  15. package/src/executors/dev-doctor/dev-doctor.d.ts +25 -3
  16. package/src/executors/dev-doctor/dev-doctor.js +136 -49
  17. package/src/executors/dev-setup/dev-setup.d.ts +18 -1
  18. package/src/executors/dev-setup/dev-setup.js +320 -196
  19. package/src/executors/foundation-preflight/foundation-preflight.js +9 -1
  20. package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +2 -2
  21. package/src/executors/github-bootstrap/github-bootstrap.d.ts +3 -0
  22. package/src/executors/github-bootstrap/github-bootstrap.js +28 -0
  23. package/src/executors/github-bootstrap/schema.json +14 -0
  24. package/src/executors/infrastructure-plan/infrastructure-plan.js +10 -3
  25. package/src/executors/local-deploy/local-deploy.d.ts +15 -0
  26. package/src/executors/local-deploy/local-deploy.js +96 -14
  27. package/src/executors/sst-lifecycle/logging-preflight.js +12 -1
  28. package/src/executors/sst-lifecycle/run-sst-command.js +51 -5
  29. package/src/foundation/cost-estimate.js +1 -1
  30. package/src/foundation/identity-domain-parent-ready.d.ts +91 -0
  31. package/src/foundation/identity-domain-parent-ready.js +333 -0
  32. package/src/foundation/identity-domain.d.ts +94 -0
  33. package/src/foundation/identity-domain.js +115 -0
  34. package/src/foundation/index.d.ts +2 -0
  35. package/src/foundation/index.js +7 -0
  36. package/src/foundation/preflight.js +17 -1
  37. package/src/foundation/root-site-readiness.d.ts +27 -0
  38. package/src/foundation/root-site-readiness.js +78 -0
  39. package/src/foundation/root-site.d.ts +81 -0
  40. package/src/foundation/root-site.js +268 -0
  41. package/src/generators/framework-prerequisites.d.ts +2 -0
  42. package/src/generators/framework-prerequisites.js +34 -0
  43. package/src/generators/function/function-registration.d.ts +24 -0
  44. package/src/generators/function/function-registration.js +66 -0
  45. package/src/generators/function/function.d.ts +16 -1
  46. package/src/generators/function/function.js +101 -18
  47. package/src/generators/function/schema.d.ts +1 -0
  48. package/src/generators/function/schema.json +6 -0
  49. package/src/generators/function-access/function-access.d.ts +14 -0
  50. package/src/generators/function-access/function-access.js +141 -0
  51. package/src/generators/function-access/schema.d.ts +6 -0
  52. package/src/generators/function-access/schema.json +25 -0
  53. package/src/generators/post-generation-install.d.ts +1 -1
  54. package/src/generators/post-generation-install.js +1 -1
  55. package/src/generators/preset/dependency-overrides.d.ts +1 -1
  56. package/src/generators/preset/dependency-overrides.js +1 -1
  57. package/src/generators/preset/workspace-files-adopter-skills.js +14 -0
  58. package/src/generators/preset/workspace-files-developer-agent.js +17 -11
  59. package/src/generators/preset/workspace-files-stage-authority.js +58 -1
  60. package/src/generators/preset/workspace-files-thin-deploy.d.ts +11 -0
  61. package/src/generators/preset/workspace-files-thin-deploy.js +52 -5
  62. package/src/generators/preset/workspace-files-thin-docs.js +33 -5
  63. package/src/generators/preset/workspace-files.js +238 -41
  64. package/src/generators/repository-policy/repository-policy.js +2 -1
  65. package/src/generators/repository-policy/schema.d.ts +2 -0
  66. package/src/generators/repository-policy/schema.json +7 -2
  67. package/src/generators/site/built-in-site-documentation-files.d.ts +2 -0
  68. package/src/generators/site/built-in-site-documentation-files.js +92 -0
  69. package/src/generators/site/built-in-site-files.d.ts +8 -0
  70. package/src/generators/site/built-in-site-files.js +40 -0
  71. package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -0
  72. package/src/generators/site/built-in-site-infrastructure-files.js +275 -0
  73. package/src/generators/site/built-in-site-plan.d.ts +19 -0
  74. package/src/generators/site/built-in-site-plan.js +65 -0
  75. package/src/generators/site/built-in-site-project-files.d.ts +3 -0
  76. package/src/generators/site/built-in-site-project-files.js +258 -0
  77. package/src/generators/site/built-in-site-script-files.d.ts +2 -0
  78. package/src/generators/site/built-in-site-script-files.js +306 -0
  79. package/src/generators/site/built-in-site-shared.d.ts +9 -0
  80. package/src/generators/site/built-in-site-shared.js +21 -0
  81. package/src/generators/site/built-in-site-smoke-files.d.ts +2 -0
  82. package/src/generators/site/built-in-site-smoke-files.js +37 -0
  83. package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -0
  84. package/src/generators/site/built-in-site-sst-config-files.js +39 -0
  85. package/src/generators/site/built-in-site-web-files.d.ts +2 -0
  86. package/src/generators/site/built-in-site-web-files.js +284 -0
  87. package/src/generators/site/schema.d.ts +4 -0
  88. package/src/generators/site/schema.json +20 -0
  89. package/src/generators/site/site.d.ts +13 -0
  90. package/src/generators/site/site.js +221 -0
  91. package/src/generators/slice/built-in-plan-alarm-identity.d.ts +9 -0
  92. package/src/generators/slice/built-in-plan-alarm-identity.js +8 -1
  93. package/src/generators/slice/built-in-plan-api-contract-files.js +18 -0
  94. package/src/generators/slice/built-in-plan-async-work-files.js +18 -0
  95. package/src/generators/slice/built-in-plan-data-files.js +126 -14
  96. package/src/generators/slice/built-in-plan-foundation-files.d.ts +12 -0
  97. package/src/generators/slice/built-in-plan-foundation-files.js +114 -5
  98. package/src/generators/slice/built-in-plan-frontend-files.js +2 -271
  99. package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +6 -0
  100. package/src/generators/slice/built-in-plan-frontend-header-proof.js +282 -0
  101. package/src/generators/slice/built-in-plan-infrastructure-files.js +151 -237
  102. package/src/generators/slice/built-in-plan-key-value-cleanup.js +4 -3
  103. package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +29 -0
  104. package/src/generators/slice/built-in-plan-log-group-helpers.js +130 -0
  105. package/src/generators/slice/built-in-plan-metadata-files.js +25 -5
  106. package/src/generators/slice/built-in-plan-next-build-authority.d.ts +5 -0
  107. package/src/generators/slice/built-in-plan-next-build-authority.js +124 -0
  108. package/src/generators/slice/built-in-plan-operations-files.d.ts +6 -0
  109. package/src/generators/slice/built-in-plan-operations-files.js +107 -219
  110. package/src/generators/slice/built-in-plan-performance-files.js +6 -1
  111. package/src/generators/slice/built-in-plan-release-files.js +0 -1
  112. package/src/generators/slice/built-in-plan-reliability-files.js +12 -8
  113. package/src/generators/slice/built-in-plan-shared.d.ts +1 -1
  114. package/src/generators/slice/built-in-plan-shared.js +1 -1
  115. package/src/generators/slice/built-in-plan-sst-config.d.ts +49 -0
  116. package/src/generators/slice/built-in-plan-sst-config.js +160 -0
  117. package/src/generators/slice/built-in-plan-testing-files.js +92 -49
  118. package/src/generators/slice/built-in-plan-verification-files.js +15 -5
  119. package/src/generators/slice/built-in-plan-web-files.js +69 -5
  120. package/src/generators/slice/built-in-plan.js +1 -2
  121. package/src/generators/slice/deployed-smoke-diagnostics.d.ts +35 -0
  122. package/src/generators/slice/deployed-smoke-diagnostics.js +189 -0
  123. package/src/generators/slice/deployed-smoke-readiness.d.ts +7 -0
  124. package/src/generators/slice/deployed-smoke-readiness.js +118 -23
  125. package/src/generators/slice/persistence-contract.js +2 -2
  126. package/src/generators/slice/pnpm-launch-script.d.ts +13 -0
  127. package/src/generators/slice/pnpm-launch-script.js +28 -0
  128. package/src/generators/slice/slice.js +27 -0
  129. package/src/generators/upgrade/custom-domain-notice.d.ts +19 -0
  130. package/src/generators/upgrade/custom-domain-notice.js +38 -0
  131. package/src/generators/upgrade/external-blueprint-compositions.d.ts +84 -0
  132. package/src/generators/upgrade/external-blueprint-compositions.js +478 -0
  133. package/src/generators/upgrade/framework-package-upgrade.d.ts +58 -0
  134. package/src/generators/upgrade/framework-package-upgrade.js +78 -0
  135. package/src/generators/upgrade/function-authentication-notice.d.ts +29 -0
  136. package/src/generators/upgrade/function-authentication-notice.js +74 -0
  137. package/src/generators/upgrade/schema.json +2 -2
  138. package/src/generators/upgrade/upgrade-plan.d.ts +52 -0
  139. package/src/generators/upgrade/upgrade-plan.js +406 -0
  140. package/src/generators/upgrade/upgrade.d.ts +1 -35
  141. package/src/generators/upgrade/upgrade.js +347 -595
  142. package/src/generators/workload/reliability-registration.d.ts +1 -1
  143. package/src/generators/workload/reliability-registration.js +9 -9
  144. package/src/generators/workload/workload.d.ts +1 -1
  145. package/src/generators/workload/workload.js +87 -13
  146. package/src/git-policy/github-bootstrap.d.ts +24 -5
  147. package/src/git-policy/github-bootstrap.js +105 -10
  148. package/src/local-dev/fleet-process.d.ts +9 -2
  149. package/src/local-dev/fleet-process.js +27 -7
  150. package/src/local-dev/fleet-session.js +41 -4
  151. package/src/local-dev/fleet-supervisor-daemon.js +1 -5
  152. package/src/local-dev/fleet-supervisor.d.ts +1 -0
  153. package/src/local-dev/fleet-supervisor.js +34 -11
  154. package/src/local-dev/gateway-daemon.d.ts +1 -1
  155. package/src/local-dev/gateway-daemon.js +6 -4
  156. package/src/local-dev/portless.d.ts +5 -0
  157. package/src/local-dev/portless.js +5 -0
  158. package/src/local-dev/process-group.d.ts +10 -0
  159. package/src/local-dev/process-group.js +33 -0
  160. package/src/local-dev/tls.js +31 -2
  161. package/src/local-dev/trust-store.d.ts +42 -0
  162. package/src/local-dev/trust-store.js +87 -0
  163. package/src/ownership/composition.d.ts +7 -0
  164. package/src/ownership/composition.js +64 -56
  165. package/src/ownership/index.d.ts +1 -0
  166. package/src/ownership/index.js +1 -0
  167. package/src/ownership/record.d.ts +19 -0
  168. package/src/ownership/record.js +26 -2
  169. package/src/ownership/site-record.d.ts +18 -0
  170. package/src/ownership/site-record.js +105 -0
  171. package/src/repository-policy/deployment-plan.d.ts +3 -0
  172. package/src/repository-policy/deployment-plan.js +33 -4
  173. package/src/repository-policy/index.d.ts +1 -0
  174. package/src/repository-policy/index.js +1 -0
  175. package/src/repository-policy/policy.d.ts +13 -1
  176. package/src/repository-policy/policy.js +55 -1
  177. package/src/repository-policy/public-dns.d.ts +65 -0
  178. package/src/repository-policy/public-dns.js +168 -0
  179. package/src/schemas/generated-ownership-v2.json +6 -0
  180. package/src/schemas/repository-policy-v1.json +67 -1
  181. package/src/supply-chain/blueprint-trust-git.js +24 -0
  182. package/src/supply-chain/blueprint-verification-authority.js +42 -3
  183. package/src/supply-chain/generated-blueprint-trust-command.js +15 -0
  184. package/src/supply-chain/sbom.js +74 -12
  185. package/src/work-markers/work-markers.js +4 -1
  186. package/src/workspace-deployment/ownership.d.ts +15 -0
  187. package/src/workspace-deployment/ownership.js +19 -3
@@ -11,10 +11,13 @@ exports.rebindDeveloperAgentGeneratorPlan = rebindDeveloperAgentGeneratorPlan;
11
11
  const node_util_1 = require("node:util");
12
12
  const node_fs_1 = require("node:fs");
13
13
  const node_path_1 = require("node:path");
14
- const index_js_1 = require("../blueprints/index.js");
14
+ const index_js_1 = require("../repository-policy/index.js");
15
+ const index_js_2 = require("../blueprints/index.js");
15
16
  const function_js_1 = require("../generators/function/function.js");
16
17
  const logging_registry_js_1 = require("../generators/logging-registry.js");
17
18
  const built_in_plan_js_1 = require("../generators/slice/built-in-plan.js");
19
+ const built_in_site_plan_js_1 = require("../generators/site/built-in-site-plan.js");
20
+ const root_site_js_1 = require("../foundation/root-site.js");
18
21
  const workload_js_1 = require("../generators/workload/workload.js");
19
22
  const performance_registration_js_1 = require("../generators/workload/performance-registration.js");
20
23
  const reliability_registration_js_1 = require("../generators/workload/reliability-registration.js");
@@ -149,14 +152,27 @@ function parseDeveloperAgentGeneratorInput(value) {
149
152
  if (!exactKeys(value, ['generator', 'name'])) {
150
153
  return invalidGeneratorInput('Slice generator input accepts only generator and name; Blueprint and raw input fields are not accepted.');
151
154
  }
152
- return { generator: 'slice', name: boundedSlug(value.name, 'Slice name') };
155
+ const name = boundedSlug(value.name, 'Slice name');
156
+ if ((0, root_site_js_1.isReservedRootSiteName)(name)) {
157
+ return invalidGeneratorInput(root_site_js_1.ROOT_SITE_RESERVED_SLICE_NAME_MESSAGE);
158
+ }
159
+ return { generator: 'slice', name };
160
+ }
161
+ if (value.generator === 'site') {
162
+ if (!exactKeys(value, ['generator'])) {
163
+ return invalidGeneratorInput('Root site generator input accepts only generator; the root site name is fixed.');
164
+ }
165
+ return { generator: 'site' };
153
166
  }
154
167
  if (value.generator === 'function' ||
155
168
  value.generator === 'service' ||
156
169
  value.generator === 'job') {
157
170
  const generator = value.generator;
158
171
  if (!exactKeys(value, ['feature', 'generator', 'name', 'slice'])) {
159
- return invalidGeneratorInput(`${generator} generator input accepts exactly feature, generator, name, and slice.`);
172
+ return invalidGeneratorInput(generator === 'function' &&
173
+ Object.prototype.hasOwnProperty.call(value, 'authentication')
174
+ ? 'function generator input accepts exactly feature, generator, name, and slice. The Developer Agent creates only signed-in Functions in 1.0; an anonymous Function is generated from the CLI with --authentication=anonymous.'
175
+ : `${generator} generator input accepts exactly feature, generator, name, and slice.`);
160
176
  }
161
177
  return {
162
178
  feature: boundedSlug(value.feature, 'Feature'),
@@ -165,6 +181,9 @@ function parseDeveloperAgentGeneratorInput(value) {
165
181
  slice: boundedSlug(value.slice, 'Slice name'),
166
182
  };
167
183
  }
184
+ if (value.generator === 'function-access') {
185
+ return invalidGeneratorInput('function-access is CLI only in 1.0: the Developer Agent never changes who may call a Function. Run pnpm nx g @empire-builder-kit/nx:function-access from the CLI.');
186
+ }
168
187
  if (value.generator === 'upgrade') {
169
188
  if (!exactKeys(value, ['generator', 'name'], ['preview'])) {
170
189
  return invalidGeneratorInput('Upgrade generator input accepts only generator, name, and an optional caller-retained, digest-bound preview reference.');
@@ -191,6 +210,9 @@ function generatorContextSelection(input) {
191
210
  selectedSlice: input.slice,
192
211
  };
193
212
  }
213
+ if (isRootSiteUpgrade(input)) {
214
+ return { selectedProjects: ['foundation', root_site_js_1.ROOT_SITE_NAME].sort() };
215
+ }
194
216
  if (input.generator === 'upgrade' &&
195
217
  input.name !== 'workspace' &&
196
218
  input.name !== 'foundation') {
@@ -204,6 +226,11 @@ function generatorContextSelection(input) {
204
226
  }
205
227
  return {};
206
228
  }
229
+ // The root site is not a Product Slice: its upgrade selects the fixed site
230
+ // project beside the Foundation, never a Slice context.
231
+ function isRootSiteUpgrade(input) {
232
+ return input.generator === 'upgrade' && input.name === root_site_js_1.ROOT_SITE_NAME;
233
+ }
207
234
  function surface(path, ownershipMode = 'managed') {
208
235
  return { ownershipMode, path };
209
236
  }
@@ -313,7 +340,7 @@ function slicePlan(context, input, mode, rebindCompleted = false) {
313
340
  workspacePathExists(context, node_path_1.posix.join('packages', input.name))) {
314
341
  return unavailableGeneratorDestination(`Product Slice ${input.name} collides with an existing packages/${input.name} path.`);
315
342
  }
316
- const blueprint = (0, index_js_1.resolveBlueprint)({
343
+ const blueprint = (0, index_js_2.resolveBlueprint)({
317
344
  engineVersion: context.workspace.frameworkVersion,
318
345
  reference: 'standard',
319
346
  workspaceRoot: context.workspace.repositoryRoot,
@@ -368,6 +395,57 @@ function slicePlan(context, input, mode, rebindCompleted = false) {
368
395
  ].sort(),
369
396
  };
370
397
  }
398
+ function sitePlan(context, mode, rebindCompleted = false) {
399
+ if (!rebindCompleted &&
400
+ (context.selection.projectInventory !== 'full' ||
401
+ context.selection.slice !== undefined ||
402
+ context.selection.feature !== undefined)) {
403
+ return invalidGeneratorInput('Root site generation requires an unnarrowed, full inspected Nx project inventory.');
404
+ }
405
+ if (!rebindCompleted && workspacePathExists(context, root_site_js_1.ROOT_SITE_ROOT)) {
406
+ return unavailableGeneratorDestination(`The workspace has one root site, and ${root_site_js_1.ROOT_SITE_ROOT} already exists.`);
407
+ }
408
+ if (!rebindCompleted &&
409
+ !workspacePathExists(context, 'packages/foundation/contracts/foundation.json')) {
410
+ return unavailableGeneratorDestination('The root site attaches to the Standard Foundation Router; generate the Foundation first.');
411
+ }
412
+ const plan = (0, built_in_site_plan_js_1.createBuiltInSitePlan)({
413
+ frameworkVersion: context.workspace.frameworkVersion,
414
+ runtimeVersion: context.workspace.frameworkVersion,
415
+ scope: `@${context.workspace.identity}`,
416
+ });
417
+ if (!rebindCompleted) {
418
+ requireAvailableProspectiveProjectIds(context, [root_site_js_1.ROOT_SITE_NAME], 'The root site');
419
+ }
420
+ const ownership = new Map(plan.ownership.paths.map(({ mode: pathMode, path }) => [path, pathMode]));
421
+ const generatedSurfaces = sortedSurfaces([
422
+ ...Object.keys(plan.files).map((path) => surface(node_path_1.posix.join(root_site_js_1.ROOT_SITE_ROOT, path), ownership.get(path) ?? 'managed')),
423
+ surface('pnpm-lock.yaml', 'adopter-owned'),
424
+ ]);
425
+ const prospectiveVerification = mode === 'apply' ? [`${root_site_js_1.ROOT_SITE_NAME}:verify`] : [];
426
+ return {
427
+ command: commandFor('site', mode, [
428
+ '--skipFormat=false',
429
+ '--skipInstall=false',
430
+ ]),
431
+ contracts: contracts(root_site_js_1.ROOT_SITE_NAME, [
432
+ 'configuration',
433
+ 'frontend',
434
+ 'infrastructure',
435
+ 'reliability',
436
+ 'supply-chain',
437
+ ]),
438
+ generatedSurfaces,
439
+ projects: [root_site_js_1.ROOT_SITE_NAME],
440
+ prospectiveVerification,
441
+ verification: [
442
+ ...new Set([
443
+ ...prospectiveVerification,
444
+ developerAgentWorkspaceVerificationTarget(context),
445
+ ]),
446
+ ].sort(),
447
+ };
448
+ }
371
449
  function functionPlan(context, input, mode, rebindCompleted = false) {
372
450
  requireSliceContext(context, input.slice, input.feature, rebindCompleted);
373
451
  if (!rebindCompleted) {
@@ -420,7 +498,13 @@ function workloadPlan(context, input, mode, rebindCompleted = false) {
420
498
  const ownsProtectedLoadAdapter = kind === 'service'
421
499
  ? serviceShouldOwnProtectedLoadAdapter(context, input.slice)
422
500
  : false;
423
- const plan = (0, workload_js_1.createWorkloadFilePlan)(context.workspace.identity, input.slice, input.name, kind, context.workspace.frameworkVersion, input.feature, ownsProtectedLoadAdapter);
501
+ const plan = (0, workload_js_1.createWorkloadFilePlan)(context.workspace.identity, input.slice, input.name, kind, context.workspace.frameworkVersion, input.feature, ownsProtectedLoadAdapter, ownsProtectedLoadAdapter
502
+ ? [
503
+ (0, index_js_1.productionRehearsalStage)((0, index_js_1.readRepositoryOperatingPolicy)(context.workspace.repositoryRoot)
504
+ .deploymentProfile),
505
+ 'production',
506
+ ]
507
+ : []);
424
508
  if (!rebindCompleted) {
425
509
  requireAvailableProspectiveProjectIds(context, [plan.project], `${kind} ${input.name}`);
426
510
  }
@@ -499,19 +583,26 @@ function requireUpgradeProject(context, name) {
499
583
  ? context.projects.find(({ tags }) => tags.includes('scope:workspace'))
500
584
  : name === 'foundation'
501
585
  ? context.projects.find(({ tags }) => tags.includes('scope:foundation'))
502
- : context.projects.find(({ name: projectName, tags }) => projectName === name && tags.includes('type:slice'));
586
+ : name === root_site_js_1.ROOT_SITE_NAME
587
+ ? context.projects.find(({ name: projectName, root, tags }) => projectName === root_site_js_1.ROOT_SITE_NAME &&
588
+ root === root_site_js_1.ROOT_SITE_ROOT &&
589
+ tags.includes('type:site'))
590
+ : context.projects.find(({ name: projectName, tags }) => projectName === name && tags.includes('type:slice'));
503
591
  if (!project) {
504
- return invalidGeneratorInput(`Upgrade target ${name} is not an existing owned workspace, Foundation, or Product Slice in inspected context.`);
592
+ return invalidGeneratorInput(`Upgrade target ${name} is not an existing owned workspace, Foundation, root site, or Product Slice in inspected context.`);
505
593
  }
506
594
  if (name !== 'workspace' &&
507
595
  name !== 'foundation' &&
596
+ name !== root_site_js_1.ROOT_SITE_NAME &&
508
597
  context.selection.slice !== name) {
509
598
  return invalidGeneratorInput('Product Slice upgrade target must exactly match the inspected Slice.');
510
599
  }
511
600
  return project;
512
601
  }
513
602
  function developerAgentUpgradeGeneratorOptions(context, target) {
514
- if (target === 'workspace' || target === 'foundation')
603
+ if (target === 'workspace' ||
604
+ target === 'foundation' ||
605
+ target === root_site_js_1.ROOT_SITE_NAME)
515
606
  return {};
516
607
  const state = context.workspace.ownershipVersions.find((entry) => entry.kind === 'slice' && entry.target === target);
517
608
  if (!state?.blueprintName || !state.installedBlueprintVersion) {
@@ -616,6 +707,9 @@ function bindDeveloperAgentGeneratorPlan(context, operation, inputValue, preview
616
707
  if (input.generator === 'slice') {
617
708
  return slicePlan(context, input, generatorOperation.mode);
618
709
  }
710
+ if (input.generator === 'site') {
711
+ return sitePlan(context, generatorOperation.mode);
712
+ }
619
713
  if (input.generator === 'function') {
620
714
  return functionPlan(context, input, generatorOperation.mode);
621
715
  }
@@ -634,8 +728,11 @@ function rebindDeveloperAgentGeneratorPlan(context, operation, inputValue) {
634
728
  const input = parseDeveloperAgentGeneratorInput(inputValue);
635
729
  const generatorOperation = requireMatchingOperation(operation, input);
636
730
  const reboundContext = input.generator === 'slice' ||
731
+ input.generator === 'site' ||
637
732
  (input.generator === 'upgrade' &&
638
- (input.name === 'workspace' || input.name === 'foundation'))
733
+ (input.name === 'workspace' ||
734
+ input.name === 'foundation' ||
735
+ input.name === root_site_js_1.ROOT_SITE_NAME))
639
736
  ? {
640
737
  ...context,
641
738
  selection: {
@@ -648,6 +745,9 @@ function rebindDeveloperAgentGeneratorPlan(context, operation, inputValue) {
648
745
  if (input.generator === 'slice') {
649
746
  return slicePlan(reboundContext, input, generatorOperation.mode, true);
650
747
  }
748
+ if (input.generator === 'site') {
749
+ return sitePlan(reboundContext, generatorOperation.mode, true);
750
+ }
651
751
  if (input.generator === 'function') {
652
752
  return functionPlan(reboundContext, input, generatorOperation.mode, true);
653
753
  }
@@ -38,7 +38,7 @@ export declare const DEVELOPER_AGENT_CLEANUP_RECOVERY_OUTCOMES: readonly ["not-r
38
38
  export type DeveloperAgentCleanupRecoveryOutcome = (typeof DEVELOPER_AGENT_CLEANUP_RECOVERY_OUTCOMES)[number];
39
39
  export declare const DEVELOPER_AGENT_OWNERSHIP_MODES: readonly ["managed", "seeded", "adopter-owned"];
40
40
  export type DeveloperAgentOwnershipMode = (typeof DEVELOPER_AGENT_OWNERSHIP_MODES)[number];
41
- export declare const DEVELOPER_AGENT_STABLE_GENERATORS: readonly ["slice", "function", "service", "job", "upgrade"];
41
+ export declare const DEVELOPER_AGENT_STABLE_GENERATORS: readonly ["slice", "site", "function", "service", "job", "upgrade"];
42
42
  export type DeveloperAgentStableGenerator = (typeof DEVELOPER_AGENT_STABLE_GENERATORS)[number];
43
43
  export declare const DEVELOPER_AGENT_GENERATOR_MODES: readonly ["preview", "apply"];
44
44
  export type DeveloperAgentGeneratorMode = (typeof DEVELOPER_AGENT_GENERATOR_MODES)[number];
@@ -61,7 +61,7 @@ export interface DeveloperAgentOwnershipVersionState {
61
61
  blueprintName?: string;
62
62
  installedBlueprintVersion?: string;
63
63
  installedFrameworkVersion?: string;
64
- kind: 'foundation' | 'slice' | 'workspace';
64
+ kind: 'foundation' | 'site' | 'slice' | 'workspace';
65
65
  recordedBlueprintVersion?: string;
66
66
  recordedFrameworkVersion?: string;
67
67
  target: string;
@@ -78,6 +78,10 @@ export interface DeveloperAgentSliceGeneratorInput {
78
78
  generator: 'slice';
79
79
  name: string;
80
80
  }
81
+ /** The workspace root site at packages/site; the name is fixed. */
82
+ export interface DeveloperAgentSiteGeneratorInput {
83
+ generator: 'site';
84
+ }
81
85
  export interface DeveloperAgentFunctionGeneratorInput {
82
86
  feature: string;
83
87
  generator: 'function';
@@ -101,7 +105,7 @@ export interface DeveloperAgentUpgradeGeneratorInput {
101
105
  name: string;
102
106
  preview?: DeveloperAgentGeneratorPreviewReference;
103
107
  }
104
- export type DeveloperAgentGeneratorInput = DeveloperAgentFunctionGeneratorInput | DeveloperAgentJobGeneratorInput | DeveloperAgentServiceGeneratorInput | DeveloperAgentSliceGeneratorInput | DeveloperAgentUpgradeGeneratorInput;
108
+ export type DeveloperAgentGeneratorInput = DeveloperAgentFunctionGeneratorInput | DeveloperAgentJobGeneratorInput | DeveloperAgentServiceGeneratorInput | DeveloperAgentSiteGeneratorInput | DeveloperAgentSliceGeneratorInput | DeveloperAgentUpgradeGeneratorInput;
105
109
  export interface DeveloperAgentGeneratorOperation {
106
110
  generator: DeveloperAgentStableGenerator;
107
111
  mode: DeveloperAgentGeneratorMode;
@@ -100,6 +100,7 @@ exports.DEVELOPER_AGENT_OWNERSHIP_MODES = [
100
100
  ];
101
101
  exports.DEVELOPER_AGENT_STABLE_GENERATORS = [
102
102
  'slice',
103
+ 'site',
103
104
  'function',
104
105
  'service',
105
106
  'job',
@@ -43,6 +43,7 @@ export declare const DOCKER_BUILD_OWNER_RATIONALE = "Local workload image builds
43
43
  export declare const WORKLOAD_DEV_OWNER_RATIONALE = "A hot workload process started outside the ebk dev Fleet has no owned port, lifecycle or cleanup. Verify Service and Job source with its test, typecheck and build targets and exercise it through ebk deploy development <slice>.";
44
44
  export declare const FORMAT_WRITE_OWNER_RATIONALE = "Formatting rewrites source files only: run pnpm nx format:write directly as part of a source edit, then rerun the required verification.";
45
45
  export declare const GRAPH_INTERACTIVE_RATIONALE = "nx graph starts an interactive browser server and is not a bounded operation; use ebk agent context for the read-only project inventory.";
46
+ export declare const ROOT_SITE_DEPLOY_OWNER_RATIONALE = "The root site deploys through ebk deploy development site (or ebk deploy development), which orders it after the Foundation and before the Product Slices and runs its deployed smoke; protected stages deploy it only through the GitHub Deploy workflow.";
46
47
  export declare const ROUTER_WAF_REHEARSAL_OWNER_RATIONALE = "The Router WAF rehearsal requires an exact --probeUrl that planning cannot derive: run it directly through its Nx target with that option after a development deployment.";
47
48
  /**
48
49
  * Authority classes are not a severity list. In particular, development
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ROUTER_WAF_REHEARSAL_OWNER_RATIONALE = exports.GRAPH_INTERACTIVE_RATIONALE = exports.FORMAT_WRITE_OWNER_RATIONALE = exports.WORKLOAD_DEV_OWNER_RATIONALE = exports.DOCKER_BUILD_OWNER_RATIONALE = exports.DEPLOY_LOCAL_OWNER_RATIONALE = exports.DeveloperAgentOperationRegistryError = void 0;
3
+ exports.ROUTER_WAF_REHEARSAL_OWNER_RATIONALE = exports.ROOT_SITE_DEPLOY_OWNER_RATIONALE = exports.GRAPH_INTERACTIVE_RATIONALE = exports.FORMAT_WRITE_OWNER_RATIONALE = exports.WORKLOAD_DEV_OWNER_RATIONALE = exports.DOCKER_BUILD_OWNER_RATIONALE = exports.DEPLOY_LOCAL_OWNER_RATIONALE = exports.DeveloperAgentOperationRegistryError = void 0;
4
4
  exports.joinDeveloperAgentAuthorityClasses = joinDeveloperAgentAuthorityClasses;
5
5
  exports.createDeveloperAgentOperationRegistry = createDeveloperAgentOperationRegistry;
6
6
  exports.requireDeveloperAgentOperation = requireDeveloperAgentOperation;
@@ -9,6 +9,8 @@ const node_util_1 = require("node:util");
9
9
  const contracts_js_1 = require("../local-dev/contracts.js");
10
10
  const blueprint_trust_js_1 = require("../supply-chain/blueprint-trust.js");
11
11
  const model_js_1 = require("./model.js");
12
+ const built_in_site_files_js_1 = require("../generators/site/built-in-site-files.js");
13
+ const discovery_js_1 = require("../foundation/discovery.js");
12
14
  const ordering_js_1 = require("./ordering.js");
13
15
  class DeveloperAgentOperationRegistryError extends Error {
14
16
  classification = 'unsupported-operation';
@@ -46,6 +48,7 @@ exports.DOCKER_BUILD_OWNER_RATIONALE = 'Local workload image builds use the host
46
48
  exports.WORKLOAD_DEV_OWNER_RATIONALE = 'A hot workload process started outside the ebk dev Fleet has no owned port, lifecycle or cleanup. Verify Service and Job source with its test, typecheck and build targets and exercise it through ebk deploy development <slice>.';
47
49
  exports.FORMAT_WRITE_OWNER_RATIONALE = 'Formatting rewrites source files only: run pnpm nx format:write directly as part of a source edit, then rerun the required verification.';
48
50
  exports.GRAPH_INTERACTIVE_RATIONALE = 'nx graph starts an interactive browser server and is not a bounded operation; use ebk agent context for the read-only project inventory.';
51
+ exports.ROOT_SITE_DEPLOY_OWNER_RATIONALE = 'The root site deploys through ebk deploy development site (or ebk deploy development), which orders it after the Foundation and before the Product Slices and runs its deployed smoke; protected stages deploy it only through the GitHub Deploy workflow.';
49
52
  exports.ROUTER_WAF_REHEARSAL_OWNER_RATIONALE = 'The Router WAF rehearsal requires an exact --probeUrl that planning cannot derive: run it directly through its Nx target with that option after a development deployment.';
50
53
  function policyLifecycleActionForTarget(targetName) {
51
54
  if (exact('deploy', 'deploy-infrastructure', 'deploy-local', 'deployment-plan', 'foundation-ready')(targetName)) {
@@ -221,6 +224,37 @@ const TARGET_SIGNATURES = [
221
224
  dependsOn: ['secret-guardrails', 'typecheck'],
222
225
  env: { NODE_ENV: 'production' },
223
226
  }),
227
+ // The root site (packages/site): a Next.js app with no secrets, a
228
+ // route check before every build, and next dev on loopback outside the
229
+ // Fleet. Its lifecycle reuses the consumer-mode executor signatures below;
230
+ // its deploy belongs to ebk deploy development.
231
+ runCommandSignature('build', 'next build --webpack web', {
232
+ dependsOn: ['route-check', 'typecheck'],
233
+ env: { NODE_ENV: 'production' },
234
+ }),
235
+ runCommandSignature('dev', `next dev web --hostname 127.0.0.1 --port ${built_in_site_files_js_1.ROOT_SITE_DEV_PORT}`, { continuous: true }),
236
+ runCommandSignature('route-check', 'node scripts/route-check.mjs'),
237
+ executorSignature('verify', 'nx:noop', exactOptions(() => ({})), [
238
+ 'build',
239
+ 'lint',
240
+ 'route-check',
241
+ 'smoke-deployed-check',
242
+ 'test',
243
+ 'typecheck',
244
+ ]),
245
+ executorSignature('deploy', '@empire-builder-kit/nx:deploy', exactOptions((input) => ({
246
+ cwd: input.project.root,
247
+ stage: 'development',
248
+ stageMode: 'consumer',
249
+ })), ['verify', { params: 'forward', target: 'foundation-ready' }], { nonPlannableRationale: exports.ROOT_SITE_DEPLOY_OWNER_RATIONALE }),
250
+ // No capabilities key: a Slice's foundation-ready always names its
251
+ // capabilities, so this exact shape never claims a Slice target.
252
+ executorSignature('foundation-ready', '@empire-builder-kit/nx:foundation-preflight', exactOptions(() => ({
253
+ contract: discovery_js_1.STANDARD_FOUNDATION_REQUIREMENT.contract,
254
+ deployIfMissing: true,
255
+ foundationProject: 'foundation',
256
+ stage: 'development',
257
+ })), [{ params: 'ignore', projects: ['foundation'], target: 'verify' }], { nonPlannableRationale: exports.ROOT_SITE_DEPLOY_OWNER_RATIONALE }),
224
258
  runCommandSignature('configuration-expected', 'node --experimental-strip-types scripts/configuration-expected.mjs', { forwardAllArgs: false }),
225
259
  runCommandSignature('configuration-check', 'node --experimental-strip-types scripts/configuration-check.mjs', { forwardAllArgs: false }),
226
260
  runCommandSignature('contract-dependencies-check', 'node scripts/contract-dependencies.mjs check', { forwardAllArgs: false }),
@@ -409,7 +443,7 @@ const TARGET_SIGNATURES = [
409
443
  : undefined;
410
444
  }
411
445
  const kind = plural === 'services' ? 'service' : 'job';
412
- return (`docker build -f packages/${slice}/${plural}/${workload}/Dockerfile ` +
446
+ return ('docker build -f Dockerfile ' +
413
447
  `-t ${slice}-${kind}-${workload}:local ../../../..`);
414
448
  }, { nonPlannableRationale: exports.DOCKER_BUILD_OWNER_RATIONALE }),
415
449
  runScriptSignature('dev', (input) => input.project.root.includes('/services/')
@@ -1162,7 +1196,14 @@ function sourceEditOperations(projects, authenticatedTargets, workspaceVerificat
1162
1196
  ? projectVerification
1163
1197
  : undefined
1164
1198
  : workspaceVerification;
1165
- const featureTargets = ['lint', 'secret-guardrails', 'test', 'typecheck']
1199
+ // route-check is the root site's guard against shadowing a Slice path.
1200
+ const featureTargets = [
1201
+ 'lint',
1202
+ 'route-check',
1203
+ 'secret-guardrails',
1204
+ 'test',
1205
+ 'typecheck',
1206
+ ]
1166
1207
  .filter((target) => context.targets.includes(target))
1167
1208
  .map((target) => `${context.name}:${target}`);
1168
1209
  // Never substitute an unauthenticated check with a weaker fallback.
@@ -124,12 +124,15 @@ function blockingWarnings(context, readOnly, upgradeTarget, allowDirtyDevelopmen
124
124
  return true;
125
125
  if (hasExpectedVersionDrift('workspace'))
126
126
  return false;
127
+ // The root site, like each Product Slice, upgrades after the Foundation.
127
128
  if (upgradeTarget === 'foundation') {
128
- return drift.kind === 'foundation' || drift.kind === 'slice';
129
+ return (drift.kind === 'foundation' ||
130
+ drift.kind === 'site' ||
131
+ drift.kind === 'slice');
129
132
  }
130
133
  if (hasExpectedVersionDrift('foundation'))
131
134
  return false;
132
- return drift.kind === 'slice';
135
+ return drift.kind === 'site' || drift.kind === 'slice';
133
136
  };
134
137
  return context.warnings.filter((warning) => blocking.has(warning.classification) &&
135
138
  !mayConsumeExpectedVersionDrift(warning));
@@ -6,6 +6,7 @@ exports.developerAgentPreviewOwnershipModes = developerAgentPreviewOwnershipMode
6
6
  const node_buffer_1 = require("node:buffer");
7
7
  const node_crypto_1 = require("node:crypto");
8
8
  const node_path_1 = require("node:path");
9
+ const root_site_js_1 = require("../foundation/root-site.js");
9
10
  const index_js_1 = require("../ownership/index.js");
10
11
  const ordering_js_1 = require("./ordering.js");
11
12
  const workspace_path_js_1 = require("./workspace-path.js");
@@ -74,6 +75,15 @@ function developerAgentPreviewOwnershipModes(tree, target) {
74
75
  }
75
76
  add('packages/foundation', result.value);
76
77
  }
78
+ if (target === root_site_js_1.ROOT_SITE_NAME) {
79
+ const source = tree.read(`${root_site_js_1.ROOT_SITE_ROOT}/.ebk/ownership.json`, 'utf8');
80
+ const result = (0, index_js_1.validateSiteOwnershipRecord)(JSON.parse(source ?? 'null'));
81
+ if (!result.valid) {
82
+ throw new Error('Root site ownership is invalid in the Upgrade mutation candidate.');
83
+ }
84
+ add(root_site_js_1.ROOT_SITE_ROOT, result.value);
85
+ return modes;
86
+ }
77
87
  if (target !== 'workspace' && target !== 'foundation') {
78
88
  const prefix = `packages/${target}`;
79
89
  const source = tree.read(`${prefix}/.ebk/ownership.json`, 'utf8');
@@ -403,7 +403,7 @@ function validateOwnershipVersionState(value, path, issues) {
403
403
  ], issues);
404
404
  if (!record)
405
405
  return false;
406
- requireEnum(record.kind, `${path}.kind`, new Set(['foundation', 'slice', 'workspace']), issues);
406
+ requireEnum(record.kind, `${path}.kind`, new Set(['foundation', 'site', 'slice', 'workspace']), issues);
407
407
  requireSafeString(record.target, `${path}.target`, issues, {
408
408
  pattern: IDENTIFIER_PATTERN,
409
409
  });
@@ -419,7 +419,7 @@ function validateOwnershipVersionState(value, path, issues) {
419
419
  }
420
420
  }
421
421
  const kind = record.kind;
422
- if ((kind === 'workspace' || kind === 'foundation') &&
422
+ if ((kind === 'workspace' || kind === 'foundation' || kind === 'site') &&
423
423
  record.target !== kind) {
424
424
  addIssue(issues, `${path}.target`, `must equal ${kind}`);
425
425
  }
@@ -875,7 +875,7 @@ function validateWarning(value, path, issues) {
875
875
  if (has(record, 'upgradeVersionDrift')) {
876
876
  const drift = requireRecord(record.upgradeVersionDrift, `${path}.upgradeVersionDrift`, ['kind', 'target'], [], issues);
877
877
  if (drift) {
878
- requireEnum(drift.kind, `${path}.upgradeVersionDrift.kind`, new Set(['foundation', 'slice', 'workspace']), issues);
878
+ requireEnum(drift.kind, `${path}.upgradeVersionDrift.kind`, new Set(['foundation', 'site', 'slice', 'workspace']), issues);
879
879
  requireSafeString(drift.target, `${path}.upgradeVersionDrift.target`, issues, { pattern: IDENTIFIER_PATTERN });
880
880
  }
881
881
  if (record.classification !== 'ownership-conflict') {
@@ -914,6 +914,10 @@ function validateGeneratorInput(value, path, issues) {
914
914
  slug(record.name, `${path}.name`);
915
915
  return record !== undefined;
916
916
  }
917
+ // The root site is one fixed project, so its generator takes no name.
918
+ if (value.generator === 'site') {
919
+ return requireRecord(value, path, ['generator'], [], issues) !== undefined;
920
+ }
917
921
  if (value.generator === 'function' ||
918
922
  value.generator === 'service' ||
919
923
  value.generator === 'job') {
@@ -6,6 +6,7 @@ const node_util_1 = require("node:util");
6
6
  const semver_1 = require("semver");
7
7
  const node_fs_1 = require("node:fs");
8
8
  const node_path_1 = require("node:path");
9
+ const root_site_js_1 = require("../foundation/root-site.js");
9
10
  const contracts_js_1 = require("../local-dev/contracts.js");
10
11
  const index_js_1 = require("../ownership/index.js");
11
12
  const index_js_2 = require("../repository-policy/index.js");
@@ -448,9 +449,27 @@ function readOwnershipRecords(root, nodes) {
448
449
  });
449
450
  for (const node of nodes) {
450
451
  const tags = new Set(node.data.tags ?? []);
451
- if (!tags.has('scope:foundation') && !tags.has('type:slice'))
452
+ if (!tags.has('scope:foundation') &&
453
+ !tags.has('type:slice') &&
454
+ !tags.has('type:site'))
452
455
  continue;
453
456
  const relativeOwnership = `${node.data.root.split(node_path_1.sep).join('/')}/.ebk/ownership.json`;
457
+ // site is reserved for the workspace root site: only the fixed
458
+ // packages/site project carries type:site, and no Product Slice may use
459
+ // that name or directory.
460
+ const atSiteRoot = node.data.root.split(node_path_1.sep).join('/') === root_site_js_1.ROOT_SITE_ROOT;
461
+ if (tags.has('type:site')) {
462
+ if (node.name !== root_site_js_1.ROOT_SITE_NAME ||
463
+ !atSiteRoot ||
464
+ tags.has('scope:foundation') ||
465
+ tags.has('type:slice')) {
466
+ throw new Error(`Nx project ${node.name} carries type:site, which only the workspace root site ${root_site_js_1.ROOT_SITE_NAME} at ${root_site_js_1.ROOT_SITE_ROOT} may carry.`);
467
+ }
468
+ }
469
+ else if (tags.has('type:slice') &&
470
+ (node.name === root_site_js_1.ROOT_SITE_NAME || atSiteRoot)) {
471
+ throw new Error(`Product Slice ${node.name} uses ${root_site_js_1.ROOT_SITE_NAME}, which is reserved for the workspace root site. ${root_site_js_1.ROOT_SITE_RENAME_GUIDANCE}`);
472
+ }
454
473
  const ownershipFile = readBoundedWorkspaceFile(root, relativeOwnership, `${node.name} ownership record`, MAX_CONTROL_JSON_BYTES);
455
474
  const projectRoot = (0, node_fs_1.realpathSync)(containedPath(root, node.data.root));
456
475
  if (!isContained(root, projectRoot) ||
@@ -478,6 +497,20 @@ function readOwnershipRecords(root, nodes) {
478
497
  });
479
498
  continue;
480
499
  }
500
+ if (tags.has('type:site')) {
501
+ const validation = (0, index_js_1.validateSiteOwnershipRecord)(ownershipValue);
502
+ if (!validation.valid) {
503
+ throw new Error(`Root site ownership record is invalid: ${formatIssues(validation.issues)}`);
504
+ }
505
+ records.push({
506
+ frameworkVersion: validation.value.frameworkVersion,
507
+ kind: 'site',
508
+ path: relativeOwnership,
509
+ paths: validation.value.paths,
510
+ root: projectRoot,
511
+ });
512
+ continue;
513
+ }
481
514
  const validation = (0, index_js_1.validateGeneratedOwnershipRecord)(ownershipValue);
482
515
  if (!validation.valid) {
483
516
  throw new Error(`Product Slice ${node.name} ownership record is invalid: ${formatIssues(validation.issues)}`);
@@ -849,11 +882,14 @@ function candidateReference(root, requestedPath) {
849
882
  function policyContext(root, stage, policy, nodes) {
850
883
  const selected = nodes
851
884
  .filter((node) => node.data.tags?.includes('scope:foundation') ||
852
- node.data.tags?.includes('type:slice'))
885
+ node.data.tags?.includes('type:slice') ||
886
+ node.data.tags?.includes('type:site'))
853
887
  .map((node) => ({
854
888
  kind: node.data.tags?.includes('scope:foundation')
855
889
  ? 'foundation'
856
- : 'slice',
890
+ : node.data.tags?.includes('type:site')
891
+ ? 'site'
892
+ : 'slice',
857
893
  name: node.name,
858
894
  }))
859
895
  .sort((left, right) => (0, ordering_js_1.compareDeveloperAgentStrings)(left.name, right.name));
@@ -910,6 +946,14 @@ function policyContext(root, stage, policy, nodes) {
910
946
  name: `slices.${slice}.productionStatus`,
911
947
  value: value.productionStatus,
912
948
  })),
949
+ ...(policy.site
950
+ ? [
951
+ {
952
+ name: 'site.productionStatus',
953
+ value: policy.site.productionStatus,
954
+ },
955
+ ]
956
+ : []),
913
957
  ...decisions.map(({ action, allowed }) => ({
914
958
  name: `effective.${stage}.${action}`,
915
959
  value: allowed ? 'allowed' : 'blocked',
@@ -926,6 +970,7 @@ function policyContext(root, stage, policy, nodes) {
926
970
  productionApproval: policy.productionApproval,
927
971
  productionFoundation: policy.productionFoundation,
928
972
  schemaVersion: policy.schemaVersion,
973
+ ...(policy.site ? { site: policy.site } : {}),
929
974
  slices: Object.fromEntries(Object.entries(policy.slices).sort(([left], [right]) => (0, ordering_js_1.compareDeveloperAgentStrings)(left, right))),
930
975
  workspaceDeploymentId: policy.workspaceDeploymentId,
931
976
  workspaceDeploymentProvenance: policy.workspaceDeploymentProvenance,
@@ -1068,7 +1113,9 @@ function inspectDeveloperAgentWorkspace(options) {
1068
1113
  }
1069
1114
  const projects = nodes.map((node) => projectContext(options.graph, node));
1070
1115
  const selectedProjectNames = new Set(nodes.map(({ name }) => name));
1071
- const ownershipNodes = Object.values(options.graph.nodes).filter((node) => node.data.tags?.some((tag) => tag === 'scope:foundation' || tag === 'type:slice'));
1116
+ const ownershipNodes = Object.values(options.graph.nodes).filter((node) => node.data.tags?.some((tag) => tag === 'scope:foundation' ||
1117
+ tag === 'type:slice' ||
1118
+ tag === 'type:site'));
1072
1119
  const ownership = readOwnershipRecords(root, ownershipNodes);
1073
1120
  const externalOwnershipRoots = (0, blueprint_verification_authority_js_1.externalBlueprintOwnershipRoots)(root);
1074
1121
  const versions = versionContext(root, identity.name, ownership.records);
@@ -21,6 +21,9 @@ function writeGithubOutputs(plan) {
21
21
  `has_slices=${plan.sliceProjects.length > 0 ? 'true' : 'false'}`,
22
22
  `ordered_projects=${plan.orderedProjects.join(',')}`,
23
23
  `production_approval_mode=${plan.productionApprovalMode}`,
24
+ // The root site deploys and smokes inside deploy-local; it is never a
25
+ // Slice project, release candidate or container project.
26
+ `site_project=${plan.siteProject ?? ''}`,
24
27
  `slice_projects=${plan.sliceProjects.join(',')}`,
25
28
  // One matrix row per selected Slice so the protected OCI build fans out
26
29
  // per Slice and architecture instead of looping on one runner.
@@ -3,6 +3,7 @@ import { probeEphemeralTlsEndpoint, probeTlsEndpoint } from '../../local-dev/eff
3
3
  import { sendGatewayCommand } from '../../local-dev/gateway.js';
4
4
  import { resolveFleetHostname } from '../../local-dev/identity.js';
5
5
  import { type PersonalStageResolver } from '../../local-dev/personal-stage.js';
6
+ import { type TrustCommandRunner } from '../../local-dev/trust-store.js';
6
7
  export interface DevDoctorOptions {
7
8
  appData?: string;
8
9
  hostname?: string;
@@ -10,13 +11,19 @@ export interface DevDoctorOptions {
10
11
  export interface DevDoctorResult {
11
12
  certificateExpires?: string;
12
13
  connectivity: 'missing' | 'ready';
13
- gateway: 'missing' | 'ready';
14
+ /** `not-configured` unless portless intent is recorded. */
15
+ gateway: 'missing' | 'not-configured' | 'ready';
14
16
  hostname: string;
15
17
  issues: readonly string[];
16
18
  portless: 'not-configured' | 'ready' | 'unreachable';
17
19
  resolver: readonly string[];
18
20
  tls: 'invalid' | 'missing' | 'ready';
19
- trust: 'missing' | 'ready';
21
+ /**
22
+ * `ready` only when the platform verifier accepted the exact chain;
23
+ * `missing` when it ran and rejected it (or the root is absent); `unknown`
24
+ * when no effect-based check could run or its result is unrecognized.
25
+ */
26
+ trust: 'missing' | 'ready' | 'unknown';
20
27
  }
21
28
  interface DevDoctorDependencies {
22
29
  inspectTrust?: typeof inspectCertificateTrust;
@@ -26,7 +33,22 @@ interface DevDoctorDependencies {
26
33
  send?: typeof sendGatewayCommand;
27
34
  personalStageResolver?: PersonalStageResolver;
28
35
  }
29
- export declare function inspectCertificateTrust(rootCertificatePath: string, intermediateCertificatePath: string, leafCertificatePath: string, hostname: string): DevDoctorResult['trust'];
36
+ export interface CertificateTrustInspection {
37
+ environment?: NodeJS.ProcessEnv;
38
+ homeDirectory?: string;
39
+ pathExists?: (path: string) => boolean;
40
+ platform?: NodeJS.Platform;
41
+ run?: TrustCommandRunner;
42
+ }
43
+ export declare function windowsChainTrustCommand(environment?: NodeJS.ProcessEnv): {
44
+ args: string[];
45
+ command: string;
46
+ };
47
+ /**
48
+ * Effect-based system trust check for the generated chain. Certificate
49
+ * presence alone never reports `ready`.
50
+ */
51
+ export declare function inspectCertificateTrust(rootCertificatePath: string, intermediateCertificatePath: string, leafCertificatePath: string, hostname: string, inspection?: CertificateTrustInspection): DevDoctorResult['trust'];
30
52
  export declare function inspectLocalDevelopment(options: DevDoctorOptions, context: Pick<ExecutorContext, 'projectName' | 'root'>, dependencies?: DevDoctorDependencies): Promise<DevDoctorResult>;
31
53
  declare const executor: PromiseExecutor<DevDoctorOptions>;
32
54
  export default executor;