specdx 0.3.0-alpha.1 → 0.3.0-alpha.2

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.
@@ -2,7 +2,7 @@ import {
2
2
  DEFAULT_DIFF_CONFIG,
3
3
  DiffError,
4
4
  diffBetweenRefs
5
- } from "./chunk-AO3ZQKLJ.js";
5
+ } from "./chunk-LU6M5O63.js";
6
6
  import {
7
7
  loadConfig
8
8
  } from "./chunk-276J7LR6.js";
@@ -97,4 +97,4 @@ export {
97
97
  diff_default as default,
98
98
  runDiff
99
99
  };
100
- //# sourceMappingURL=diff-GWJONALU.js.map
100
+ //# sourceMappingURL=diff-55PTEVB3.js.map
package/dist/index.js CHANGED
@@ -864,6 +864,8 @@ function getPreset(name) {
864
864
  return allBuiltinRules;
865
865
  case "strict":
866
866
  return allBuiltinRules.map((rule) => ({ ...rule, severity: "error" }));
867
+ default:
868
+ throw new Error(`Unknown preset: "${name}". Use "minimal", "recommended", or "strict", or resolve external presets via resolvePreset() from @specdx/core.`);
867
869
  }
868
870
  }
869
871
 
@@ -2514,7 +2516,7 @@ function diffSections(before, after) {
2514
2516
  for (const section of after) {
2515
2517
  afterMap.set(section.heading, section);
2516
2518
  }
2517
- for (const [heading, _section] of beforeMap) {
2519
+ for (const [heading] of beforeMap) {
2518
2520
  if (!afterMap.has(heading)) {
2519
2521
  changes.push({ heading, type: "removed" });
2520
2522
  }
@@ -2594,7 +2596,7 @@ function analyzeImpact(changedSpecId, diff2, graph, allSpecs, thresholdDays = 14
2594
2596
  const spec = specById.get(specId);
2595
2597
  const lastUpdated = spec?.frontmatter.updated ?? spec?.frontmatter.created ?? null;
2596
2598
  const filePath = spec?.filePath ?? `specs/${specId}.md`;
2597
- let staleness = 0;
2599
+ let staleness;
2598
2600
  if (lastUpdated) {
2599
2601
  const daysSinceUpdate = daysBetween(lastUpdated);
2600
2602
  staleness = clamp(0, 1, daysSinceUpdate / thresholdDays * 0.5 + structuralSectionsChanged / totalSections * 0.3 + 1 / distance * 0.2);