@astryxdesign/cli 0.7.2-canary.4932317 → 0.7.2-canary.4a2f608

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 (109) hide show
  1. package/README.md +62 -62
  2. package/api/discover/_adapter.d.mts +119 -12
  3. package/api/discover/_adapter.mjs +449 -10
  4. package/api/discover/_adapter.test.mjs +599 -17
  5. package/api/discover/_catalog-view.d.mts +16 -5
  6. package/api/discover/_catalog-view.mjs +32 -8
  7. package/api/discover/discover.d.mts +11 -0
  8. package/api/discover/discover.doc.mjs +7 -6
  9. package/api/discover/discover.mjs +107 -19
  10. package/api/discover/discover.type.d.mts +18 -7
  11. package/api/discover/discover.type.mjs +15 -7
  12. package/api/discover/list/list.d.mts +4 -3
  13. package/api/discover/list/list.mjs +17 -10
  14. package/api/doctor/theme-checks.test.mjs +136 -0
  15. package/api/gap-report/gap-report.d.mts +3 -0
  16. package/api/gap-report/gap-report.doc.mjs +11 -3
  17. package/api/gap-report/gap-report.mjs +152 -48
  18. package/api/gap-report/gap-report.test.mjs +233 -0
  19. package/api/gap-report/gap-report.type.d.mts +41 -0
  20. package/api/gap-report/gap-report.type.mjs +18 -0
  21. package/api/integration/_adapter.d.mts +20 -0
  22. package/api/integration/_adapter.mjs +26 -0
  23. package/api/integration/authoring-checks.mjs +34 -3
  24. package/api/integration/authoring-checks.test.mjs +476 -0
  25. package/api/integration/authoring-checks.type.d.mts +86 -0
  26. package/api/integration/authoring-checks.type.mjs +39 -1
  27. package/api/integration/integrationComponentConflicts.doc.mjs +9 -3
  28. package/api/integration/integrationDocConflicts.doc.mjs +19 -5
  29. package/api/integration/pack-check.mjs +292 -7
  30. package/api/integration/pack-check.test.mjs +341 -0
  31. package/api/integration/validateIntegration.doc.mjs +3 -1
  32. package/api/search/search.d.mts +9 -7
  33. package/api/search/search.mjs +90 -42
  34. package/api/search/search.test.mjs +11 -0
  35. package/api/upgrade/_adapter.d.mts +40 -2
  36. package/api/upgrade/_adapter.mjs +117 -4
  37. package/api/upgrade/run/cli-behind-core.test.mjs +438 -0
  38. package/api/upgrade/run/run.mjs +30 -1
  39. package/api/upgrade/status/status.d.mts +21 -5
  40. package/api/upgrade/status/status.mjs +45 -8
  41. package/api/upgrade/upgrade.doc.mjs +5 -3
  42. package/api/upgrade/upgrade.type.d.mts +23 -0
  43. package/api/upgrade/upgrade.type.mjs +16 -1
  44. package/assets/codemods/runner.mjs +7 -1
  45. package/assets/discover/official-packages.json +367 -0
  46. package/assets/docs/author-a-theme.doc.mjs +2 -2
  47. package/assets/docs/browser-support.doc.mjs +1 -1
  48. package/assets/docs/styling-overview.doc.mjs +1 -1
  49. package/assets/docs/theme.doc.mjs +1 -1
  50. package/assets/docs/tree/add-a-topic.doc.mjs +1 -1
  51. package/assets/docs/tree/check-the-props.doc.mjs +2 -2
  52. package/assets/docs/tree/check-your-docs.doc.mjs +11 -3
  53. package/assets/docs/tree/checks.doc.mjs +4 -4
  54. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +25 -5
  55. package/assets/docs/tree/layout-spacing.doc.mjs +2 -3
  56. package/assets/docs/tree/layout.doc.mjs +6 -6
  57. package/assets/docs/tree/migration-setup.doc.mjs +2 -2
  58. package/assets/docs/tree/publishing.doc.mjs +3 -3
  59. package/assets/docs/tree/quick-start.doc.mjs +3 -3
  60. package/assets/docs/tree/sections-and-placement.doc.mjs +2 -2
  61. package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
  62. package/assets/docs/tree/troubleshooting.doc.mjs +5 -5
  63. package/assets/docs/tree/upgrading.doc.mjs +1 -1
  64. package/authoring/discover/discover.doc.mjs +1 -1
  65. package/authoring/doctypes/component/component.doc.mjs +1 -1
  66. package/clients/cli/commands/discover.broken-integration.test.mjs +4 -1
  67. package/clients/cli/commands/discover.doc.mjs +1 -1
  68. package/clients/cli/commands/discover.mjs +144 -93
  69. package/clients/cli/commands/discover.no-source.test.mjs +447 -33
  70. package/clients/cli/commands/discover.sources.test.mjs +20 -1
  71. package/clients/cli/commands/doctor-integration-components.doc.mjs +3 -1
  72. package/clients/cli/commands/doctor-integration-docs.doc.mjs +18 -5
  73. package/clients/cli/commands/doctor-integration-validate.doc.mjs +3 -1
  74. package/clients/cli/commands/doctor.mjs +60 -3
  75. package/clients/cli/commands/gap-report.doc.mjs +14 -2
  76. package/clients/cli/commands/gap-report.mjs +24 -2
  77. package/clients/cli/commands/gap-report.test.mjs +79 -0
  78. package/clients/cli/commands/integration-check.test.mjs +103 -0
  79. package/clients/cli/commands/integration.mjs +2 -3
  80. package/clients/cli/commands/json-contract.test.mjs +5 -1
  81. package/clients/cli/commands/upgrade.doc.mjs +14 -0
  82. package/clients/cli/commands/upgrade.older-cli.test.mjs +160 -0
  83. package/foundation/discovery/copied-passages.d.mts +216 -0
  84. package/foundation/discovery/copied-passages.mjs +720 -0
  85. package/foundation/discovery/copied-passages.test.mjs +124 -0
  86. package/foundation/discovery/doc-fluff.d.mts +112 -0
  87. package/foundation/discovery/doc-fluff.mjs +328 -0
  88. package/foundation/discovery/doc-fluff.test.mjs +142 -0
  89. package/foundation/discovery/doc-types.d.mts +1 -1
  90. package/foundation/discovery/doc-types.mjs +3 -3
  91. package/foundation/discovery/doc-types.test.mjs +48 -0
  92. package/foundation/discovery/docs-discovery.d.mts +7 -0
  93. package/foundation/discovery/docs-discovery.mjs +26 -2
  94. package/foundation/discovery/project-typescript.d.mts +11 -2
  95. package/foundation/discovery/project-typescript.mjs +32 -4
  96. package/foundation/discovery/prop-drift.d.mts +1 -1
  97. package/foundation/discovery/prop-drift.mjs +2 -2
  98. package/foundation/discovery/prop-drift.test.mjs +55 -2
  99. package/foundation/discovery/type-text.mjs +1 -1
  100. package/foundation/discovery/type-text.test.mjs +1 -1
  101. package/foundation/doc-compiler/doc-loads.test.mjs +14 -2
  102. package/foundation/env/package-manager.d.mts +32 -0
  103. package/foundation/env/package-manager.mjs +47 -0
  104. package/foundation/env/package-manager.test.mjs +194 -7
  105. package/foundation/fs/module-loader.d.mts +2 -1
  106. package/foundation/fs/module-loader.mjs +60 -4
  107. package/foundation/fs/module-loader.test.mjs +194 -0
  108. package/foundation/response/response-types.doc.mjs +7 -6
  109. package/package.json +11 -11
