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.
- package/README.md +2 -11
- package/assets/init/.qfai/README.md +2 -7
- package/assets/init/.qfai/promptpack/commands/plan.md +1 -1
- package/assets/init/.qfai/promptpack/commands/review.md +1 -2
- package/assets/init/.qfai/promptpack/constitution.md +1 -1
- package/assets/init/.qfai/prompts/README.md +1 -3
- package/assets/init/.qfai/prompts/qfai-maintain-traceability.md +3 -3
- package/assets/init/.qfai/prompts/require-to-spec.md +1 -2
- package/assets/init/.qfai/specs/README.md +2 -3
- package/assets/init/.qfai/specs/spec-0001/delta.md +0 -5
- package/assets/init/root/qfai.config.yaml +0 -1
- package/dist/cli/index.cjs +13 -55
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +13 -55
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +13 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +13 -54
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/assets/init/.qfai/promptpack/modes/change.md +0 -5
- package/assets/init/.qfai/promptpack/modes/compatibility.md +0 -6
- package/assets/init/.qfai/promptpack/steering/compatibility-vs-change.md +0 -42
- package/assets/init/.qfai/prompts/qfai-classify-change.md +0 -33
- package/assets/init/.qfai/rules/conventions.md +0 -27
- package/assets/init/.qfai/rules/pnpm.md +0 -29
- package/assets/init/.qfai/samples/analyze/analysis.md +0 -38
- package/assets/init/.qfai/samples/analyze/input_bundle.md +0 -54
package/dist/index.cjs
CHANGED
|
@@ -63,7 +63,6 @@ var defaultConfig = {
|
|
|
63
63
|
paths: {
|
|
64
64
|
contractsDir: ".qfai/contracts",
|
|
65
65
|
specsDir: ".qfai/specs",
|
|
66
|
-
rulesDir: ".qfai/rules",
|
|
67
66
|
outDir: ".qfai/out",
|
|
68
67
|
promptsDir: ".qfai/prompts",
|
|
69
68
|
srcDir: "src",
|
|
@@ -176,13 +175,6 @@ function normalizePaths(raw, configPath, issues) {
|
|
|
176
175
|
configPath,
|
|
177
176
|
issues
|
|
178
177
|
),
|
|
179
|
-
rulesDir: readString(
|
|
180
|
-
raw.rulesDir,
|
|
181
|
-
base.rulesDir,
|
|
182
|
-
"paths.rulesDir",
|
|
183
|
-
configPath,
|
|
184
|
-
issues
|
|
185
|
-
),
|
|
186
178
|
outDir: readString(
|
|
187
179
|
raw.outDir,
|
|
188
180
|
base.outDir,
|
|
@@ -1298,8 +1290,8 @@ var import_promises7 = require("fs/promises");
|
|
|
1298
1290
|
var import_node_path8 = __toESM(require("path"), 1);
|
|
1299
1291
|
var import_node_url = require("url");
|
|
1300
1292
|
async function resolveToolVersion() {
|
|
1301
|
-
if ("1.0.
|
|
1302
|
-
return "1.0.
|
|
1293
|
+
if ("1.0.4".length > 0) {
|
|
1294
|
+
return "1.0.4";
|
|
1303
1295
|
}
|
|
1304
1296
|
try {
|
|
1305
1297
|
const packagePath = resolvePackageJsonPath();
|
|
@@ -2048,11 +2040,6 @@ function issue(code, message, severity, file, rule, refs, category = "compatibil
|
|
|
2048
2040
|
// src/core/validators/delta.ts
|
|
2049
2041
|
var import_promises9 = require("fs/promises");
|
|
2050
2042
|
var import_node_path11 = __toESM(require("path"), 1);
|
|
2051
|
-
var SECTION_RE = /^##\s+変更区分/m;
|
|
2052
|
-
var COMPAT_LINE_RE = /^\s*-\s*\[[ xX]\]\s*Compatibility\b/m;
|
|
2053
|
-
var CHANGE_LINE_RE = /^\s*-\s*\[[ xX]\]\s*Change\/Improvement\b/m;
|
|
2054
|
-
var COMPAT_CHECKED_RE = /^\s*-\s*\[[xX]\]\s*Compatibility\b/m;
|
|
2055
|
-
var CHANGE_CHECKED_RE = /^\s*-\s*\[[xX]\]\s*Change\/Improvement\b/m;
|
|
2056
2043
|
async function validateDeltas(root, config) {
|
|
2057
2044
|
const specsRoot = resolvePath(root, config, "specsDir");
|
|
2058
2045
|
const packs = await collectSpecPackDirs(specsRoot);
|
|
@@ -2062,9 +2049,8 @@ async function validateDeltas(root, config) {
|
|
|
2062
2049
|
const issues = [];
|
|
2063
2050
|
for (const pack of packs) {
|
|
2064
2051
|
const deltaPath = import_node_path11.default.join(pack, "delta.md");
|
|
2065
|
-
let text;
|
|
2066
2052
|
try {
|
|
2067
|
-
|
|
2053
|
+
await (0, import_promises9.readFile)(deltaPath, "utf-8");
|
|
2068
2054
|
} catch (error) {
|
|
2069
2055
|
if (isMissingFileError2(error)) {
|
|
2070
2056
|
issues.push(
|
|
@@ -2073,41 +2059,16 @@ async function validateDeltas(root, config) {
|
|
|
2073
2059
|
"delta.md \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002",
|
|
2074
2060
|
"error",
|
|
2075
2061
|
deltaPath,
|
|
2076
|
-
"delta.exists"
|
|
2062
|
+
"delta.exists",
|
|
2063
|
+
void 0,
|
|
2064
|
+
"change",
|
|
2065
|
+
"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"
|
|
2077
2066
|
)
|
|
2078
2067
|
);
|
|
2079
2068
|
continue;
|
|
2080
2069
|
}
|
|
2081
2070
|
throw error;
|
|
2082
2071
|
}
|
|
2083
|
-
const hasSection = SECTION_RE.test(text);
|
|
2084
|
-
const hasCompatibility = COMPAT_LINE_RE.test(text);
|
|
2085
|
-
const hasChange = CHANGE_LINE_RE.test(text);
|
|
2086
|
-
if (!hasSection || !hasCompatibility || !hasChange) {
|
|
2087
|
-
issues.push(
|
|
2088
|
-
issue2(
|
|
2089
|
-
"QFAI-DELTA-002",
|
|
2090
|
-
"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",
|
|
2091
|
-
"error",
|
|
2092
|
-
deltaPath,
|
|
2093
|
-
"delta.section"
|
|
2094
|
-
)
|
|
2095
|
-
);
|
|
2096
|
-
continue;
|
|
2097
|
-
}
|
|
2098
|
-
const compatibilityChecked = COMPAT_CHECKED_RE.test(text);
|
|
2099
|
-
const changeChecked = CHANGE_CHECKED_RE.test(text);
|
|
2100
|
-
if (compatibilityChecked === changeChecked) {
|
|
2101
|
-
issues.push(
|
|
2102
|
-
issue2(
|
|
2103
|
-
"QFAI-DELTA-003",
|
|
2104
|
-
"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",
|
|
2105
|
-
"error",
|
|
2106
|
-
deltaPath,
|
|
2107
|
-
"delta.classification"
|
|
2108
|
-
)
|
|
2109
|
-
);
|
|
2110
|
-
}
|
|
2111
2072
|
}
|
|
2112
2073
|
return issues;
|
|
2113
2074
|
}
|
|
@@ -2264,6 +2225,7 @@ function getInitAssetsDir() {
|
|
|
2264
2225
|
}
|
|
2265
2226
|
|
|
2266
2227
|
// src/core/promptsIntegrity.ts
|
|
2228
|
+
var LEGACY_OK_EXTRA = /* @__PURE__ */ new Set(["qfai-classify-change.md"]);
|
|
2267
2229
|
async function diffProjectPromptsAgainstInitAssets(root) {
|
|
2268
2230
|
const promptsDir = import_node_path14.default.resolve(root, ".qfai", "prompts");
|
|
2269
2231
|
let templateDir;
|
|
@@ -2312,6 +2274,7 @@ async function diffProjectPromptsAgainstInitAssets(root) {
|
|
|
2312
2274
|
extra.push(rel);
|
|
2313
2275
|
}
|
|
2314
2276
|
}
|
|
2277
|
+
const filteredExtra = extra.filter((rel) => !LEGACY_OK_EXTRA.has(rel));
|
|
2315
2278
|
const common = intersectKeys(templateByRel, projectByRel);
|
|
2316
2279
|
for (const rel of common) {
|
|
2317
2280
|
const templateAbs = templateByRel.get(rel);
|
|
@@ -2331,13 +2294,13 @@ async function diffProjectPromptsAgainstInitAssets(root) {
|
|
|
2331
2294
|
changed.push(rel);
|
|
2332
2295
|
}
|
|
2333
2296
|
}
|
|
2334
|
-
const status = missing.length > 0 ||
|
|
2297
|
+
const status = missing.length > 0 || filteredExtra.length > 0 || changed.length > 0 ? "modified" : "ok";
|
|
2335
2298
|
return {
|
|
2336
2299
|
status,
|
|
2337
2300
|
promptsDir,
|
|
2338
2301
|
templateDir,
|
|
2339
2302
|
missing: missing.sort(),
|
|
2340
|
-
extra:
|
|
2303
|
+
extra: filteredExtra.sort(),
|
|
2341
2304
|
changed: changed.sort()
|
|
2342
2305
|
};
|
|
2343
2306
|
}
|
|
@@ -3774,12 +3737,8 @@ function formatReportMarkdown(data, options = {}) {
|
|
|
3774
3737
|
"- 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"
|
|
3775
3738
|
);
|
|
3776
3739
|
}
|
|
3777
|
-
lines.push(
|
|
3778
|
-
|
|
3779
|
-
);
|
|
3780
|
-
lines.push(
|
|
3781
|
-
"- \u53C2\u7167\u30EB\u30FC\u30EB\u306E\u6B63\u672C: `.qfai/promptpack/steering/traceability.md` / `.qfai/promptpack/steering/compatibility-vs-change.md`"
|
|
3782
|
-
);
|
|
3740
|
+
lines.push("- \u5909\u66F4\u5185\u5BB9\u30FB\u53D7\u5165\u89B3\u70B9\u306F `.qfai/specs/*/delta.md` \u306B\u8A18\u9332\u3057\u307E\u3059\u3002");
|
|
3741
|
+
lines.push("- \u53C2\u7167\u30EB\u30FC\u30EB\u306E\u6B63\u672C: `.qfai/promptpack/steering/traceability.md`");
|
|
3783
3742
|
return lines.join("\n");
|
|
3784
3743
|
}
|
|
3785
3744
|
function formatReportJson(data) {
|