guardian-framework 0.1.145 → 0.1.146
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 +1 -1
- package/dist/exports.js +1 -1
- package/package.json +1 -1
- package/templates/pi/extensions/architect-lib/generators.ts +9 -2
- package/templates/pi/extensions/architect.ts +3 -3
- package/templates/pi/extensions/pipeline.ts +3 -1
- package/templates/pi/preflight_report.json +2 -2
- package/templates/pi/scripts/check_composition_root.sh +120 -0
package/dist/cli.js
CHANGED
|
@@ -3206,7 +3206,7 @@ __export(exports_package, {
|
|
|
3206
3206
|
bin: () => bin,
|
|
3207
3207
|
author: () => author
|
|
3208
3208
|
});
|
|
3209
|
-
var name = "guardian-framework", version = "0.1.
|
|
3209
|
+
var name = "guardian-framework", version = "0.1.146", 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;
|
|
3210
3210
|
var init_package = __esm(() => {
|
|
3211
3211
|
exports = {
|
|
3212
3212
|
".": {
|
package/dist/exports.js
CHANGED
|
@@ -1991,7 +1991,7 @@ __export(exports_package, {
|
|
|
1991
1991
|
bin: () => bin,
|
|
1992
1992
|
author: () => author
|
|
1993
1993
|
});
|
|
1994
|
-
var name = "guardian-framework", version = "0.1.
|
|
1994
|
+
var name = "guardian-framework", version = "0.1.146", 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;
|
|
1995
1995
|
var init_package = __esm(() => {
|
|
1996
1996
|
exports = {
|
|
1997
1997
|
".": {
|
package/package.json
CHANGED
|
@@ -692,8 +692,15 @@ run_stage "11" "${moduleId}_proofing" \\
|
|
|
692
692
|
*/
|
|
693
693
|
export function moduleHasRuntimeIntegration(cwd: string, moduleId: string): boolean {
|
|
694
694
|
const doc = readModuleDoc(cwd, moduleId);
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
// Unconditional: every module that ships code must be installed in the
|
|
696
|
+
// application shell. Previously this was gated on the module doc having an
|
|
697
|
+
// Integration/Runtime heading, so a doc without that heading silently
|
|
698
|
+
// skipped wiring — the "implemented but never wired" gap (ADR-009).
|
|
699
|
+
// Only an explicit opt-out in the doc removes the deliverable.
|
|
700
|
+
if (doc && /^.{0,80}(not wired by design|bootstrap only|no runtime integration|not part of the runtime)/im.test(doc)) {
|
|
701
|
+
return false;
|
|
702
|
+
}
|
|
703
|
+
return true;
|
|
697
704
|
}
|
|
698
705
|
|
|
699
706
|
export function generateRuntimeIntegrationMarkdown(
|
|
@@ -635,7 +635,7 @@ export default function architectExtension(pi: ExtensionAPI) {
|
|
|
635
635
|
items: existingIssues,
|
|
636
636
|
steps: [
|
|
637
637
|
{ name: "implement", prompt: ".pi/prompts/issue-implementation-series.md", acceptance: { type: "validator", validators: ["ci"] } },
|
|
638
|
-
{ name: "validate", acceptance: { type: "validator", validators: ["ci", "tests", "security"] } },
|
|
638
|
+
{ name: "validate", acceptance: { type: "validator", validators: ["ci", "tests", "security", "wiring"] } },
|
|
639
639
|
{ name: "create-mr", prompt: ".pi/prompts/epic-closeout.md", acceptance: { type: "none" } },
|
|
640
640
|
{ name: "merge", prompt: ".pi/prompts/epic-closeout.md", acceptance: { type: "validator", validators: ["ci", "canonical"] } },
|
|
641
641
|
],
|
|
@@ -697,7 +697,7 @@ export default function architectExtension(pi: ExtensionAPI) {
|
|
|
697
697
|
items,
|
|
698
698
|
steps: [
|
|
699
699
|
{ name: "implement", prompt: ".pi/prompts/issue-implementation-series.md", acceptance: { type: "validator", validators: ["ci"] } },
|
|
700
|
-
{ name: "validate", acceptance: { type: "validator", validators: ["ci", "tests", "security"] } },
|
|
700
|
+
{ name: "validate", acceptance: { type: "validator", validators: ["ci", "tests", "security", "wiring"] } },
|
|
701
701
|
{ name: "create-mr", prompt: ".pi/prompts/epic-closeout.md", acceptance: { type: "none" } },
|
|
702
702
|
{ name: "merge", prompt: ".pi/prompts/epic-closeout.md", acceptance: { type: "validator", validators: ["ci", "canonical"] } },
|
|
703
703
|
],
|
|
@@ -924,7 +924,7 @@ export default function architectExtension(pi: ExtensionAPI) {
|
|
|
924
924
|
items,
|
|
925
925
|
steps: [
|
|
926
926
|
{ name: "implement", prompt: ".pi/prompts/issue-implementation-series.md", acceptance: { type: "validator", validators: ["ci"] } },
|
|
927
|
-
{ name: "validate", acceptance: { type: "validator", validators: ["ci", "tests", "security"] } },
|
|
927
|
+
{ name: "validate", acceptance: { type: "validator", validators: ["ci", "tests", "security", "wiring"] } },
|
|
928
928
|
{ name: "create-mr", prompt: ".pi/prompts/epic-closeout.md", acceptance: { type: "none" } },
|
|
929
929
|
{ name: "merge", prompt: ".pi/prompts/epic-closeout.md", acceptance: { type: "validator", validators: ["ci", "canonical"] } },
|
|
930
930
|
],
|
|
@@ -43,6 +43,8 @@ const VALIDATOR_SCRIPTS: Record<string, string> = {
|
|
|
43
43
|
architecture: ".pi/scripts/validate-architecture.sh",
|
|
44
44
|
canonical: ".pi/scripts/validate-canonical.sh",
|
|
45
45
|
integration: ".pi/scripts/validate-integration.sh",
|
|
46
|
+
// ADR-009: implemented modules must be INSTALLED in the composition root
|
|
47
|
+
wiring: ".pi/scripts/check_composition_root.sh",
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
// ── Helpers ──
|
|
@@ -1443,7 +1445,7 @@ function buildSteps(stepNames: string[]): StepConfig[] {
|
|
|
1443
1445
|
},
|
|
1444
1446
|
validate: {
|
|
1445
1447
|
name: "validate",
|
|
1446
|
-
acceptance: { type: "validator", validators: ["ci", "tests", "security"] },
|
|
1448
|
+
acceptance: { type: "validator", validators: ["ci", "tests", "security", "wiring"] },
|
|
1447
1449
|
},
|
|
1448
1450
|
"create-mr": {
|
|
1449
1451
|
name: "create-mr",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-11-07T13:
|
|
2
|
+
"timestamp": "2026-11-07T13:24:59Z",
|
|
3
3
|
"mode": "all",
|
|
4
4
|
"stages_run": [],
|
|
5
5
|
"summary": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"failed": 1,
|
|
9
9
|
"skipped": 12
|
|
10
10
|
},
|
|
11
|
-
"duration_seconds":
|
|
11
|
+
"duration_seconds": 1,
|
|
12
12
|
"results": [
|
|
13
13
|
{
|
|
14
14
|
"name": "check_mr_traceability.sh",
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# check_composition_root.sh — implemented modules must be INSTALLED in the app
|
|
4
|
+
# ============================================================================
|
|
5
|
+
# ADR-009 gap: "referenced outside the module" is not "wired into the runtime".
|
|
6
|
+
# A service can be imported by one stray helper and still never be registered in
|
|
7
|
+
# the composition root — the app boots and the feature does not exist.
|
|
8
|
+
#
|
|
9
|
+
# This check asserts, per implemented module, that the app shell references it:
|
|
10
|
+
# python : FastAPI include_router / container build / app.add_*
|
|
11
|
+
# java : Spring @Bean / @ComponentScan / new *Configuration / @Import
|
|
12
|
+
# typescript: app.use( / router registration / createRouter / bootstrap
|
|
13
|
+
# go : handler registration / mux.Handle / router.Register
|
|
14
|
+
# rust : router/handler registration in main or app module
|
|
15
|
+
#
|
|
16
|
+
# Exemptions: modules whose doc declares "not wired by design" or bootstrap-only.
|
|
17
|
+
# Usage: bash .pi/scripts/check_composition_root.sh [--root <dir>] [--strict]
|
|
18
|
+
# Exit: 0 all implemented modules installed; 1 unwired module(s)
|
|
19
|
+
# ============================================================================
|
|
20
|
+
set -uo pipefail
|
|
21
|
+
ROOT="$(pwd)"
|
|
22
|
+
ARGS=("$@")
|
|
23
|
+
for ((i=0;i<${#ARGS[@]};i++)); do
|
|
24
|
+
case "${ARGS[$i]}" in
|
|
25
|
+
--root) ROOT="${ARGS[$((i+1))]:-$ROOT}" ;;
|
|
26
|
+
esac
|
|
27
|
+
done
|
|
28
|
+
cd "$ROOT" || exit 1
|
|
29
|
+
|
|
30
|
+
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
|
|
31
|
+
echo "============================================"
|
|
32
|
+
echo " Composition Root (implemented = installed)"
|
|
33
|
+
echo "============================================"
|
|
34
|
+
|
|
35
|
+
# ── language + app shell candidates ──────────────────────────────────────────
|
|
36
|
+
LANG_NAME=""
|
|
37
|
+
[ -f guardian-manifest.json ] && LANG_NAME=$(python3 -c "import json;print(json.load(open('guardian-manifest.json')).get('language',''))" 2>/dev/null || true)
|
|
38
|
+
echo "Language: ${LANG_NAME:-unknown}"
|
|
39
|
+
|
|
40
|
+
SHALLS=()
|
|
41
|
+
case "$LANG_NAME" in
|
|
42
|
+
python|nextjs|angular|typescript)
|
|
43
|
+
while IFS= read -r f; do SHALLS+=("$f"); done < <(find src app -maxdepth 4 -type f \( -name "app.py" -o -name "main.py" -o -name "__main__.py" -o -name "server.ts" -o -name "main.ts" -o -name "index.ts" \) 2>/dev/null | grep -vE "test|spec" | head -6)
|
|
44
|
+
COVER_PATTERN="include_router|add_router|app\.use\(|createRouter|register_module|build_container|@Module"
|
|
45
|
+
;;
|
|
46
|
+
java)
|
|
47
|
+
while IFS= read -r f; do SHALLS+=("$f"); done < <(find src/main/java -maxdepth 10 -type f \( -name "*Application.java" -o -name "*Configuration.java" -o -name "*Config.java" \) 2>/dev/null | head -8)
|
|
48
|
+
COVER_PATTERN="@Bean|@ComponentScan|@Import|@EnableAutoConfiguration|@SpringBootApplication"
|
|
49
|
+
;;
|
|
50
|
+
go)
|
|
51
|
+
while IFS= read -r f; do SHALLS+=("$f"); done < <(find . -maxdepth 4 -type f -name "main.go" 2>/dev/null | head -4)
|
|
52
|
+
COVER_PATTERN="http.Handle|mux.Handle|router.Register|\.Use\(|RegisterRoutes"
|
|
53
|
+
;;
|
|
54
|
+
rust)
|
|
55
|
+
while IFS= read -r f; do SHALLS+=("$f"); done < <(find . -maxdepth 4 -type f -name "main.rs" 2>/dev/null | grep -v target | head -4)
|
|
56
|
+
COVER_PATTERN="\.route\(|Router::new|add_route|register_handler|\.merge\("
|
|
57
|
+
;;
|
|
58
|
+
esac
|
|
59
|
+
|
|
60
|
+
if [ "${#SHALLS[@]}" -eq 0 ]; then
|
|
61
|
+
echo ""
|
|
62
|
+
if [ "$LANG_NAME" = "python" ] || [ "$LANG_NAME" = "typescript" ]; then
|
|
63
|
+
echo -e "${RED}❌ FAIL${NC} no application shell found (expected src/**/app.py|main.py or app.use/bootstrap)"
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
echo "no application shell detected for $LANG_NAME — skipping"
|
|
67
|
+
exit 0
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo "App shell(s): ${SHALLS[*]}"
|
|
71
|
+
SHELL_TEXT=$(cat "${SHALLS[@]}" 2>/dev/null)
|
|
72
|
+
|
|
73
|
+
# ── modules that claim implementation ────────────────────────────────────────
|
|
74
|
+
MODS=()
|
|
75
|
+
if [ -d .pi/architecture/modules ]; then
|
|
76
|
+
while IFS= read -r f; do
|
|
77
|
+
b=$(basename "$f" .md)
|
|
78
|
+
[ "$b" = "module-template" ] && continue
|
|
79
|
+
# Skip docs that explicitly declare they are not runtime-installed.
|
|
80
|
+
grep -qiE "not wired by design|bootstrap only|no runtime integration|not part of the runtime" "$f" && continue
|
|
81
|
+
MODS+=("$b")
|
|
82
|
+
done < <(find .pi/architecture/modules -name "*.md" -type f | sort)
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
if [ "${#MODS[@]}" -eq 0 ]; then
|
|
86
|
+
echo "no module docs — skipping"
|
|
87
|
+
exit 0
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
UNWIRED=0
|
|
91
|
+
for m in "${MODS[@]}"; do
|
|
92
|
+
# normalize: identity-access -> identity_access, identityaccess
|
|
93
|
+
norm=$(echo "$m" | tr -d '_-' )
|
|
94
|
+
matched=0
|
|
95
|
+
# 1) shell text mentions the module (router import, container build, bean, etc.)
|
|
96
|
+
if echo "$SHELL_TEXT" | grep -qiE "(^|[^a-z0-9])${m//-/[-_ ]}($|[^a-z0-9])"; then matched=1; fi
|
|
97
|
+
if [ "$matched" -eq 0 ] && echo "$SHELL_TEXT" | grep -qi "$norm"; then matched=1; fi
|
|
98
|
+
# 2) shell imports a file from the module package (language-agnostic)
|
|
99
|
+
if [ "$matched" -eq 0 ]; then
|
|
100
|
+
while IFS= read -r sh; do
|
|
101
|
+
if grep -qE "(from|import)\s+[\"']?${m//-/[_ ]}|${norm}" "$sh" 2>/dev/null; then matched=1; break; fi
|
|
102
|
+
done < <(printf '%s\n' "${SHALLS[@]}")
|
|
103
|
+
fi
|
|
104
|
+
# 3) the shell has at least one registration call AND imports the module (covered above)
|
|
105
|
+
if [ "$matched" -eq 0 ]; then
|
|
106
|
+
echo -e "${RED}❌ FAIL${NC} ${m}: implemented but NOT installed in the app shell (${SHALLS[0]})"
|
|
107
|
+
UNWIRED=$((UNWIRED+1))
|
|
108
|
+
fi
|
|
109
|
+
done
|
|
110
|
+
|
|
111
|
+
if [ "$UNWIRED" -eq 0 ]; then
|
|
112
|
+
echo ""
|
|
113
|
+
echo -e "${GREEN}✅ PASS${NC} all ${#MODS[@]} module(s) installed in the composition root"
|
|
114
|
+
exit 0
|
|
115
|
+
fi
|
|
116
|
+
echo ""
|
|
117
|
+
echo -e "${RED}❌ FAIL${NC} ${UNWIRED}/${#MODS[@]} module(s) implemented but never wired into the app"
|
|
118
|
+
echo " Fix: register the module in ${SHALLS[0]} (router/bean/handler/container) and"
|
|
119
|
+
echo " add an end-to-end test through the public entrypoint."
|
|
120
|
+
exit 1
|