guardian-framework 0.1.133 → 0.1.134
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/dist/cli.js +33 -15
- package/dist/exports.js +33 -15
- package/package.json +5 -14
- package/templates/pi/extensions/domain-explorer.ts +82 -16
- package/templates/pi/preflight_report.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3078,7 +3078,11 @@ function categorizeFile(relativePath) {
|
|
|
3078
3078
|
"agent/AGENTS.md",
|
|
3079
3079
|
"domain/",
|
|
3080
3080
|
"architecture/CHANGELOG.md",
|
|
3081
|
-
"architecture/implementation-roadmap.md"
|
|
3081
|
+
"architecture/implementation-roadmap.md",
|
|
3082
|
+
"architecture/diagrams/",
|
|
3083
|
+
"architecture/modules/",
|
|
3084
|
+
"architecture/decisions/",
|
|
3085
|
+
"architecture/contracts/"
|
|
3082
3086
|
];
|
|
3083
3087
|
if (userEditable.some((p3) => relativePath.includes(p3))) {
|
|
3084
3088
|
return "user";
|
|
@@ -3202,7 +3206,7 @@ __export(exports_package, {
|
|
|
3202
3206
|
bin: () => bin,
|
|
3203
3207
|
author: () => author
|
|
3204
3208
|
});
|
|
3205
|
-
var name = "guardian-framework", version = "0.1.
|
|
3209
|
+
var name = "guardian-framework", version = "0.1.134", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
|
|
3206
3210
|
var init_package = __esm(() => {
|
|
3207
3211
|
exports = {
|
|
3208
3212
|
".": {
|
|
@@ -3213,10 +3217,7 @@ var init_package = __esm(() => {
|
|
|
3213
3217
|
bin = {
|
|
3214
3218
|
"guardian-framework": "dist/cli.js"
|
|
3215
3219
|
};
|
|
3216
|
-
files = [
|
|
3217
|
-
"dist/",
|
|
3218
|
-
"templates/"
|
|
3219
|
-
];
|
|
3220
|
+
files = ["dist/", "templates/"];
|
|
3220
3221
|
engines = {
|
|
3221
3222
|
bun: ">=1.0.0"
|
|
3222
3223
|
};
|
|
@@ -3234,15 +3235,9 @@ var init_package = __esm(() => {
|
|
|
3234
3235
|
access: "public"
|
|
3235
3236
|
};
|
|
3236
3237
|
pi = {
|
|
3237
|
-
extensions: [
|
|
3238
|
-
|
|
3239
|
-
]
|
|
3240
|
-
skills: [
|
|
3241
|
-
"./templates/pi/skills"
|
|
3242
|
-
],
|
|
3243
|
-
prompts: [
|
|
3244
|
-
"./templates/pi/prompts"
|
|
3245
|
-
]
|
|
3238
|
+
extensions: ["./templates/pi/extensions"],
|
|
3239
|
+
skills: ["./templates/pi/skills"],
|
|
3240
|
+
prompts: ["./templates/pi/prompts"]
|
|
3246
3241
|
};
|
|
3247
3242
|
repository = {
|
|
3248
3243
|
type: "git",
|
|
@@ -11094,6 +11089,12 @@ async function runUpdate(targetDir, options) {
|
|
|
11094
11089
|
outro(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
11095
11090
|
}
|
|
11096
11091
|
}
|
|
11092
|
+
function isUserOwnedPiPath(manifestPath) {
|
|
11093
|
+
const p3 = manifestPath.replace(/^\.pi\//, "").toLowerCase();
|
|
11094
|
+
if (p3.includes("template"))
|
|
11095
|
+
return false;
|
|
11096
|
+
return p3.startsWith("architecture/diagrams/") || p3.startsWith("architecture/modules/") || p3.startsWith("architecture/decisions/") || p3.startsWith("architecture/contracts/") || p3.startsWith("architecture/architecture-overview.md") || p3.startsWith("domain/exploration.md") || p3.startsWith("domain/exploration/") || p3.startsWith("domain/ubiquitous-language.md");
|
|
11097
|
+
}
|
|
11097
11098
|
function analyzeChanges(targetDir, manifest, templateFiles, context, options) {
|
|
11098
11099
|
const changes = [];
|
|
11099
11100
|
const templatePaths = new Set(templateFiles);
|
|
@@ -11101,6 +11102,14 @@ function analyzeChanges(targetDir, manifest, templateFiles, context, options) {
|
|
|
11101
11102
|
if (!filePath.startsWith(".pi/"))
|
|
11102
11103
|
continue;
|
|
11103
11104
|
const fullPath = path9.join(targetDir, filePath);
|
|
11105
|
+
if (isUserOwnedPiPath(filePath)) {
|
|
11106
|
+
changes.push({
|
|
11107
|
+
path: filePath,
|
|
11108
|
+
action: "preserve",
|
|
11109
|
+
reason: "Project-owned architecture content \u2014 never overwritten by update"
|
|
11110
|
+
});
|
|
11111
|
+
continue;
|
|
11112
|
+
}
|
|
11104
11113
|
if (!templatePaths.has(filePath.replace(".pi/", ""))) {
|
|
11105
11114
|
changes.push({
|
|
11106
11115
|
path: filePath,
|
|
@@ -11157,6 +11166,15 @@ function analyzeChanges(targetDir, manifest, templateFiles, context, options) {
|
|
|
11157
11166
|
for (const relativePath of templateFiles) {
|
|
11158
11167
|
const manifestPath = `.pi/${relativePath}`;
|
|
11159
11168
|
if (!manifest.files[manifestPath]) {
|
|
11169
|
+
const existing = path9.join(targetDir, manifestPath);
|
|
11170
|
+
if (fs10.existsSync(existing) && isUserOwnedPiPath(manifestPath)) {
|
|
11171
|
+
changes.push({
|
|
11172
|
+
path: manifestPath,
|
|
11173
|
+
action: "preserve",
|
|
11174
|
+
reason: "Project-owned content already exists"
|
|
11175
|
+
});
|
|
11176
|
+
continue;
|
|
11177
|
+
}
|
|
11160
11178
|
changes.push({ path: manifestPath, action: "add", reason: "New template file" });
|
|
11161
11179
|
}
|
|
11162
11180
|
}
|
package/dist/exports.js
CHANGED
|
@@ -1898,7 +1898,11 @@ function categorizeFile(relativePath) {
|
|
|
1898
1898
|
"agent/AGENTS.md",
|
|
1899
1899
|
"domain/",
|
|
1900
1900
|
"architecture/CHANGELOG.md",
|
|
1901
|
-
"architecture/implementation-roadmap.md"
|
|
1901
|
+
"architecture/implementation-roadmap.md",
|
|
1902
|
+
"architecture/diagrams/",
|
|
1903
|
+
"architecture/modules/",
|
|
1904
|
+
"architecture/decisions/",
|
|
1905
|
+
"architecture/contracts/"
|
|
1902
1906
|
];
|
|
1903
1907
|
if (userEditable.some((p2) => relativePath.includes(p2))) {
|
|
1904
1908
|
return "user";
|
|
@@ -1987,7 +1991,7 @@ __export(exports_package, {
|
|
|
1987
1991
|
bin: () => bin,
|
|
1988
1992
|
author: () => author
|
|
1989
1993
|
});
|
|
1990
|
-
var name = "guardian-framework", version = "0.1.
|
|
1994
|
+
var name = "guardian-framework", version = "0.1.134", description = "Token-optimized agentic framework scaffolder with pi-first architecture", type = "module", main = "dist/exports.js", exports, types = "dist/exports.d.ts", bin, files, engines, scripts, publishConfig, pi, repository, homepage = "https://github.com/arman-jalili/guardian-framework#readme", bugs, dependencies, devDependencies, keywords, author = "Arman Wolkensteiner-Jalili", license = "MIT", package_default;
|
|
1991
1995
|
var init_package = __esm(() => {
|
|
1992
1996
|
exports = {
|
|
1993
1997
|
".": {
|
|
@@ -1998,10 +2002,7 @@ var init_package = __esm(() => {
|
|
|
1998
2002
|
bin = {
|
|
1999
2003
|
"guardian-framework": "dist/cli.js"
|
|
2000
2004
|
};
|
|
2001
|
-
files = [
|
|
2002
|
-
"dist/",
|
|
2003
|
-
"templates/"
|
|
2004
|
-
];
|
|
2005
|
+
files = ["dist/", "templates/"];
|
|
2005
2006
|
engines = {
|
|
2006
2007
|
bun: ">=1.0.0"
|
|
2007
2008
|
};
|
|
@@ -2019,15 +2020,9 @@ var init_package = __esm(() => {
|
|
|
2019
2020
|
access: "public"
|
|
2020
2021
|
};
|
|
2021
2022
|
pi = {
|
|
2022
|
-
extensions: [
|
|
2023
|
-
|
|
2024
|
-
]
|
|
2025
|
-
skills: [
|
|
2026
|
-
"./templates/pi/skills"
|
|
2027
|
-
],
|
|
2028
|
-
prompts: [
|
|
2029
|
-
"./templates/pi/prompts"
|
|
2030
|
-
]
|
|
2023
|
+
extensions: ["./templates/pi/extensions"],
|
|
2024
|
+
skills: ["./templates/pi/skills"],
|
|
2025
|
+
prompts: ["./templates/pi/prompts"]
|
|
2031
2026
|
};
|
|
2032
2027
|
repository = {
|
|
2033
2028
|
type: "git",
|
|
@@ -10218,6 +10213,12 @@ async function runUpdate(targetDir, options) {
|
|
|
10218
10213
|
outro(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
10219
10214
|
}
|
|
10220
10215
|
}
|
|
10216
|
+
function isUserOwnedPiPath(manifestPath) {
|
|
10217
|
+
const p2 = manifestPath.replace(/^\.pi\//, "").toLowerCase();
|
|
10218
|
+
if (p2.includes("template"))
|
|
10219
|
+
return false;
|
|
10220
|
+
return p2.startsWith("architecture/diagrams/") || p2.startsWith("architecture/modules/") || p2.startsWith("architecture/decisions/") || p2.startsWith("architecture/contracts/") || p2.startsWith("architecture/architecture-overview.md") || p2.startsWith("domain/exploration.md") || p2.startsWith("domain/exploration/") || p2.startsWith("domain/ubiquitous-language.md");
|
|
10221
|
+
}
|
|
10221
10222
|
function analyzeChanges(targetDir, manifest, templateFiles, context, options) {
|
|
10222
10223
|
const changes = [];
|
|
10223
10224
|
const templatePaths = new Set(templateFiles);
|
|
@@ -10225,6 +10226,14 @@ function analyzeChanges(targetDir, manifest, templateFiles, context, options) {
|
|
|
10225
10226
|
if (!filePath.startsWith(".pi/"))
|
|
10226
10227
|
continue;
|
|
10227
10228
|
const fullPath = path5.join(targetDir, filePath);
|
|
10229
|
+
if (isUserOwnedPiPath(filePath)) {
|
|
10230
|
+
changes.push({
|
|
10231
|
+
path: filePath,
|
|
10232
|
+
action: "preserve",
|
|
10233
|
+
reason: "Project-owned architecture content — never overwritten by update"
|
|
10234
|
+
});
|
|
10235
|
+
continue;
|
|
10236
|
+
}
|
|
10228
10237
|
if (!templatePaths.has(filePath.replace(".pi/", ""))) {
|
|
10229
10238
|
changes.push({
|
|
10230
10239
|
path: filePath,
|
|
@@ -10281,6 +10290,15 @@ function analyzeChanges(targetDir, manifest, templateFiles, context, options) {
|
|
|
10281
10290
|
for (const relativePath of templateFiles) {
|
|
10282
10291
|
const manifestPath = `.pi/${relativePath}`;
|
|
10283
10292
|
if (!manifest.files[manifestPath]) {
|
|
10293
|
+
const existing = path5.join(targetDir, manifestPath);
|
|
10294
|
+
if (fs6.existsSync(existing) && isUserOwnedPiPath(manifestPath)) {
|
|
10295
|
+
changes.push({
|
|
10296
|
+
path: manifestPath,
|
|
10297
|
+
action: "preserve",
|
|
10298
|
+
reason: "Project-owned content already exists"
|
|
10299
|
+
});
|
|
10300
|
+
continue;
|
|
10301
|
+
}
|
|
10284
10302
|
changes.push({ path: manifestPath, action: "add", reason: "New template file" });
|
|
10285
10303
|
}
|
|
10286
10304
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "guardian-framework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.134",
|
|
4
4
|
"description": "Token-optimized agentic framework scaffolder with pi-first architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/exports.js",
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
"bin": {
|
|
15
15
|
"guardian-framework": "dist/cli.js"
|
|
16
16
|
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist/",
|
|
19
|
-
"templates/"
|
|
20
|
-
],
|
|
17
|
+
"files": ["dist/", "templates/"],
|
|
21
18
|
"engines": {
|
|
22
19
|
"bun": ">=1.0.0"
|
|
23
20
|
},
|
|
@@ -35,15 +32,9 @@
|
|
|
35
32
|
"access": "public"
|
|
36
33
|
},
|
|
37
34
|
"pi": {
|
|
38
|
-
"extensions": [
|
|
39
|
-
|
|
40
|
-
]
|
|
41
|
-
"skills": [
|
|
42
|
-
"./templates/pi/skills"
|
|
43
|
-
],
|
|
44
|
-
"prompts": [
|
|
45
|
-
"./templates/pi/prompts"
|
|
46
|
-
]
|
|
35
|
+
"extensions": ["./templates/pi/extensions"],
|
|
36
|
+
"skills": ["./templates/pi/skills"],
|
|
37
|
+
"prompts": ["./templates/pi/prompts"]
|
|
47
38
|
},
|
|
48
39
|
"repository": {
|
|
49
40
|
"type": "git",
|
|
@@ -1761,9 +1761,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
1761
1761
|
checks.push(content.includes("## Ubiquitous Language") ? " PASS Ubiquitous language section" : " FAIL Missing ubiquitous language section");
|
|
1762
1762
|
}
|
|
1763
1763
|
|
|
1764
|
-
|
|
1765
|
-
//
|
|
1766
|
-
//
|
|
1764
|
+
// Application-services drift gate (root cause: use-cases stopped at the
|
|
1765
|
+
// exploration layer). Every catalog service must be present in its module
|
|
1766
|
+
// doc's Application Layer catalog block; Implemented rows must resolve to a
|
|
1767
|
+
// real seam class in src; Planned/Seam rows must carry a roadmap/phase
|
|
1768
|
+
// pointer. Catches doc gaps (e.g. evidence-export had no catalog block) and
|
|
1769
|
+
// paper claims (doc says Implemented, code has no such seam).
|
|
1767
1770
|
const rawVPath = sessionPath.replace(/\.md$/, ".raw.json");
|
|
1768
1771
|
if (fs.existsSync(rawVPath)) {
|
|
1769
1772
|
try {
|
|
@@ -1771,29 +1774,92 @@ export default function (pi: ExtensionAPI) {
|
|
|
1771
1774
|
const svcV = Array.isArray(rawV.applicationServices) ? (rawV.applicationServices as Record<string, unknown>[]) : [];
|
|
1772
1775
|
if (svcV.length > 0) {
|
|
1773
1776
|
const vModules = fs.readdirSync(modulesDir).filter((f) => f.endsWith(".md") && f !== "module-template.md");
|
|
1774
|
-
|
|
1777
|
+
const typeExists = (typeName: string): boolean => {
|
|
1778
|
+
const srcBase = path.join(ctx.cwd, "src");
|
|
1779
|
+
if (!fs.existsSync(srcBase)) return false;
|
|
1780
|
+
const target = typeName.replace(/[^A-Za-z0-9_]/g, "");
|
|
1781
|
+
let found = false;
|
|
1782
|
+
const walk = (dir: string, dep: number): void => {
|
|
1783
|
+
if (found || dep > 9) return;
|
|
1784
|
+
let entries;
|
|
1785
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
1786
|
+
for (const e of entries) {
|
|
1787
|
+
if (e.name === "node_modules" || e.name === "target" || e.name === ".git" || e.name === "dist") continue;
|
|
1788
|
+
const full = path.join(dir, e.name);
|
|
1789
|
+
if (e.isFile() && (e.name === target + ".java" || e.name === target + ".kt" || e.name === target + ".ts")) { found = true; return; }
|
|
1790
|
+
if (e.isDirectory()) walk(full, dep + 1);
|
|
1791
|
+
}
|
|
1792
|
+
};
|
|
1793
|
+
walk(srcBase, 0);
|
|
1794
|
+
return found;
|
|
1795
|
+
};
|
|
1796
|
+
const ctxNames = new Map<string, string>(); // norm(ctx) -> ctx
|
|
1797
|
+
const svcByCtx = new Map<string, string[]>();
|
|
1775
1798
|
for (const sv of svcV) {
|
|
1776
|
-
const ctx = String(sv.context ?? "");
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1799
|
+
const ctx = String(sv.context ?? ""); const nm = String(sv.name ?? "");
|
|
1800
|
+
if (!ctx || !nm) continue;
|
|
1801
|
+
ctxNames.set(norm(ctx), ctx);
|
|
1802
|
+
const arr = svcByCtx.get(ctx) ?? [];
|
|
1803
|
+
arr.push(nm); svcByCtx.set(ctx, arr);
|
|
1804
|
+
}
|
|
1805
|
+
let issues = 0;
|
|
1806
|
+
for (const [normCtx, ctx] of ctxNames) {
|
|
1807
|
+
const docFile = vModules.find((f) => norm(f.replace(/\.md$/, "")) === normCtx) ?? "";
|
|
1808
|
+
if (!docFile) {
|
|
1809
|
+
checks.push(" FAIL Module doc not found for context " + ctx + " (has " + svcByCtx.get(ctx)!.length + " catalog services)");
|
|
1810
|
+
issues++; continue;
|
|
1811
|
+
}
|
|
1781
1812
|
const docText = fs.readFileSync(path.join(modulesDir, docFile), "utf-8");
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1813
|
+
const catNames = svcByCtx.get(ctx)!;
|
|
1814
|
+
let miss = 0;
|
|
1815
|
+
for (const nm of catNames) if (!docText.includes(nm)) miss++;
|
|
1816
|
+
if (miss > 0) { checks.push(" FAIL " + docFile + " missing " + miss + " catalog service name(s): " + catNames.filter((n) => !docText.includes(n)).join(", ")); issues += miss; }
|
|
1817
|
+
if (!docText.includes("Service (canonical)")) {
|
|
1818
|
+
checks.push(" FAIL " + docFile + " has no Application Layer catalog block (header 'Service (canonical)') for " + catNames.length + " catalog services");
|
|
1819
|
+
issues++;
|
|
1820
|
+
}
|
|
1821
|
+
// Parse catalog table rows: | `Service` | use case | fr | Status | Delivered by |
|
|
1822
|
+
const block = docText.slice(docText.indexOf("### Application Layer") >= 0 ? docText.indexOf("### Application Layer") : 0);
|
|
1823
|
+
for (const line of block.split("\n")) {
|
|
1824
|
+
if (!line.trim().startsWith("|")) continue;
|
|
1825
|
+
const cells = line.split("|").map((c) => c.trim());
|
|
1826
|
+
if (cells.length < 6) continue;
|
|
1827
|
+
const svcName = cells[1].replace(/^`|`$/g, "");
|
|
1828
|
+
if (!catNames.includes(svcName)) continue; // catalog row only
|
|
1829
|
+
const statusCell = cells[4] + " " + cells[5];
|
|
1830
|
+
const seamCell = cells[5];
|
|
1831
|
+
if (/implemented/i.test(statusCell) && !/planned|seam/i.test(statusCell)) {
|
|
1832
|
+
const seamTokens = Array.from(seamCell.matchAll(/`([A-Za-z0-9_]+)`/g)).map((m) => m[1]);
|
|
1833
|
+
if (seamTokens.length === 0 && !/[A-Z][A-Za-z0-9_]+/.test(seamCell)) {
|
|
1834
|
+
checks.push(" FAIL " + docFile + ": Implemented catalog service " + svcName + " has no seam class named in the doc");
|
|
1835
|
+
issues++;
|
|
1836
|
+
} else {
|
|
1837
|
+
for (const tk of seamTokens.length > 0 ? seamTokens : seamCell.match(/[A-Z][A-Za-z0-9_]+/g) ?? []) {
|
|
1838
|
+
if (!typeExists(tk)) {
|
|
1839
|
+
checks.push(" FAIL " + docFile + ": Implemented service " + svcName + " names seam " + tk + " but no such type exists in src");
|
|
1840
|
+
issues++;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
} else if (/planned|seam/i.test(statusCell)) {
|
|
1845
|
+
if (!/phase|roadmap|later|projection|pending|seam|intake|console|partial|deterministic/i.test(statusCell)) {
|
|
1846
|
+
checks.push(" FAIL " + docFile + ": catalog service " + svcName + " is Planned/Seam without a roadmap/phase pointer");
|
|
1847
|
+
issues++;
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1785
1850
|
}
|
|
1786
1851
|
}
|
|
1787
|
-
checks.push(
|
|
1788
|
-
? " PASS
|
|
1789
|
-
: " FAIL " +
|
|
1790
|
-
if (
|
|
1852
|
+
checks.push(issues === 0
|
|
1853
|
+
? " PASS Catalog blocks + seams verified for all " + svcV.length + " application services"
|
|
1854
|
+
: " FAIL " + issues + " catalog/seam issue(s)");
|
|
1855
|
+
if (issues > 0) allPassed = false;
|
|
1791
1856
|
} else {
|
|
1792
1857
|
checks.push(" PASS No application services in session (use-cases pass not run)");
|
|
1793
1858
|
}
|
|
1794
1859
|
} catch { /* ignore */ }
|
|
1795
1860
|
}
|
|
1796
1861
|
|
|
1862
|
+
|
|
1797
1863
|
const header = allPassed ? "Domain Validation - All Checks Passed" : "Domain Validation - Some Checks Failed";
|
|
1798
1864
|
ctx.ui.notify(header, allPassed ? "success" : "error");
|
|
1799
1865
|
|