@agentskit/doc-bridge 1.9.0 → 1.10.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 97851d0: Let a repository say which directories are not areas.
8
+
9
+ An area is the unit of architecture between a package and a file, derived as the first directory
10
+ level under a package's source roots. In a monorepo where every package keeps `tests/` and
11
+ `fixtures/` beside `src/`, that derives one area per directory — and the doctor's connectivity
12
+ dimension then asks for a document about a folder of test data. Dogfooding on a 26-package
13
+ monorepo, 43 of its 81 undocumented areas were `tests/` or `fixtures/`: the metric was mostly
14
+ measuring directories no documentation should describe.
15
+
16
+ `analysis.areas.exclude` takes glob patterns for directories that hold code without being a unit
17
+ of architecture. A matching candidate is not derived, and its modules fall to the most specific
18
+ area that still encloses them — or to none, which is the honest answer for a folder of fixtures.
19
+ An ownership record naming an excluded path still makes it an area: a person saying a directory is
20
+ a unit outranks a pattern saying it is not.
21
+
22
+ On that monorepo, excluding `**/tests`, `**/fixtures`, `**/__tests__` and `**/__fixtures__` took
23
+ areas from 103 to 53 and the documented share from 21% to 34%, before a single document was
24
+ written.
25
+
3
26
  ## 1.9.0
4
27
 
5
28
  ### Minor Changes
package/action.yml CHANGED
@@ -20,7 +20,7 @@ inputs:
20
20
  package-version:
21
21
  description: Exact @agentskit/doc-bridge npm version (kept in sync with this Action release)
22
22
  required: false
23
- default: '1.9.0'
23
+ default: '1.10.0'
24
24
 
25
25
  runs:
26
26
  using: composite
@@ -525,11 +525,20 @@ var AnalysisConfigSchema = z.object({
525
525
  /**
526
526
  * How code areas are derived — the unit of architecture between a package and a file.
527
527
  * `roots` names directories that contain areas rather than being one (`src` holds
528
- * `src/query`); `depth` is how many levels below such a root an area sits.
528
+ * `src/query`); `depth` is how many levels below such a root an area sits; `exclude`
529
+ * names directories that hold code without being a unit of architecture.
529
530
  */
530
531
  areas: z.object({
531
532
  depth: z.number().int().min(1).max(8).optional(),
532
- roots: z.array(z.string().min(1).max(128)).max(32).optional()
533
+ roots: z.array(z.string().min(1).max(128)).max(32).optional(),
534
+ /**
535
+ * Glob patterns for directories that are not areas. A monorepo where every package
536
+ * keeps `tests/` and `fixtures/` beside `src/` derives one area per directory, and
537
+ * then connectivity asks for a document about a folder of test data. An ownership
538
+ * record naming an excluded path still makes it an area: a person saying a directory
539
+ * is a unit outranks a pattern saying it is not.
540
+ */
541
+ exclude: z.array(z.string().min(1).max(256)).max(64).optional()
533
542
  }).strict().optional()
534
543
  }).strict();
535
544
  var WorkflowConfigSchema = z.object({
@@ -2081,6 +2090,9 @@ var areaSuggestionCoverage = (snapshot, options = {}) => {
2081
2090
  }));
2082
2091
  };
2083
2092
 
2093
+ // src/discovery/areas.ts
2094
+ import { minimatch as minimatch2 } from "minimatch";
2095
+
2084
2096
  // src/discovery/identity.ts
2085
2097
  var MAX_ID_LENGTH = 256;
2086
2098
  var ID_HASH_LENGTH = 32;
