guardian-framework 0.1.131 → 0.1.133
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
CHANGED
|
@@ -3202,7 +3202,7 @@ __export(exports_package, {
|
|
|
3202
3202
|
bin: () => bin,
|
|
3203
3203
|
author: () => author
|
|
3204
3204
|
});
|
|
3205
|
-
var name = "guardian-framework", version = "0.1.
|
|
3205
|
+
var name = "guardian-framework", version = "0.1.133", 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
3206
|
var init_package = __esm(() => {
|
|
3207
3207
|
exports = {
|
|
3208
3208
|
".": {
|
|
@@ -3213,7 +3213,10 @@ var init_package = __esm(() => {
|
|
|
3213
3213
|
bin = {
|
|
3214
3214
|
"guardian-framework": "dist/cli.js"
|
|
3215
3215
|
};
|
|
3216
|
-
files = [
|
|
3216
|
+
files = [
|
|
3217
|
+
"dist/",
|
|
3218
|
+
"templates/"
|
|
3219
|
+
];
|
|
3217
3220
|
engines = {
|
|
3218
3221
|
bun: ">=1.0.0"
|
|
3219
3222
|
};
|
|
@@ -3231,9 +3234,15 @@ var init_package = __esm(() => {
|
|
|
3231
3234
|
access: "public"
|
|
3232
3235
|
};
|
|
3233
3236
|
pi = {
|
|
3234
|
-
extensions: [
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
+
extensions: [
|
|
3238
|
+
"./templates/pi/extensions"
|
|
3239
|
+
],
|
|
3240
|
+
skills: [
|
|
3241
|
+
"./templates/pi/skills"
|
|
3242
|
+
],
|
|
3243
|
+
prompts: [
|
|
3244
|
+
"./templates/pi/prompts"
|
|
3245
|
+
]
|
|
3237
3246
|
};
|
|
3238
3247
|
repository = {
|
|
3239
3248
|
type: "git",
|
|
@@ -12838,6 +12847,27 @@ ${bc.description}
|
|
|
12838
12847
|
}
|
|
12839
12848
|
content += `
|
|
12840
12849
|
`;
|
|
12850
|
+
content += `## Application Services (from exploration use-cases)
|
|
12851
|
+
`;
|
|
12852
|
+
content += `
|
|
12853
|
+
`;
|
|
12854
|
+
const ctxServices = (sessionResult.applicationServices ?? []).filter((svc) => svc.context === bc.name);
|
|
12855
|
+
if (ctxServices.length === 0) {
|
|
12856
|
+
content += `None captured in exploration yet (run the use-cases pass).
|
|
12857
|
+
|
|
12858
|
+
`;
|
|
12859
|
+
} else {
|
|
12860
|
+
content += `| Service | Use case | Maps to FR |
|
|
12861
|
+
`;
|
|
12862
|
+
content += `|---------|----------|-----------|
|
|
12863
|
+
`;
|
|
12864
|
+
for (const svc of ctxServices) {
|
|
12865
|
+
content += `| \`${svc.name}\` | ${svc.useCase ?? "\u2014"} | ${svc.mapsToFr ?? "\u2014"} |
|
|
12866
|
+
`;
|
|
12867
|
+
}
|
|
12868
|
+
content += `
|
|
12869
|
+
`;
|
|
12870
|
+
}
|
|
12841
12871
|
content += `## Ubiquitous Language
|
|
12842
12872
|
`;
|
|
12843
12873
|
content += `
|
package/dist/exports.js
CHANGED
|
@@ -1987,7 +1987,7 @@ __export(exports_package, {
|
|
|
1987
1987
|
bin: () => bin,
|
|
1988
1988
|
author: () => author
|
|
1989
1989
|
});
|
|
1990
|
-
var name = "guardian-framework", version = "0.1.
|
|
1990
|
+
var name = "guardian-framework", version = "0.1.133", 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
1991
|
var init_package = __esm(() => {
|
|
1992
1992
|
exports = {
|
|
1993
1993
|
".": {
|
|
@@ -1998,7 +1998,10 @@ var init_package = __esm(() => {
|
|
|
1998
1998
|
bin = {
|
|
1999
1999
|
"guardian-framework": "dist/cli.js"
|
|
2000
2000
|
};
|
|
2001
|
-
files = [
|
|
2001
|
+
files = [
|
|
2002
|
+
"dist/",
|
|
2003
|
+
"templates/"
|
|
2004
|
+
];
|
|
2002
2005
|
engines = {
|
|
2003
2006
|
bun: ">=1.0.0"
|
|
2004
2007
|
};
|
|
@@ -2016,9 +2019,15 @@ var init_package = __esm(() => {
|
|
|
2016
2019
|
access: "public"
|
|
2017
2020
|
};
|
|
2018
2021
|
pi = {
|
|
2019
|
-
extensions: [
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
+
extensions: [
|
|
2023
|
+
"./templates/pi/extensions"
|
|
2024
|
+
],
|
|
2025
|
+
skills: [
|
|
2026
|
+
"./templates/pi/skills"
|
|
2027
|
+
],
|
|
2028
|
+
prompts: [
|
|
2029
|
+
"./templates/pi/prompts"
|
|
2030
|
+
]
|
|
2022
2031
|
};
|
|
2023
2032
|
repository = {
|
|
2024
2033
|
type: "git",
|
|
@@ -13162,6 +13171,27 @@ ${bc.description}
|
|
|
13162
13171
|
}
|
|
13163
13172
|
content += `
|
|
13164
13173
|
`;
|
|
13174
|
+
content += `## Application Services (from exploration use-cases)
|
|
13175
|
+
`;
|
|
13176
|
+
content += `
|
|
13177
|
+
`;
|
|
13178
|
+
const ctxServices = (sessionResult.applicationServices ?? []).filter((svc) => svc.context === bc.name);
|
|
13179
|
+
if (ctxServices.length === 0) {
|
|
13180
|
+
content += `None captured in exploration yet (run the use-cases pass).
|
|
13181
|
+
|
|
13182
|
+
`;
|
|
13183
|
+
} else {
|
|
13184
|
+
content += `| Service | Use case | Maps to FR |
|
|
13185
|
+
`;
|
|
13186
|
+
content += `|---------|----------|-----------|
|
|
13187
|
+
`;
|
|
13188
|
+
for (const svc of ctxServices) {
|
|
13189
|
+
content += `| \`${svc.name}\` | ${svc.useCase ?? "—"} | ${svc.mapsToFr ?? "—"} |
|
|
13190
|
+
`;
|
|
13191
|
+
}
|
|
13192
|
+
content += `
|
|
13193
|
+
`;
|
|
13194
|
+
}
|
|
13165
13195
|
content += `## Ubiquitous Language
|
|
13166
13196
|
`;
|
|
13167
13197
|
content += `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "guardian-framework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.133",
|
|
4
4
|
"description": "Token-optimized agentic framework scaffolder with pi-first architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/exports.js",
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
"bin": {
|
|
15
15
|
"guardian-framework": "dist/cli.js"
|
|
16
16
|
},
|
|
17
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/",
|
|
19
|
+
"templates/"
|
|
20
|
+
],
|
|
18
21
|
"engines": {
|
|
19
22
|
"bun": ">=1.0.0"
|
|
20
23
|
},
|
|
@@ -32,9 +35,15 @@
|
|
|
32
35
|
"access": "public"
|
|
33
36
|
},
|
|
34
37
|
"pi": {
|
|
35
|
-
"extensions": [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
"extensions": [
|
|
39
|
+
"./templates/pi/extensions"
|
|
40
|
+
],
|
|
41
|
+
"skills": [
|
|
42
|
+
"./templates/pi/skills"
|
|
43
|
+
],
|
|
44
|
+
"prompts": [
|
|
45
|
+
"./templates/pi/prompts"
|
|
46
|
+
]
|
|
38
47
|
},
|
|
39
48
|
"repository": {
|
|
40
49
|
"type": "git",
|
|
@@ -1490,14 +1490,32 @@ export default function (pi: ExtensionAPI) {
|
|
|
1490
1490
|
// session's bounded contexts may be touched, and existing module docs
|
|
1491
1491
|
// are preserved unless --force. Prevents clobbering other streams.
|
|
1492
1492
|
const allModules = fs.readdirSync(modulesDir).filter(f => f.endsWith(".md") && f !== "module-template.md");
|
|
1493
|
-
|
|
1493
|
+
// Match a bounded-context name to its module doc by NORMALIZED name
|
|
1494
|
+
// (ignoring case and all separators) — camelCase contexts ("IntentCapture")
|
|
1495
|
+
// scaffold to hyphenated files ("intent-capture.md"); naive kebab of a
|
|
1496
|
+
// camelCase name yields "intentcapture.md" and matches nothing.
|
|
1497
|
+
const norm = (n: string) => n.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
1498
|
+
const moduleFileFor = (name: string): string => {
|
|
1499
|
+
const wanted = norm(name);
|
|
1500
|
+
const hit = allModules.find((f) => norm(f.replace(/\.md$/, "")) === wanted);
|
|
1501
|
+
if (hit) return hit;
|
|
1502
|
+
const kebabbed = name.trim().replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
1503
|
+
.replace(/[\s_]+/g, "-").toLowerCase().replace(/[^a-z0-9-]+/g, "").replace(/-+/g, "-").replace(/(^-|-$)/g, "");
|
|
1504
|
+
return kebabbed ? kebabbed + ".md" : "";
|
|
1505
|
+
};
|
|
1494
1506
|
let sessionModules: string[] = [];
|
|
1507
|
+
const seenFiles = new Set<string>();
|
|
1508
|
+
const addModule = (n: string) => {
|
|
1509
|
+
if (!n) return;
|
|
1510
|
+
const f = moduleFileFor(n);
|
|
1511
|
+
if (f && !seenFiles.has(f)) { seenFiles.add(f); sessionModules.push(f); }
|
|
1512
|
+
};
|
|
1495
1513
|
const sRawPath = path.join(explorationDir, sessionId + ".raw.json");
|
|
1496
1514
|
if (fs.existsSync(sRawPath)) {
|
|
1497
1515
|
try {
|
|
1498
1516
|
const rawS = JSON.parse(fs.readFileSync(sRawPath, "utf-8")) as Record<string, unknown>;
|
|
1499
1517
|
const bcs = Array.isArray(rawS.boundedContexts) ? (rawS.boundedContexts as Record<string, unknown>[]) : [];
|
|
1500
|
-
|
|
1518
|
+
for (const bc of bcs) addModule(String(bc.name ?? ""));
|
|
1501
1519
|
} catch { /* ignore */ }
|
|
1502
1520
|
}
|
|
1503
1521
|
if (sessionModules.length === 0) {
|
|
@@ -1505,11 +1523,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
1505
1523
|
const md = fs.existsSync(sessionPath) ? fs.readFileSync(sessionPath, "utf-8") : "";
|
|
1506
1524
|
const m = md.match(/## Bounded Contexts[\s\S]*?\n((?:\|.*\n)+?)(?=\n##|$)/);
|
|
1507
1525
|
if (m) {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
.filter((n) => allModules.includes(n));
|
|
1526
|
+
for (const line of m[1].split("\n")) {
|
|
1527
|
+
const cell = line.split("|").map((c) => c.trim()).filter(Boolean)[0];
|
|
1528
|
+
if (cell) addModule(cell);
|
|
1529
|
+
}
|
|
1513
1530
|
}
|
|
1514
1531
|
}
|
|
1515
1532
|
const preserved: string[] = [];
|
|
@@ -1533,12 +1550,46 @@ export default function (pi: ExtensionAPI) {
|
|
|
1533
1550
|
ctx.ui.notify("Enriching " + moduleFiles.length + " module docs from session " + sessionId, "info");
|
|
1534
1551
|
const lang = readLanguage(ctx.cwd);
|
|
1535
1552
|
|
|
1553
|
+
let servicesCatalog = "(no catalog available)";
|
|
1554
|
+
try {
|
|
1555
|
+
const svcRaw = JSON.parse(fs.readFileSync(sRawPath, "utf-8")) as Record<string, unknown>;
|
|
1556
|
+
const svcAll = Array.isArray(svcRaw.applicationServices) ? (svcRaw.applicationServices as Record<string, unknown>[]) : [];
|
|
1557
|
+
const svcBcs = Array.isArray(svcRaw.boundedContexts) ? (svcRaw.boundedContexts as Record<string, unknown>[]) : [];
|
|
1558
|
+
const ctxFor = (file: string): string => {
|
|
1559
|
+
const wanted = norm(file.replace(/\.md$/, ""));
|
|
1560
|
+
const bc = svcBcs.find((b) => norm(String(b.name ?? "")) === wanted);
|
|
1561
|
+
return bc ? String(bc.name ?? "") : "";
|
|
1562
|
+
};
|
|
1563
|
+
const chunks = moduleFiles.map((f) => {
|
|
1564
|
+
const ctx = ctxFor(f);
|
|
1565
|
+
const svcs = svcAll.filter((sv) => String(sv.context ?? "") === ctx);
|
|
1566
|
+
if (!ctx || svcs.length === 0) return "";
|
|
1567
|
+
const lines = svcs.map((sv) => {
|
|
1568
|
+
const extra = [String(sv.useCase ?? ""), sv.mapsToFr ? "mapsToFr: " + String(sv.mapsToFr) : ""]
|
|
1569
|
+
.filter(Boolean).join(" — ");
|
|
1570
|
+
return `- \u0060${String(sv.name ?? "")}\u0060 : ${extra}`;
|
|
1571
|
+
});
|
|
1572
|
+
return "### " + ctx + " (module doc: " + f + ")\n" + lines.join("\n");
|
|
1573
|
+
}).filter(Boolean);
|
|
1574
|
+
if (chunks.length > 0) servicesCatalog = chunks.join("\n\n");
|
|
1575
|
+
} catch { /* leave fallback text */ }
|
|
1576
|
+
|
|
1536
1577
|
const enrichPrompt = [
|
|
1537
1578
|
"## Task: Complete Architecture Package",
|
|
1538
1579
|
"",
|
|
1539
1580
|
"The scaffold generated basic stubs. Your task is to produce a **complete, interconnected architecture package**",
|
|
1540
1581
|
"that an implementation agent can build from.",
|
|
1541
1582
|
"",
|
|
1583
|
+
"### Application-services catalog (AUTHORITATIVE — from the exploration use-cases pass)",
|
|
1584
|
+
"",
|
|
1585
|
+
"The Application Layer section of EVERY module doc you enrich must list exactly these",
|
|
1586
|
+
"application services for that module's bounded context — EXACT names, use-case, and",
|
|
1587
|
+
"FR mapping. Do NOT rename, drop, or substitute services, and do not invent services",
|
|
1588
|
+
"that replace them. Extra controllers/adapters/query helpers may be added BELOW the",
|
|
1589
|
+
"catalog, but every catalog entry must appear verbatim:",
|
|
1590
|
+
"",
|
|
1591
|
+
servicesCatalog,
|
|
1592
|
+
"",
|
|
1542
1593
|
"**YOU MUST FOLLOW THESE 3 STEPS IN ORDER. Do not skip steps or reorder them.**",
|
|
1543
1594
|
"",
|
|
1544
1595
|
"### Source Data",
|
|
@@ -1694,6 +1745,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
1694
1745
|
|
|
1695
1746
|
const explorationDir = path.join(ctx.cwd, ".pi", "domain", "exploration");
|
|
1696
1747
|
const sessionPath = path.join(explorationDir, sessionId + ".md");
|
|
1748
|
+
const modulesDir = path.join(ctx.cwd, ".pi", "architecture", "modules");
|
|
1749
|
+
const norm = (n: string) => n.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
1697
1750
|
const checks: string[] = [];
|
|
1698
1751
|
let allPassed = true;
|
|
1699
1752
|
|
|
@@ -1708,6 +1761,39 @@ export default function (pi: ExtensionAPI) {
|
|
|
1708
1761
|
checks.push(content.includes("## Ubiquitous Language") ? " PASS Ubiquitous language section" : " FAIL Missing ubiquitous language section");
|
|
1709
1762
|
}
|
|
1710
1763
|
|
|
1764
|
+
// Application-services drift gate: every catalog service (use-cases pass)
|
|
1765
|
+
// must appear in its module doc so exploration -> architecture ->
|
|
1766
|
+
// implementation never silently drops a use case.
|
|
1767
|
+
const rawVPath = sessionPath.replace(/\.md$/, ".raw.json");
|
|
1768
|
+
if (fs.existsSync(rawVPath)) {
|
|
1769
|
+
try {
|
|
1770
|
+
const rawV = JSON.parse(fs.readFileSync(rawVPath, "utf-8")) as Record<string, unknown>;
|
|
1771
|
+
const svcV = Array.isArray(rawV.applicationServices) ? (rawV.applicationServices as Record<string, unknown>[]) : [];
|
|
1772
|
+
if (svcV.length > 0) {
|
|
1773
|
+
const vModules = fs.readdirSync(modulesDir).filter((f) => f.endsWith(".md") && f !== "module-template.md");
|
|
1774
|
+
let missingV = 0;
|
|
1775
|
+
for (const sv of svcV) {
|
|
1776
|
+
const ctx = String(sv.context ?? "");
|
|
1777
|
+
const svcName = String(sv.name ?? "");
|
|
1778
|
+
if (!ctx || !svcName) continue;
|
|
1779
|
+
const docFile = vModules.find((f) => norm(f.replace(/\.md$/, "")) === norm(ctx)) ?? "";
|
|
1780
|
+
if (!docFile) { checks.push(" FAIL Module doc not found for context " + ctx + " (service " + svcName + ")"); missingV++; continue; }
|
|
1781
|
+
const docText = fs.readFileSync(path.join(modulesDir, docFile), "utf-8");
|
|
1782
|
+
if (!docText.includes(svcName)) {
|
|
1783
|
+
checks.push(" FAIL Module doc " + docFile + " is missing catalog service " + svcName + " (from exploration use-cases)");
|
|
1784
|
+
missingV++;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
checks.push(missingV === 0
|
|
1788
|
+
? " PASS All " + svcV.length + " catalog application services present in module docs"
|
|
1789
|
+
: " FAIL " + missingV + " catalog application service(s) missing from module docs");
|
|
1790
|
+
if (missingV > 0) allPassed = false;
|
|
1791
|
+
} else {
|
|
1792
|
+
checks.push(" PASS No application services in session (use-cases pass not run)");
|
|
1793
|
+
}
|
|
1794
|
+
} catch { /* ignore */ }
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1711
1797
|
const header = allPassed ? "Domain Validation - All Checks Passed" : "Domain Validation - Some Checks Failed";
|
|
1712
1798
|
ctx.ui.notify(header, allPassed ? "success" : "error");
|
|
1713
1799
|
|