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.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,6 @@ var defaultConfig = {
|
|
|
6
6
|
paths: {
|
|
7
7
|
contractsDir: ".qfai/contracts",
|
|
8
8
|
specsDir: ".qfai/specs",
|
|
9
|
-
rulesDir: ".qfai/rules",
|
|
10
9
|
outDir: ".qfai/out",
|
|
11
10
|
promptsDir: ".qfai/prompts",
|
|
12
11
|
srcDir: "src",
|
|
@@ -119,13 +118,6 @@ function normalizePaths(raw, configPath, issues) {
|
|
|
119
118
|
configPath,
|
|
120
119
|
issues
|
|
121
120
|
),
|
|
122
|
-
rulesDir: readString(
|
|
123
|
-
raw.rulesDir,
|
|
124
|
-
base.rulesDir,
|
|
125
|
-
"paths.rulesDir",
|
|
126
|
-
configPath,
|
|
127
|
-
issues
|
|
128
|
-
),
|
|
129
121
|
outDir: readString(
|
|
130
122
|
raw.outDir,
|
|
131
123
|
base.outDir,
|
|
@@ -1245,8 +1237,8 @@ import { readFile as readFile4 } from "fs/promises";
|
|
|
1245
1237
|
import path8 from "path";
|
|
1246
1238
|
import { fileURLToPath } from "url";
|
|
1247
1239
|
async function resolveToolVersion() {
|
|
1248
|
-
if ("1.0.
|
|
1249
|
-
return "1.0.
|
|
1240
|
+
if ("1.0.4".length > 0) {
|
|
1241
|
+
return "1.0.4";
|
|
1250
1242
|
}
|
|
1251
1243
|
try {
|
|
1252
1244
|
const packagePath = resolvePackageJsonPath();
|
|
@@ -1995,11 +1987,6 @@ function issue(code, message, severity, file, rule, refs, category = "compatibil
|
|
|
1995
1987
|
// src/core/validators/delta.ts
|
|
1996
1988
|
import { readFile as readFile6 } from "fs/promises";
|
|
1997
1989
|
import path11 from "path";
|
|
1998
|
-
var SECTION_RE = /^##\s+変更区分/m;
|
|
1999
|
-
var COMPAT_LINE_RE = /^\s*-\s*\[[ xX]\]\s*Compatibility\b/m;
|
|
2000
|
-
var CHANGE_LINE_RE = /^\s*-\s*\[[ xX]\]\s*Change\/Improvement\b/m;
|
|
2001
|
-
var COMPAT_CHECKED_RE = /^\s*-\s*\[[xX]\]\s*Compatibility\b/m;
|
|
2002
|
-
var CHANGE_CHECKED_RE = /^\s*-\s*\[[xX]\]\s*Change\/Improvement\b/m;
|
|
2003
1990
|
async function validateDeltas(root, config) {
|
|
2004
1991
|
const specsRoot = resolvePath(root, config, "specsDir");
|
|
2005
1992
|
const packs = await collectSpecPackDirs(specsRoot);
|
|
@@ -2009,9 +1996,8 @@ async function validateDeltas(root, config) {
|
|
|
2009
1996
|
const issues = [];
|
|
2010
1997
|
for (const pack of packs) {
|
|
2011
1998
|
const deltaPath = path11.join(pack, "delta.md");
|
|
2012
|
-
let text;
|
|
2013
1999
|
try {
|
|
2014
|
-
|
|
2000
|
+
await readFile6(deltaPath, "utf-8");
|
|
2015
2001
|
} catch (error) {
|
|
2016
2002
|
if (isMissingFileError2(error)) {
|
|
2017
2003
|
issues.push(
|
|
@@ -2020,41 +2006,16 @@ async function validateDeltas(root, config) {
|
|
|
2020
2006
|
"delta.md \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002",
|
|
2021
2007
|
"error",
|
|
2022
2008
|
deltaPath,
|
|
2023
|
-
"delta.exists"
|
|
2009
|
+
"delta.exists",
|
|
2010
|
+
void 0,
|
|
2011
|
+
"change",
|
|
2012
|
+
"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"
|
|
2024
2013
|
)
|
|
2025
2014
|
);
|
|
2026
2015
|
continue;
|
|
2027
2016
|
}
|
|
2028
2017
|
throw error;
|
|
2029
2018
|
}
|
|
2030
|
-
const hasSection = SECTION_RE.test(text);
|
|
2031
|
-
const hasCompatibility = COMPAT_LINE_RE.test(text);
|
|
2032
|
-
const hasChange = CHANGE_LINE_RE.test(text);
|
|
2033
|
-
if (!hasSection || !hasCompatibility || !hasChange) {
|
|
2034
|
-
issues.push(
|
|
2035
|
-
issue2(
|
|
2036
|
-
"QFAI-DELTA-002",
|
|
2037
|
-
"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",
|
|
2038
|
-
"error",
|
|
2039
|
-
deltaPath,
|
|
2040
|
-
"delta.section"
|
|
2041
|
-
)
|
|
2042
|
-
);
|
|
2043
|
-
continue;
|
|
2044
|
-
}
|
|
2045
|
-
const compatibilityChecked = COMPAT_CHECKED_RE.test(text);
|
|
2046
|
-
const changeChecked = CHANGE_CHECKED_RE.test(text);
|
|
2047
|
-
if (compatibilityChecked === changeChecked) {
|
|
2048
|
-
issues.push(
|
|
2049
|
-
issue2(
|
|
2050
|
-
"QFAI-DELTA-003",
|
|
2051
|
-
"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",
|
|
2052
|
-
"error",
|
|
2053
|
-
deltaPath,
|
|
2054
|
-
"delta.classification"
|
|
2055
|
-
)
|
|
2056
|
-
);
|
|
2057
|
-
}
|
|
2058
2019
|
}
|
|
2059
2020
|
return issues;
|
|
2060
2021
|
}
|
|
@@ -2211,6 +2172,7 @@ function getInitAssetsDir() {
|
|
|
2211
2172
|
}
|
|
2212
2173
|
|
|
2213
2174
|
// src/core/promptsIntegrity.ts
|
|
2175
|
+
var LEGACY_OK_EXTRA = /* @__PURE__ */ new Set(["qfai-classify-change.md"]);
|
|
2214
2176
|
async function diffProjectPromptsAgainstInitAssets(root) {
|
|
2215
2177
|
const promptsDir = path14.resolve(root, ".qfai", "prompts");
|
|
2216
2178
|
let templateDir;
|
|
@@ -2259,6 +2221,7 @@ async function diffProjectPromptsAgainstInitAssets(root) {
|
|
|
2259
2221
|
extra.push(rel);
|
|
2260
2222
|
}
|
|
2261
2223
|
}
|
|
2224
|
+
const filteredExtra = extra.filter((rel) => !LEGACY_OK_EXTRA.has(rel));
|
|
2262
2225
|
const common = intersectKeys(templateByRel, projectByRel);
|
|
2263
2226
|
for (const rel of common) {
|
|
2264
2227
|
const templateAbs = templateByRel.get(rel);
|
|
@@ -2278,13 +2241,13 @@ async function diffProjectPromptsAgainstInitAssets(root) {
|
|
|
2278
2241
|
changed.push(rel);
|
|
2279
2242
|
}
|
|
2280
2243
|
}
|
|
2281
|
-
const status = missing.length > 0 ||
|
|
2244
|
+
const status = missing.length > 0 || filteredExtra.length > 0 || changed.length > 0 ? "modified" : "ok";
|
|
2282
2245
|
return {
|
|
2283
2246
|
status,
|
|
2284
2247
|
promptsDir,
|
|
2285
2248
|
templateDir,
|
|
2286
2249
|
missing: missing.sort(),
|
|
2287
|
-
extra:
|
|
2250
|
+
extra: filteredExtra.sort(),
|
|
2288
2251
|
changed: changed.sort()
|
|
2289
2252
|
};
|
|
2290
2253
|
}
|
|
@@ -3721,12 +3684,8 @@ function formatReportMarkdown(data, options = {}) {
|
|
|
3721
3684
|
"- 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"
|
|
3722
3685
|
);
|
|
3723
3686
|
}
|
|
3724
|
-
lines.push(
|
|
3725
|
-
|
|
3726
|
-
);
|
|
3727
|
-
lines.push(
|
|
3728
|
-
"- \u53C2\u7167\u30EB\u30FC\u30EB\u306E\u6B63\u672C: `.qfai/promptpack/steering/traceability.md` / `.qfai/promptpack/steering/compatibility-vs-change.md`"
|
|
3729
|
-
);
|
|
3687
|
+
lines.push("- \u5909\u66F4\u5185\u5BB9\u30FB\u53D7\u5165\u89B3\u70B9\u306F `.qfai/specs/*/delta.md` \u306B\u8A18\u9332\u3057\u307E\u3059\u3002");
|
|
3688
|
+
lines.push("- \u53C2\u7167\u30EB\u30FC\u30EB\u306E\u6B63\u672C: `.qfai/promptpack/steering/traceability.md`");
|
|
3730
3689
|
return lines.join("\n");
|
|
3731
3690
|
}
|
|
3732
3691
|
function formatReportJson(data) {
|