qfai 1.0.3 → 1.0.4

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.
@@ -222,7 +222,6 @@ var defaultConfig = {
222
222
  paths: {
223
223
  contractsDir: ".qfai/contracts",
224
224
  specsDir: ".qfai/specs",
225
- rulesDir: ".qfai/rules",
226
225
  outDir: ".qfai/out",
227
226
  promptsDir: ".qfai/prompts",
228
227
  srcDir: "src",
@@ -335,13 +334,6 @@ function normalizePaths(raw, configPath, issues) {
335
334
  configPath,
336
335
  issues
337
336
  ),
338
- rulesDir: readString(
339
- raw.rulesDir,
340
- base.rulesDir,
341
- "paths.rulesDir",
342
- configPath,
343
- issues
344
- ),
345
337
  outDir: readString(
346
338
  raw.outDir,
347
339
  base.outDir,
@@ -1055,6 +1047,7 @@ function getInitAssetsDir() {
1055
1047
  }
1056
1048
 
1057
1049
  // src/core/promptsIntegrity.ts
1050
+ var LEGACY_OK_EXTRA = /* @__PURE__ */ new Set(["qfai-classify-change.md"]);
1058
1051
  async function diffProjectPromptsAgainstInitAssets(root) {
1059
1052
  const promptsDir = path9.resolve(root, ".qfai", "prompts");
1060
1053
  let templateDir;
@@ -1103,6 +1096,7 @@ async function diffProjectPromptsAgainstInitAssets(root) {
1103
1096
  extra.push(rel);
1104
1097
  }
1105
1098
  }
1099
+ const filteredExtra = extra.filter((rel) => !LEGACY_OK_EXTRA.has(rel));
1106
1100
  const common = intersectKeys(templateByRel, projectByRel);
1107
1101
  for (const rel of common) {
1108
1102
  const templateAbs = templateByRel.get(rel);
@@ -1122,13 +1116,13 @@ async function diffProjectPromptsAgainstInitAssets(root) {
1122
1116
  changed.push(rel);
1123
1117
  }
1124
1118
  }
1125
- const status = missing.length > 0 || extra.length > 0 || changed.length > 0 ? "modified" : "ok";
1119
+ const status = missing.length > 0 || filteredExtra.length > 0 || changed.length > 0 ? "modified" : "ok";
1126
1120
  return {
1127
1121
  status,
1128
1122
  promptsDir,
1129
1123
  templateDir,
1130
1124
  missing: missing.sort(),
1131
- extra: extra.sort(),
1125
+ extra: filteredExtra.sort(),
1132
1126
  changed: changed.sort()
1133
1127
  };
1134
1128
  }
@@ -1154,8 +1148,8 @@ import { readFile as readFile5 } from "fs/promises";
1154
1148
  import path10 from "path";
1155
1149
  import { fileURLToPath as fileURLToPath2 } from "url";
1156
1150
  async function resolveToolVersion() {
1157
- if ("1.0.3".length > 0) {
1158
- return "1.0.3";
1151
+ if ("1.0.4".length > 0) {
1152
+ return "1.0.4";
1159
1153
  }
1160
1154
  try {
1161
1155
  const packagePath = resolvePackageJsonPath();
@@ -1245,7 +1239,6 @@ async function createDoctorData(options) {
1245
1239
  "outDir",
1246
1240
  "srcDir",
1247
1241
  "testsDir",
1248
- "rulesDir",
1249
1242
  "promptsDir"
1250
1243
  ];
1251
1244
  for (const key of pathKeys) {
@@ -2817,11 +2810,6 @@ function issue(code, message, severity, file, rule, refs, category = "compatibil
2817
2810
  // src/core/validators/delta.ts
2818
2811
  import { readFile as readFile8 } from "fs/promises";
2819
2812
  import path18 from "path";
2820
- var SECTION_RE = /^##\s+変更区分/m;
2821
- var COMPAT_LINE_RE = /^\s*-\s*\[[ xX]\]\s*Compatibility\b/m;
2822
- var CHANGE_LINE_RE = /^\s*-\s*\[[ xX]\]\s*Change\/Improvement\b/m;
2823
- var COMPAT_CHECKED_RE = /^\s*-\s*\[[xX]\]\s*Compatibility\b/m;
2824
- var CHANGE_CHECKED_RE = /^\s*-\s*\[[xX]\]\s*Change\/Improvement\b/m;
2825
2813
  async function validateDeltas(root, config) {
2826
2814
  const specsRoot = resolvePath(root, config, "specsDir");
2827
2815
  const packs = await collectSpecPackDirs(specsRoot);
@@ -2831,9 +2819,8 @@ async function validateDeltas(root, config) {
2831
2819
  const issues = [];
2832
2820
  for (const pack of packs) {
2833
2821
  const deltaPath = path18.join(pack, "delta.md");
2834
- let text;
2835
2822
  try {
2836
- text = await readFile8(deltaPath, "utf-8");
2823
+ await readFile8(deltaPath, "utf-8");
2837
2824
  } catch (error2) {
2838
2825
  if (isMissingFileError2(error2)) {
2839
2826
  issues.push(
@@ -2842,41 +2829,16 @@ async function validateDeltas(root, config) {
2842
2829
  "delta.md \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002",
2843
2830
  "error",
2844
2831
  deltaPath,
2845
- "delta.exists"
2832
+ "delta.exists",
2833
+ void 0,
2834
+ "change",
2835
+ "spec-xxxx/delta.md \u3092\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30C6\u30F3\u30D7\u30EC\u306F init \u751F\u6210\u7269\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002"
2846
2836
  )
2847
2837
  );
2848
2838
  continue;
2849
2839
  }
2850
2840
  throw error2;
2851
2841
  }
2852
- const hasSection = SECTION_RE.test(text);
2853
- const hasCompatibility = COMPAT_LINE_RE.test(text);
2854
- const hasChange = CHANGE_LINE_RE.test(text);
2855
- if (!hasSection || !hasCompatibility || !hasChange) {
2856
- issues.push(
2857
- issue2(
2858
- "QFAI-DELTA-002",
2859
- "delta.md \u306E\u5909\u66F4\u533A\u5206\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059\u3002`## \u5909\u66F4\u533A\u5206` \u3068\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9\uFF08Compatibility / Change/Improvement\uFF09\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2860
- "error",
2861
- deltaPath,
2862
- "delta.section"
2863
- )
2864
- );
2865
- continue;
2866
- }
2867
- const compatibilityChecked = COMPAT_CHECKED_RE.test(text);
2868
- const changeChecked = CHANGE_CHECKED_RE.test(text);
2869
- if (compatibilityChecked === changeChecked) {
2870
- issues.push(
2871
- issue2(
2872
- "QFAI-DELTA-003",
2873
- "delta.md \u306E\u5909\u66F4\u533A\u5206\u306F\u3069\u3061\u3089\u304B1\u3064\u3060\u3051\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4E21\u65B9ON/\u4E21\u65B9OFF\u306F\u7121\u52B9\u3067\u3059\uFF09\u3002",
2874
- "error",
2875
- deltaPath,
2876
- "delta.classification"
2877
- )
2878
- );
2879
- }
2880
2842
  }
2881
2843
  return issues;
2882
2844
  }
@@ -4418,12 +4380,8 @@ function formatReportMarkdown(data, options = {}) {
4418
4380
  "- issue \u306F\u691C\u51FA\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u904B\u7528\u30C6\u30F3\u30D7\u30EC\u306B\u6CBF\u3063\u3066\u7D99\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
4419
4381
  );
4420
4382
  }
4421
- lines.push(
4422
- "- \u5909\u66F4\u533A\u5206\uFF08Compatibility / Change/Improvement\uFF09\u306F `.qfai/specs/*/delta.md` \u306B\u8A18\u9332\u3057\u307E\u3059\u3002"
4423
- );
4424
- lines.push(
4425
- "- \u53C2\u7167\u30EB\u30FC\u30EB\u306E\u6B63\u672C: `.qfai/promptpack/steering/traceability.md` / `.qfai/promptpack/steering/compatibility-vs-change.md`"
4426
- );
4383
+ lines.push("- \u5909\u66F4\u5185\u5BB9\u30FB\u53D7\u5165\u89B3\u70B9\u306F `.qfai/specs/*/delta.md` \u306B\u8A18\u9332\u3057\u307E\u3059\u3002");
4384
+ lines.push("- \u53C2\u7167\u30EB\u30FC\u30EB\u306E\u6B63\u672C: `.qfai/promptpack/steering/traceability.md`");
4427
4385
  return lines.join("\n");
4428
4386
  }
4429
4387
  function formatReportJson(data) {