@@ -2129,10 +2141,12 @@ var deriveAreas = (options) => {
2129
2141
  const depth = options.depth ?? DEFAULT_AREA_DEPTH;
2130
2142
  const roots = options.roots ?? [...DEFAULT_AREA_ROOTS];
2131
2143
  const ownership = (options.ownership ?? []).map((record) => ({ ...record, path: normalize(record.path) }));
2144
+ const excluded = options.exclude ?? [];
2145
+ const isExcluded2 = (path) => excluded.some((pattern) => minimatch2(path, pattern, { dot: true }));
2132
2146
  const candidates = /* @__PURE__ */ new Map();
2133
2147
  for (const module of options.modules) {
2134
2148
  const path = conventionalAreaPath(module, depth, roots);
2135
- if (path && !candidates.has(path)) candidates.set(path, module.packageId);
2149
+ if (path && !candidates.has(path) && !isExcluded2(path)) candidates.set(path, module.packageId);
2136
2150
  }
2137
2151
  for (const record of ownership) {
2138
2152
  if (!record.path || candidates.has(record.path)) continue;
@@ -3230,7 +3244,8 @@ var discoverRepository = (opts = {}) => {
3230
3244
  modules: areaModules,
3231
3245
  ownership: Object.entries(opts.config?.routing?.options?.ownership ?? {}).map(([id, record]) => ({ id, path: record.path })),
3232
3246
  ...opts.config?.analysis?.areas?.depth !== void 0 ? { depth: opts.config.analysis.areas.depth } : {},
3233
- ...opts.config?.analysis?.areas?.roots !== void 0 ? { roots: opts.config.analysis.areas.roots } : {}
3247
+ ...opts.config?.analysis?.areas?.roots !== void 0 ? { roots: opts.config.analysis.areas.roots } : {},
3248
+ ...opts.config?.analysis?.areas?.exclude !== void 0 ? { exclude: opts.config.analysis.areas.exclude } : {}
3234
3249
  });
3235
3250
  const areasById = new Map(areas.map((area) => [area.id, area]));
3236
3251
  const areasByPath = new Map(areas.map((area) => [area.path, area.id]));
@@ -3614,7 +3629,7 @@ var RetrievalIndexV1Schema = z5.object({
3614
3629
  }).strict();
3615
3630
 
3616
3631
  // src/index-builder/scan-corpus.ts
3617
- import { minimatch as minimatch2 } from "minimatch";
3632
+ import { minimatch as minimatch3 } from "minimatch";
3618
3633
 
3619
3634
  // src/lib/markdown.ts
3620
3635
  var parseFrontmatter = (markdown) => {
@@ -3765,8 +3780,8 @@ var configuredPathMatches = (relPath, include, exclude) => {
3765
3780
  const normalize3 = (pattern) => toPosix(pattern).replace(/^\.\//, "");
3766
3781
  const included = include?.filter(Boolean).map(normalize3) ?? [];
3767
3782
  const excluded = exclude?.filter(Boolean).map(normalize3) ?? [];
3768
- if (excluded.some((pattern) => minimatch2(relPath, pattern, { dot: true }))) return false;
3769
- return included.length === 0 || included.some((pattern) => minimatch2(relPath, pattern, { dot: true }));
3783
+ if (excluded.some((pattern) => minimatch3(relPath, pattern, { dot: true }))) return false;
3784
+ return included.length === 0 || included.some((pattern) => minimatch3(relPath, pattern, { dot: true }));
3770
3785
  };
3771
3786
  var scanAgentCorpus = (root, config) => {
3772
3787
  const agentRoot = containedProjectPath(root, config.corpus.agent.root);
@@ -4040,7 +4055,7 @@ var buildLookup = (config, packages, corpus, indexOutFile, humanDocs = {}, root
4040
4055
  };
4041
4056
 
4042
4057
  // src/version.ts
4043
- var PACKAGE_VERSION = "1.9.0";
4058
+ var PACKAGE_VERSION = "1.10.0";
4044
4059
 
4045
4060
  // src/index-builder/capabilities.ts
4046
4061
  var renderCapabilitiesJson = (config, index, paths) => {
@@ -4945,14 +4960,14 @@ var nextraAdapter = {
4945
4960
  };
4946
4961
 
4947
4962
  // src/index-builder/human-adapters/plain-markdown.ts
4948
- import { minimatch as minimatch3 } from "minimatch";
4963
+ import { minimatch as minimatch4 } from "minimatch";
4949
4964
  var stringPatterns = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : [];
4950
4965
  var matchesConfiguredPath = (relPath, options) => {
4951
4966
  const normalize3 = (pattern) => pattern.replaceAll("\\", "/").replace(/^\.\//, "");
4952
4967
  const include = stringPatterns(options?.include).map(normalize3);
4953
4968
  const exclude = stringPatterns(options?.exclude).map(normalize3);
4954
- if (exclude.some((pattern) => minimatch3(relPath, pattern, { dot: true }))) return false;
4955
- return include.length === 0 || include.some((pattern) => minimatch3(relPath, pattern, { dot: true }));
4969
+ if (exclude.some((pattern) => minimatch4(relPath, pattern, { dot: true }))) return false;
4970
+ return include.length === 0 || include.some((pattern) => minimatch4(relPath, pattern, { dot: true }));
4956
4971
  };
4957
4972
  var plainMarkdownAdapter = {
4958
4973
  plugin: "plain-markdown",
@@ -4990,7 +5005,7 @@ var starlightAdapter = {
4990
5005
  };
4991
5006
 
4992
5007
  // src/index-builder/human-adapters/vitepress.ts
4993
- import { minimatch as minimatch4 } from "minimatch";
5008
+ import { minimatch as minimatch5 } from "minimatch";
4994
5009
  var isVitePressPage = (relPath) => !relPath.split("/").some((part) => part === ".vitepress" || part.startsWith("."));
4995
5010
  var srcExcludePatterns = (value) => {
4996
5011
  if (value === void 0) return [];
@@ -5004,7 +5019,7 @@ var srcExcludePatterns = (value) => {
5004
5019
  return pattern;
5005
5020
  });
5006
5021
  };
5007
- var isExcluded = (relPath, patterns) => patterns.some((pattern) => minimatch4(relPath, pattern, { dot: true }));
5022
+ var isExcluded = (relPath, patterns) => patterns.some((pattern) => minimatch5(relPath, pattern, { dot: true }));
5008
5023
  var vitepressSlug = (relPath, cleanUrls) => {
5009
5024
  const slug2 = routeSlug(relPath);
5010
5025
  if (cleanUrls || /(?:^|\/)index\.mdx?$/.test(relPath)) return slug2;
@@ -8189,7 +8204,7 @@ var resolveGateIds = (config) => {
8189
8204
  };
8190
8205
 
8191
8206
  // src/rules/engine.ts
8192
- import { minimatch as minimatch5 } from "minimatch";
8207
+ import { minimatch as minimatch6 } from "minimatch";
8193
8208
  var diagnosticRules = {
8194
8209
  DOCUMENTATION_QUALITY: "documentation-quality",
8195
8210
  RELATION_UNDOCUMENTED: "graph-undocumented-relation",
@@ -8263,7 +8278,7 @@ var evaluateRules = (report, options = {}) => {
8263
8278
  findings.push(criticalFinding(finding, criticalSeverity, matchingEntity));
8264
8279
  }
8265
8280
  for (const path of resolved.criticalPaths) {
8266
- if (finding.evidence.some((item) => minimatch5(item.path, path, { dot: true })) && !resolved.ignore.has("critical-path-risk") && criticalSeverity !== "off") {
8281
+ if (finding.evidence.some((item) => minimatch6(item.path, path, { dot: true })) && !resolved.ignore.has("critical-path-risk") && criticalSeverity !== "off") {
8267
8282
  findings.push(criticalFinding(finding, criticalSeverity, path));
8268
8283
  }
8269
8284
  }
@@ -13982,7 +13997,7 @@ var formatBenchmarkText = (result) => [
13982
13997
  // src/audit/documentation.ts
13983
13998
  import { readFileSync as readFileSync28 } from "fs";
13984
13999
  import { resolve as resolve25 } from "path";
13985
- import { minimatch as minimatch6 } from "minimatch";
14000
+ import { minimatch as minimatch7 } from "minimatch";
13986
14001
 
13987
14002
  // src/render/data.ts
13988
14003
  var MAX_SYMBOLS2 = 12;
@@ -14313,7 +14328,7 @@ var bodyForDuplicate = (content) => {
14313
14328
  const start = lines[0] === "---" ? lines.findIndex((line, index) => index > 0 && line === "---") + 1 : 0;
14314
14329
  return lines.slice(start).join("\n").replace(/\s+/g, " ").trim().toLocaleLowerCase();
14315
14330
  };
14316
- var matches = (path, patterns) => patterns.some((pattern) => minimatch6(path, pattern, { dot: true }));
14331
+ var matches = (path, patterns) => patterns.some((pattern) => minimatch7(path, pattern, { dot: true }));
14317
14332
  var rate2 = (count4, total) => total ? count4 / total : null;
14318
14333
  var metadataPresent = (content, key) => {
14319
14334
  const value = parseFrontmatter(content).data[key];