principles-disciple 1.126.0 → 1.127.0
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/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Evolutionary programming agent framework with strategic guardrails and reflection loops.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.127.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onCapabilities": [
|
|
8
8
|
"hook"
|
package/package.json
CHANGED
|
@@ -44,7 +44,10 @@ export function validateGeneratedCode(code: string): ValidationResult {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// --- Check 2: Forbidden patterns (delegated to core) ---
|
|
47
|
-
|
|
47
|
+
// PRI-439: checkForbiddenPatterns forbids `export` (canonical dialect is bare function).
|
|
48
|
+
// The openclaw-plugin legacy compiler still accepts `export` (the sandbox strips it),
|
|
49
|
+
// so we pass the normalized code (export keywords removed) to the checker.
|
|
50
|
+
const forbiddenLabels = checkForbiddenPatterns(normalized);
|
|
48
51
|
for (const label of forbiddenLabels) {
|
|
49
52
|
errors.push(`Forbidden pattern: ${label}`);
|
|
50
53
|
}
|
|
@@ -10,8 +10,8 @@ describe('generateFromTemplate', () => {
|
|
|
10
10
|
const result = generateFromTemplate('P_066', 'Writing to secrets directory', patterns);
|
|
11
11
|
|
|
12
12
|
expect(result).not.toBeNull();
|
|
13
|
-
expect(result).toContain("
|
|
14
|
-
expect(result).toContain("
|
|
13
|
+
expect(result).toContain("const meta");
|
|
14
|
+
expect(result).toContain("function evaluate(input, helpers)");
|
|
15
15
|
expect(result).toContain('name: "Auto_P_066"');
|
|
16
16
|
expect(result).toContain('ruleId: "R_P_066_auto"');
|
|
17
17
|
expect(result).toContain('sourcePrincipleId: "P_066"');
|
|
@@ -82,7 +82,7 @@ describe('generateFromTemplate', () => {
|
|
|
82
82
|
expect(result).not.toBeNull();
|
|
83
83
|
|
|
84
84
|
// Check meta structure
|
|
85
|
-
expect(result).toMatch(/
|
|
85
|
+
expect(result).toMatch(/const meta = \{/);
|
|
86
86
|
expect(result).toMatch(/name: "Auto_P_050"/);
|
|
87
87
|
expect(result).toMatch(/version: '1\.0\.0'/);
|
|
88
88
|
expect(result).toMatch(/ruleId: "R_P_050_auto"/);
|
|
@@ -90,10 +90,10 @@ describe('generateFromTemplate', () => {
|
|
|
90
90
|
expect(result).toMatch(/compiledAt: "\d{4}-\d{2}-\d{2}T/);
|
|
91
91
|
|
|
92
92
|
// Check evaluate function structure
|
|
93
|
-
expect(result).toMatch(/
|
|
93
|
+
expect(result).toMatch(/function evaluate\(input, helpers\)/);
|
|
94
94
|
expect(result).toMatch(/decision: 'block'/);
|
|
95
95
|
expect(result).toMatch(/matched: true/);
|
|
96
|
-
expect(result).toMatch(/return \{ matched: false \}/);
|
|
96
|
+
expect(result).toMatch(/return \{ decision: 'allow', matched: false, reason: 'rule not applicable' \}/);
|
|
97
97
|
|
|
98
98
|
// Check edit tool uses new_string fallback
|
|
99
99
|
expect(result).toContain("input.action.paramsSummary.content || input.action.paramsSummary.new_string");
|