@@ -7,6 +7,7 @@ import * as path from 'node:path';
7
7
  import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
8
8
  import {Project} from '../../foundation/config/project.mjs';
9
9
  import {
10
+ ASK_DESTINATION_MESSAGE,
10
11
  GAP_REPORT_CATEGORIES,
11
12
  PUBLIC_CONFIRMATION_MESSAGE,
12
13
  collectGapReportHandlers,
@@ -1022,6 +1023,238 @@ console.log('https://github.com/acme/widgets/issues/42');
1022
1023
  });
1023
1024
  });
1024
1025
 
1026
+ describe('gapReport destinations and --to', () => {
1027
+ /** A shared internal handler that records each call in a marker file. */
1028
+ function addSharedHandler() {
1029
+ const marker = path.join(projectDir, 'shared-called');
1030
+ addIntegration({
1031
+ name: '@test/shared',
1032
+ audience: 'internal',
1033
+ handleBody: `(await import('node:fs')).writeFileSync(${JSON.stringify(marker)}, 'x'); return {status: 'filed', message: 'shared'};`,
1034
+ });
1035
+ return marker;
1036
+ }
1037
+
1038
+ function addWidgets(issuesUrl = 'https://github.com/acme/widgets/issues') {
1039
+ addIntegration({name: '@test/widgets', handler: false, issuesUrl});
1040
+ }
1041
+
1042
+ it('keeps the default route and lists the destinations with the ask line', async () => {
1043
+ const marker = addSharedHandler();
1044
+ addWidgets();
1045
+ configure(['@test/shared', '@test/widgets']);
1046
+ const argsFile = stubGh();
1047
+
1048
+ const result = await gapReport('General', {
1049
+ ...reportOptions,
1050
+ confirmPublic: true,
1051
+ cwd: projectDir,
1052
+ });
1053
+
1054
+ expect(result.data.deliveries).toEqual([
1055
+ expect.objectContaining({handler: '@test/shared', status: 'filed'}),
1056
+ ]);
1057
+ expect(fs.existsSync(marker)).toBe(true);
1058
+ expect(fs.existsSync(argsFile)).toBe(false);
1059
+ expect(result.data.destinations).toEqual([
1060
+ {to: null, default: true, issuesUrl: null},
1061
+ {
1062
+ to: '@test/widgets',
1063
+ default: false,
1064
+ issuesUrl: 'https://github.com/acme/widgets/issues',
1065
+ },
1066
+ ]);
1067
+ expect(result.data.ask).toBe(ASK_DESTINATION_MESSAGE);
1068
+ expect(ASK_DESTINATION_MESSAGE).toMatch(/ask the person/i);
1069
+ });
1070
+
1071
+ it('lists no destinations when no integration names an issuesUrl', async () => {
1072
+ addSharedHandler();
1073
+ configure(['@test/shared']);
1074
+
1075
+ const result = await gapReport('General', {
1076
+ ...reportOptions,
1077
+ cwd: projectDir,
1078
+ });
1079
+
1080
+ expect(result.data).not.toHaveProperty('destinations');
1081
+ expect(result.data).not.toHaveProperty('ask');
1082
+ });
1083
+
1084
+ it('files with the chosen integration GitHub issuesUrl only with consent, and runs no handler', async () => {
1085
+ const marker = addSharedHandler();
1086
+ addWidgets();
1087
+ configure(['@test/shared', '@test/widgets']);
1088
+ const argsFile = stubGh();
1089
+
1090
+ const pending = await gapReport('General', {
1091
+ ...reportOptions,
1092
+ to: '@test/widgets',
1093
+ cwd: projectDir,
1094
+ });
1095
+ expect(pending.data.deliveries).toEqual([
1096
+ {
1097
+ handlerType: 'fallback',
1098
+ handler: 'github',
1099
+ audience: 'public',
1100
+ status: 'consent_required',
1101
+ url: null,
1102
+ message: PUBLIC_CONFIRMATION_MESSAGE,
1103
+ },
1104
+ ]);
1105
+ expect(pending.data.issuesUrl).toBe(
1106
+ 'https://github.com/acme/widgets/issues',
1107
+ );
1108
+ expect(pending.data).not.toHaveProperty('destinations');
1109
+ expect(fs.existsSync(argsFile)).toBe(false);
1110
+
1111
+ const filed = await gapReport('General', {
1112
+ ...reportOptions,
1113
+ to: '@test/widgets',
1114
+ confirmPublic: true,
1115
+ cwd: projectDir,
1116
+ });
1117
+ expect(filed.data.deliveries).toHaveLength(1);
1118
+ expect(filed.data.deliveries[0]).toMatchObject({
1119
+ handlerType: 'fallback',
1120
+ handler: 'github',
1121
+ status: 'filed',
1122
+ });
1123
+ const args = JSON.parse(fs.readFileSync(argsFile, 'utf8'));
1124
+ expect(args.slice(0, 4)).toEqual([
1125
+ 'issue',
1126
+ 'create',
1127
+ '--repo',
1128
+ 'acme/widgets',
1129
+ ]);
1130
+ expect(fs.existsSync(marker)).toBe(false);
1131
+ });
1132
+
1133
+ it('routes a chosen non-GitHub issuesUrl as routed_only', async () => {
1134
+ addSharedHandler();
1135
+ addWidgets('https://tracker.example/widgets');
1136
+ configure(['@test/shared', '@test/widgets']);
1137
+
1138
+ const result = await gapReport('General', {
1139
+ ...reportOptions,
1140
+ to: '@test/widgets',
1141
+ cwd: projectDir,
1142
+ });
1143
+
1144
+ expect(result.data.deliveries).toEqual([
1145
+ expect.objectContaining({
1146
+ handlerType: 'fallback',
1147
+ handler: 'issuesUrl',
1148
+ status: 'routed_only',
1149
+ url: 'https://tracker.example/widgets',
1150
+ }),
1151
+ ]);
1152
+ expect(result.data.status).toBe('routed_only');
1153
+ });
1154
+
1155
+ it.each([
1156
+ ['a package that is not loaded', '@test/nope'],
1157
+ ['a loaded integration without an issuesUrl', '@test/shared'],
1158
+ ])(
1159
+ 'refuses --to naming %s, lists the choices, and sends nothing',
1160
+ async (_label, to) => {
1161
+ const marker = addSharedHandler();
1162
+ addWidgets();
1163
+ configure(['@test/shared', '@test/widgets']);
1164
+
1165
+ await expect(
1166
+ gapReport('General', {...reportOptions, to, cwd: projectDir}),
1167
+ ).rejects.toMatchObject({
1168
+ code: 'ERR_UNKNOWN_PACKAGE',
1169
+ suggestions: [
1170
+ {
1171
+ name: '@test/widgets',
1172
+ reason: 'https://github.com/acme/widgets/issues',
1173
+ },
1174
+ ],
1175
+ });
1176
+ expect(fs.existsSync(marker)).toBe(false);
1177
+ },
1178
+ );
1179
+
1180
+ it.each([
1181
+ ['an empty value', ''],
1182
+ ['a blank value', ' '],
1183
+ ['an over-long value', `@test/${'a'.repeat(300)}`],
1184
+ ])('refuses %s for --to with the destination list', async (_label, to) => {
1185
+ const marker = addSharedHandler();
1186
+ addWidgets();
1187
+ configure(['@test/shared', '@test/widgets']);
1188
+
1189
+ await expect(
1190
+ gapReport('General', {...reportOptions, to, cwd: projectDir}),
1191
+ ).rejects.toMatchObject({
1192
+ code: 'ERR_UNKNOWN_PACKAGE',
1193
+ suggestions: [{name: '@test/widgets'}],
1194
+ });
1195
+ expect(fs.existsSync(marker)).toBe(false);
1196
+ });
1197
+
1198
+ it('treats to: null as absent', async () => {
1199
+ const marker = addSharedHandler();
1200
+ addWidgets();
1201
+ configure(['@test/shared', '@test/widgets']);
1202
+
1203
+ const result = await gapReport('General', {
1204
+ ...reportOptions,
1205
+ to: /** @type {any} */ (null),
1206
+ cwd: projectDir,
1207
+ });
1208
+
1209
+ expect(result.data.deliveries).toHaveLength(1);
1210
+ expect(fs.existsSync(marker)).toBe(true);
1211
+ expect(result.data.destinations).toHaveLength(2);
1212
+ });
1213
+
1214
+ it('lists the destinations with the categories', async () => {
1215
+ addSharedHandler();
1216
+ addWidgets();
1217
+ configure(['@test/shared', '@test/widgets']);
1218
+
1219
+ const listed = await gapReport(undefined, {
1220
+ listCategories: true,
1221
+ cwd: projectDir,
1222
+ });
1223
+
1224
+ expect(listed.data).toEqual(GAP_REPORT_CATEGORIES);
1225
+ expect(listed.meta).toEqual({
1226
+ destinations: [
1227
+ {to: null, default: true, issuesUrl: null},
1228
+ {
1229
+ to: '@test/widgets',
1230
+ default: false,
1231
+ issuesUrl: 'https://github.com/acme/widgets/issues',
1232
+ },
1233
+ ],
1234
+ ask: ASK_DESTINATION_MESSAGE,
1235
+ });
1236
+ });
1237
+
1238
+ it('adds no meta to the categories when there is only the default', async () => {
1239
+ configure([]);
1240
+ const listed = await gapReport(undefined, {
1241
+ listCategories: true,
1242
+ cwd: projectDir,
1243
+ });
1244
+ expect(listed).not.toHaveProperty('meta');
1245
+ });
1246
+
1247
+ it('refuses --to with --list-categories', async () => {
1248
+ await expect(
1249
+ gapReport(undefined, {
1250
+ listCategories: true,
1251
+ to: '@test/widgets',
1252
+ cwd: projectDir,
1253
+ }),
1254
+ ).rejects.toMatchObject({code: 'ERR_INVALID_ARGUMENT'});
1255
+ });
1256
+ });
1257
+
1025
1258
  describe('gapReport target selection', () => {
1026
1259
  it('routes to the unique component owner', async () => {
1027
1260
  addIntegration({
@@ -35,10 +35,42 @@ export type GapReportOptions = {
35
35
  * Return the category vocabulary without routing or writing.
36
36
  */
37
37
  listCategories?: boolean | undefined;
38
+ /**
39
+ * A destination the person chose: a loaded integration
40
+ * whose manifest names an issues URL. The report goes only there.
41
+ */
42
+ to?: string | undefined;
43
+ };
44
+ /**
45
+ * Where a report can go. The default entry (`to: null`) is the configured
46
+ * handlers, or with none the owning package's issues URL.
47
+ */
48
+ export type GapReportDestination = {
49
+ /**
50
+ * The value to pass as `to`; null for the default.
51
+ */
52
+ to: string | null;
53
+ /**
54
+ * Whether this is the default destination.
55
+ */
56
+ default: boolean;
57
+ /**
58
+ * The integration's issues URL; null for the
59
+ * default.
60
+ */
61
+ issuesUrl: string | null;
38
62
  };
39
63
  export type GapReportCategoriesResponse = {
40
64
  type: "gap-report.categories";
41
65
  data: GapReportCategoryEntry[];
66
+ /**
67
+ * Present when a destination besides the default exists: every destination,
68
+ * and the line telling an agent to ask the person.
69
+ */
70
+ meta?: {
71
+ destinations: GapReportDestination[];
72
+ ask: string;
73
+ } | undefined;
42
74
  };
43
75
  export type GapReportAggregateStatus = "filed" | "partial" | "failed" | "routed_only" | "consent_required" | "skipped";
44
76
  export type GapReportDeliveryStatus = "filed" | "routed_only" | "skipped" | "failed" | "consent_required";
@@ -81,6 +113,15 @@ export type GapReportReceipt = {
81
113
  * Count of handlers that routed only.
82
114
  */
83
115
  routedOnlyCount: number;
116
+ /**
117
+ * For a run without `to`,
118
+ * when a destination besides the default exists: every destination.
119
+ */
120
+ destinations?: GapReportDestination[] | undefined;
121
+ /**
122
+ * With `destinations`: ask the person where to file.
123
+ */
124
+ ask?: string | undefined;
84
125
  };
85
126
  export type GapReportReceiptResponse = {
86
127
  type: "gap-report.file";
@@ -23,12 +23,27 @@
23
23
  * @property {string} [package] Explicit owner package for ambiguous routes.
24
24
  * @property {boolean} [confirmPublic] Explicit consent for public handlers or GitHub issue creation.
25
25
  * @property {boolean} [listCategories] Return the category vocabulary without routing or writing.
26
+ * @property {string} [to] A destination the person chose: a loaded integration
27
+ * whose manifest names an issues URL. The report goes only there.
28
+ */
29
+
30
+ /**
31
+ * Where a report can go. The default entry (`to: null`) is the configured
32
+ * handlers, or with none the owning package's issues URL.
33
+ * @typedef {object} GapReportDestination
34
+ * @property {string|null} to The value to pass as `to`; null for the default.
35
+ * @property {boolean} default Whether this is the default destination.
36
+ * @property {string|null} issuesUrl The integration's issues URL; null for the
37
+ * default.
26
38
  */
27
39
 
28
40
  /**
29
41
  * @typedef {object} GapReportCategoriesResponse
30
42
  * @property {'gap-report.categories'} type
31
43
  * @property {GapReportCategoryEntry[]} data
44
+ * @property {{destinations: GapReportDestination[], ask: string}} [meta]
45
+ * Present when a destination besides the default exists: every destination,
46
+ * and the line telling an agent to ask the person.
32
47
  */
33
48
 
34
49
  /**
@@ -58,6 +73,9 @@
58
73
  * @property {GapReportDelivery[]} deliveries Ordered handler outcomes.
59
74
  * @property {number} filedCount Count of handlers that filed the report.
60
75
  * @property {number} routedOnlyCount Count of handlers that routed only.
76
+ * @property {GapReportDestination[]} [destinations] For a run without `to`,
77
+ * when a destination besides the default exists: every destination.
78
+ * @property {string} [ask] With `destinations`: ask the person where to file.
61
79
  */
62
80
 
63
81
  /**
@@ -10,3 +10,23 @@
10
10
  * @returns {Promise<import('../../foundation/discovery/prop-drift.mjs').PropDriftReport>}
11
11
  */
12
12
  export function integrationPropDrift(integration: any, cwd: string): Promise<import("../../foundation/discovery/prop-drift.mjs").PropDriftReport>;
13
+ /**
14
+ * The passages two of a package's topics, or one of them and a Core topic,
15
+ * repeat word for word (architecture:cli-surface DEC-8). Reads the package's
16
+ * topics and Core's guides.
17
+ *
18
+ * @param {Parameters<typeof findCopiedPassages>[0]} discovered the package's
19
+ * docs, as discoverIntegrationDocs returns them
20
+ */
21
+ export function integrationCopiedPassages(discovered: Parameters<typeof findCopiedPassages>[0]): Promise<import("./authoring-checks.type.mjs").CopiedPassage[]>;
22
+ /**
23
+ * Padding phrases and low-density topics in a package's prose
24
+ * (architecture:cli-surface DEC-8). Reads the package's topics, and Core's
25
+ * guides for the density median a finding names.
26
+ *
27
+ * @param {Parameters<typeof findFluff>[0]} discovered the package's docs, as
28
+ * discoverIntegrationDocs returns them
29
+ */
30
+ export function integrationFluff(discovered: Parameters<typeof findFluff>[0]): Promise<import("./authoring-checks.type.mjs").DocFluff[]>;
31
+ import { findCopiedPassages } from '../../foundation/discovery/copied-passages.mjs';
32
+ import { findFluff } from '../../foundation/discovery/doc-fluff.mjs';
@@ -15,6 +15,8 @@ import {
15
15
  integrationSourceForDoc,
16
16
  } from '../../foundation/discovery/component-discovery.mjs';
17
17
  import {comparePropDocs} from '../../foundation/discovery/prop-drift.mjs';
18
+ import {findCopiedPassages} from '../../foundation/discovery/copied-passages.mjs';
19
+ import {findFluff} from '../../foundation/discovery/doc-fluff.mjs';
18
20
 
19
21
  /**
20
22
  * Each component doc's props compared with the component's TypeScript props,
@@ -52,3 +54,27 @@ export async function integrationPropDrift(integration, cwd) {
52
54
  resolveFrom: [cwd, packageDir],
53
55
  });
54
56
  }
57
+
58
+ /**
59
+ * The passages two of a package's topics, or one of them and a Core topic,
60
+ * repeat word for word (architecture:cli-surface DEC-8). Reads the package's
61
+ * topics and Core's guides.
62
+ *
63
+ * @param {Parameters<typeof findCopiedPassages>[0]} discovered the package's
64
+ * docs, as discoverIntegrationDocs returns them
65
+ */
66
+ export function integrationCopiedPassages(discovered) {
67
+ return findCopiedPassages(discovered);
68
+ }
69
+
70
+ /**
71
+ * Padding phrases and low-density topics in a package's prose
72
+ * (architecture:cli-surface DEC-8). Reads the package's topics, and Core's
73
+ * guides for the density median a finding names.
74
+ *
75
+ * @param {Parameters<typeof findFluff>[0]} discovered the package's docs, as
76
+ * discoverIntegrationDocs returns them
77
+ */
78
+ export function integrationFluff(discovered) {
79
+ return findFluff(discovered);
80
+ }
@@ -29,7 +29,11 @@ import {
29
29
  discoverOwnedComponents,
30
30
  } from '../../foundation/discovery/component-discovery.mjs';
31
31
  import {loadComponentReplacements} from '../component/_adapter.mjs';
32
- import {integrationPropDrift} from './_adapter.mjs';
32
+ import {
33
+ integrationCopiedPassages,
34
+ integrationFluff,
35
+ integrationPropDrift,
36
+ } from './_adapter.mjs';
33
37
  import {
34
38
  discoverBuiltinTopics,
35
39
  discoverIntegrationDocs,
@@ -323,10 +327,22 @@ export async function integrationDocConflicts(pkg, options = {}) {
323
327
  const version = resolved.found ? (resolved.version ?? null) : null;
324
328
  const issues = [...resolved.issues];
325
329
 
330
+ /** @type {import('./authoring-checks.type.mjs').CopiedPassage[]} */
331
+ const copiedPassages = [];
332
+ /** @type {import('./authoring-checks.type.mjs').DocFluff[]} */
333
+ const fluff = [];
326
334
  if (!resolved.integration?.docs || name == null) {
327
335
  return {
328
336
  type: 'integration.doc-conflicts',
329
- data: {validated, name, version, findings: [], issues},
337
+ data: {
338
+ validated,
339
+ name,
340
+ version,
341
+ findings: [],
342
+ copiedPassages,
343
+ fluff,
344
+ issues,
345
+ },
330
346
  };
331
347
  }
332
348
 
@@ -416,10 +432,25 @@ export async function integrationDocConflicts(pkg, options = {}) {
416
432
  )) {
417
433
  issues.push({code: 'invalid_doc_reference', severity: 'error', message});
418
434
  }
435
+
436
+ // One fact has one owner: a passage two topics repeat goes stale in one
437
+ // of them. Each is listed and is a warning (architecture:cli-surface
438
+ // DEC-8), so `integration check --strict` fails until it is fixed;
439
+ // `doctor integration docs` keeps its exit code, as it fails on errors.
440
+ copiedPassages.push(...(await integrationCopiedPassages(discovered)));
441
+ for (const {message} of copiedPassages) {
442
+ issues.push({code: 'copied_passage', severity: 'warning', message});
443
+ }
444
+ // Docs should be dense: padding phrases and mostly-glue topics, listed
445
+ // and warned about the same way (DEC-8).
446
+ fluff.push(...(await integrationFluff(discovered)));
447
+ for (const {message} of fluff) {
448
+ issues.push({code: 'doc_fluff', severity: 'warning', message});
449
+ }
419
450
  }
420
451
 
421
452
  return {
422
453
  type: 'integration.doc-conflicts',
423
- data: {validated, name, version, findings, issues},
454
+ data: {validated, name, version, findings, copiedPassages, fluff, issues},
424
455
  };
425
456
  }