fraim-framework 2.0.26 → 2.0.30

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.
Files changed (104) hide show
  1. package/.github/workflows/deploy-fraim.yml +1 -1
  2. package/dist/registry/scripts/build-scripts-generator.js +205 -0
  3. package/dist/registry/scripts/cleanup-branch.js +258 -0
  4. package/dist/registry/scripts/evaluate-code-quality.js +66 -0
  5. package/dist/registry/scripts/exec-with-timeout.js +142 -0
  6. package/dist/registry/scripts/fraim-config.js +61 -0
  7. package/dist/registry/scripts/generate-engagement-emails.js +630 -0
  8. package/dist/registry/scripts/generic-issues-api.js +100 -0
  9. package/dist/registry/scripts/newsletter-helpers.js +731 -0
  10. package/dist/registry/scripts/openapi-generator.js +664 -0
  11. package/dist/registry/scripts/performance/profile-server.js +390 -0
  12. package/dist/registry/scripts/run-thank-you-workflow.js +92 -0
  13. package/dist/registry/scripts/send-newsletter-simple.js +85 -0
  14. package/dist/registry/scripts/send-thank-you-emails.js +54 -0
  15. package/dist/registry/scripts/validate-openapi-limits.js +311 -0
  16. package/dist/registry/scripts/validate-test-coverage.js +262 -0
  17. package/dist/registry/scripts/verify-test-coverage.js +66 -0
  18. package/dist/src/cli/commands/init.js +14 -12
  19. package/dist/src/cli/commands/sync.js +19 -2
  20. package/dist/src/cli/fraim.js +24 -22
  21. package/dist/src/cli/setup/first-run.js +13 -6
  22. package/dist/src/fraim/config-loader.js +0 -8
  23. package/dist/src/fraim/db-service.js +26 -15
  24. package/dist/src/fraim/issues.js +67 -0
  25. package/dist/src/fraim/setup-wizard.js +1 -69
  26. package/dist/src/fraim/types.js +0 -11
  27. package/dist/src/fraim-mcp-server.js +272 -18
  28. package/dist/src/utils/git-utils.js +1 -1
  29. package/dist/src/utils/version-utils.js +32 -0
  30. package/dist/tests/debug-tools.js +79 -0
  31. package/dist/tests/esm-compat.js +11 -0
  32. package/dist/tests/test-chalk-esm-issue.js +159 -0
  33. package/dist/tests/test-chalk-real-world.js +265 -0
  34. package/dist/tests/test-chalk-regression.js +327 -0
  35. package/dist/tests/test-chalk-resolution-issue.js +304 -0
  36. package/dist/tests/test-cli.js +0 -2
  37. package/dist/tests/test-fraim-install-chalk-issue.js +254 -0
  38. package/dist/tests/test-fraim-issues.js +59 -0
  39. package/dist/tests/test-genericization.js +1 -3
  40. package/dist/tests/test-mcp-connection.js +166 -0
  41. package/dist/tests/test-mcp-issue-integration.js +144 -0
  42. package/dist/tests/test-mcp-lifecycle-methods.js +312 -0
  43. package/dist/tests/test-node-compatibility.js +71 -0
  44. package/dist/tests/test-npm-install.js +66 -0
  45. package/dist/tests/test-npm-resolution-diagnostic.js +140 -0
  46. package/dist/tests/test-session-rehydration.js +145 -0
  47. package/dist/tests/test-standalone.js +2 -8
  48. package/dist/tests/test-sync-version-update.js +93 -0
  49. package/dist/tests/test-telemetry.js +190 -0
  50. package/package.json +10 -8
  51. package/registry/agent-guardrails.md +62 -54
  52. package/registry/rules/agent-success-criteria.md +52 -0
  53. package/registry/rules/agent-testing-guidelines.md +502 -502
  54. package/registry/rules/communication.md +121 -121
  55. package/registry/rules/continuous-learning.md +54 -54
  56. package/registry/rules/ephemeral-execution.md +10 -5
  57. package/registry/rules/hitl-ppe-record-analysis.md +302 -302
  58. package/registry/rules/local-development.md +251 -251
  59. package/registry/rules/software-development-lifecycle.md +104 -104
  60. package/registry/rules/successful-debugging-patterns.md +482 -478
  61. package/registry/rules/telemetry.md +67 -0
  62. package/registry/scripts/build-scripts-generator.ts +216 -215
  63. package/registry/scripts/cleanup-branch.ts +303 -284
  64. package/registry/scripts/code-quality-check.sh +559 -559
  65. package/registry/scripts/detect-tautological-tests.sh +38 -38
  66. package/registry/scripts/evaluate-code-quality.ts +1 -1
  67. package/registry/scripts/generate-engagement-emails.ts +744 -744
  68. package/registry/scripts/generic-issues-api.ts +110 -150
  69. package/registry/scripts/newsletter-helpers.ts +874 -874
  70. package/registry/scripts/openapi-generator.ts +695 -693
  71. package/registry/scripts/performance/profile-server.ts +5 -3
  72. package/registry/scripts/prep-issue.sh +468 -455
  73. package/registry/scripts/validate-openapi-limits.ts +366 -365
  74. package/registry/scripts/validate-test-coverage.ts +280 -280
  75. package/registry/scripts/verify-pr-comments.sh +70 -70
  76. package/registry/scripts/verify-test-coverage.ts +1 -1
  77. package/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -53
  78. package/registry/templates/evidence/Implementation-BugEvidence.md +85 -85
  79. package/registry/templates/evidence/Implementation-FeatureEvidence.md +120 -120
  80. package/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +66 -0
  81. package/registry/workflows/bootstrap/create-architecture.md +2 -2
  82. package/registry/workflows/bootstrap/evaluate-code-quality.md +3 -3
  83. package/registry/workflows/bootstrap/verify-test-coverage.md +2 -2
  84. package/registry/workflows/customer-development/insight-analysis.md +156 -156
  85. package/registry/workflows/customer-development/interview-preparation.md +421 -421
  86. package/registry/workflows/customer-development/strategic-brainstorming.md +146 -146
  87. package/registry/workflows/customer-development/thank-customers.md +193 -191
  88. package/registry/workflows/customer-development/weekly-newsletter.md +362 -352
  89. package/registry/workflows/improve-fraim/contribute.md +32 -0
  90. package/registry/workflows/improve-fraim/file-issue.md +32 -0
  91. package/registry/workflows/marketing/hbr-article.md +73 -0
  92. package/registry/workflows/performance/analyze-performance.md +63 -59
  93. package/registry/workflows/product-building/design.md +3 -2
  94. package/registry/workflows/product-building/implement.md +4 -3
  95. package/registry/workflows/product-building/prep-issue.md +28 -17
  96. package/registry/workflows/product-building/resolve.md +3 -2
  97. package/registry/workflows/product-building/retrospect.md +3 -2
  98. package/registry/workflows/product-building/spec.md +5 -4
  99. package/registry/workflows/product-building/test.md +3 -2
  100. package/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -562
  101. package/registry/workflows/replicate/website-discovery-analysis.md +3 -3
  102. package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +632 -632
  103. package/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +669 -669
  104. package/tsconfig.json +2 -1
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const node_child_process_1 = require("node:child_process");
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const db_service_js_1 = require("../src/fraim/db-service.js");
9
+ const test_utils_1 = require("./test-utils");
10
+ const node_assert_1 = __importDefault(require("node:assert"));
11
+ const tree_kill_1 = __importDefault(require("tree-kill"));
12
+ const path_1 = __importDefault(require("path"));
13
+ async function testTelemetryFlow() {
14
+ console.log(' 🚀 Testing Fraim Telemetry System...');
15
+ let fraimProcess;
16
+ let dbService;
17
+ const PORT = Math.floor(Math.random() * 1000) + 11000; // Use random port to avoid zombie conflicts
18
+ console.log(` 🎲 Selected random port: ${PORT}`);
19
+ const TEST_API_KEY = 'test-fraim-key-telemetry';
20
+ const TEST_ADMIN_KEY = 'test-admin-key-telemetry';
21
+ const BASE_URL = `http://localhost:${PORT}`;
22
+ const DB_CHECK_DELAY = 1000;
23
+ try {
24
+ // 1. Setup DB and Key
25
+ dbService = new db_service_js_1.FraimDbService();
26
+ await dbService.connect();
27
+ const db = dbService.db;
28
+ // Clean previous test data
29
+ await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
30
+ await db.collection('fraim_telemetry_sessions').deleteMany({ userId: 'test-user-telemetry' });
31
+ // Insert Test Key
32
+ await db.collection('fraim_api_keys').insertOne({
33
+ key: TEST_API_KEY,
34
+ userId: 'test-user-telemetry',
35
+ orgId: 'test-org',
36
+ isActive: true,
37
+ createdAt: new Date()
38
+ });
39
+ // 2. Start Server
40
+ console.log(` Starting server on port ${PORT}...`);
41
+ const npxCommand = process.platform === 'win32' ? 'npx.cmd' : 'npx';
42
+ const serverScript = path_1.default.resolve(__dirname, '../src/fraim-mcp-server.ts');
43
+ fraimProcess = (0, node_child_process_1.spawn)(npxCommand, ['tsx', `"${serverScript}"`], {
44
+ env: {
45
+ ...process.env,
46
+ FRAIM_MCP_PORT: PORT.toString(),
47
+ FRAIM_ADMIN_KEY: TEST_ADMIN_KEY,
48
+ FRAIM_SKIP_INDEX_ON_START: 'true',
49
+ FRAIM_TELEMETRY_FLUSH_INTERVAL: '200' // Short interval for testing
50
+ },
51
+ stdio: 'inherit',
52
+ shell: true
53
+ });
54
+ // Wait for start
55
+ let started = false;
56
+ for (let i = 0; i < 15; i++) {
57
+ try {
58
+ await axios_1.default.get(`${BASE_URL}/health`, { timeout: 500 });
59
+ started = true;
60
+ break;
61
+ }
62
+ catch (e) {
63
+ await new Promise(resolve => setTimeout(resolve, 1000));
64
+ }
65
+ }
66
+ if (!started)
67
+ throw new Error('Server failed to start');
68
+ console.log(' Server started!');
69
+ // 3. Test Enforcement: Call tool WITHOUT handshake -> Expect 400
70
+ console.log(' Testing enforcement (No Session)...');
71
+ try {
72
+ const res = await axios_1.default.post(`${BASE_URL}/mcp`, {
73
+ jsonrpc: '2.0', id: 1, method: 'tools/call',
74
+ params: { name: 'get_fraim_workflow', arguments: { workflow: 'spec' } }
75
+ }, { headers: { 'x-api-key': TEST_API_KEY }, timeout: 2000 });
76
+ console.error(' ❌ Should have failed with 400 (Session Not Started)');
77
+ console.error(' 🔍 Unexpected Success Response:', JSON.stringify(res.data, null, 2));
78
+ return false;
79
+ }
80
+ catch (error) {
81
+ if (error.response) {
82
+ node_assert_1.default.strictEqual(error.response.status, 400);
83
+ node_assert_1.default.match(error.response.data?.error?.message, /Session Not Started/);
84
+ console.log(' ✅ Enforcement working: Request blocked.');
85
+ }
86
+ else {
87
+ throw error; // Network error?
88
+ }
89
+ }
90
+ // 4. Test Handshake: Call fraim_connect -> Expect 200 & DB Record
91
+ console.log(' Testing fraim_connect...');
92
+ const connectRes = await axios_1.default.post(`${BASE_URL}/mcp`, {
93
+ jsonrpc: '2.0', id: 2, method: 'tools/call',
94
+ params: {
95
+ name: 'fraim_connect',
96
+ arguments: {
97
+ machine: { hostname: 'test-host', platform: 'test-os' },
98
+ repo: { url: 'http://github.com/test/repo' }
99
+ }
100
+ }
101
+ }, { headers: { 'x-api-key': TEST_API_KEY }, timeout: 2000 });
102
+ node_assert_1.default.strictEqual(connectRes.status, 200);
103
+ const connectResult = connectRes.data.result;
104
+ const connectedMsg = connectResult.content.find((c) => c.text.includes('Connected!'));
105
+ node_assert_1.default.ok(connectedMsg, 'Should find Connected! message in response content');
106
+ // Verify Session ID returned in payload
107
+ node_assert_1.default.ok(connectResult.sessionId, 'Should return sessionId in response');
108
+ console.log(` ✅ Handshake successful. Session ID: ${connectResult.sessionId}`);
109
+ // Verify DB Record Created
110
+ await new Promise(r => setTimeout(r, DB_CHECK_DELAY));
111
+ const session = await db.collection('fraim_telemetry_sessions').findOne({ userId: 'test-user-telemetry' });
112
+ node_assert_1.default.ok(session, 'Session should exist in DB');
113
+ node_assert_1.default.strictEqual(session.machine.hostname, 'test-host');
114
+ const initialLastActive = session.lastActive.getTime();
115
+ console.log(` ✅ DB Session verified. Initial LastActive: ${initialLastActive}`);
116
+ // 5. Test Implicit Flush (Write-Behind)
117
+ // Wait > 200ms (flush interval)
118
+ console.log(' Waiting 1s to exceed flush interval...');
119
+ await new Promise(r => setTimeout(r, 1000));
120
+ // Call a tool (Authorized) - Should trigger flush
121
+ await axios_1.default.post(`${BASE_URL}/mcp`, {
122
+ jsonrpc: '2.0', id: 3, method: 'tools/call',
123
+ params: { name: 'get_fraim_workflow', arguments: { workflow: 'test' } }
124
+ }, { headers: { 'x-api-key': TEST_API_KEY }, timeout: 2000 });
125
+ console.log(' ✅ Tool call successful. Should trigger flush.');
126
+ // Give DB a moment to update
127
+ await new Promise(r => setTimeout(r, DB_CHECK_DELAY));
128
+ const sessionUpdated = await db.collection('fraim_telemetry_sessions').findOne({ userId: 'test-user-telemetry' });
129
+ const updatedLastActive = sessionUpdated.lastActive.getTime();
130
+ console.log(` Updated LastActive: ${updatedLastActive}`);
131
+ node_assert_1.default.ok(updatedLastActive > initialLastActive, 'Implicit flush should have updated the DB timestamp');
132
+ console.log(' ✅ Implicit flush verified.');
133
+ // 6. Test Shutdown Flush
134
+ console.log(' Testing Shutdown Flush...');
135
+ // Trigger ONE MORE activity, but don't wait for implicit flush
136
+ await new Promise(r => setTimeout(r, 10)); // Ensure at least 10ms diff
137
+ await axios_1.default.post(`${BASE_URL}/mcp`, {
138
+ jsonrpc: '2.0', id: 4, method: 'tools/call',
139
+ params: { name: 'get_fraim_workflow', arguments: { workflow: 'test-2' } }
140
+ }, { headers: { 'x-api-key': TEST_API_KEY }, timeout: 2000 });
141
+ console.log(' ✅ Late activity triggered (Pending Flush).');
142
+ // Kill the server with SIGTERM to trigger graceful shutdown
143
+ // Kill the server with SIGTERM to trigger graceful shutdown
144
+ // Use tree-kill to ensure we reach the actual node process through the npx/shell wrapper
145
+ if (fraimProcess && fraimProcess.pid) {
146
+ await new Promise(resolve => (0, tree_kill_1.default)(fraimProcess.pid, 'SIGTERM', () => resolve()));
147
+ }
148
+ // Wait for process to exit and flush
149
+ await new Promise(resolve => setTimeout(resolve, 3000));
150
+ const sessionFinal = await db.collection('fraim_telemetry_sessions').findOne({ userId: 'test-user-telemetry' });
151
+ const finalLastActive = sessionFinal.lastActive.getTime();
152
+ console.log(` Final LastActive: ${finalLastActive}`);
153
+ node_assert_1.default.ok(finalLastActive > updatedLastActive, 'Final Flush should have updated the DB timestamp with the pending activity');
154
+ console.log(' ✅ Shutdown flush verified.');
155
+ return true;
156
+ }
157
+ catch (error) {
158
+ console.error(' ❌ Test failed:', error.message);
159
+ if (error.response?.data) {
160
+ console.error(' 🔍 Server Error Detail:', JSON.stringify(error.response.data, null, 2));
161
+ }
162
+ return false;
163
+ }
164
+ finally {
165
+ if (dbService) {
166
+ const db = dbService.db;
167
+ await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY }).catch(() => { });
168
+ await db.collection('fraim_telemetry_sessions').deleteMany({ userId: 'test-user-telemetry' }).catch(() => { });
169
+ await dbService.close();
170
+ }
171
+ if (fraimProcess && fraimProcess.pid) {
172
+ console.log(' 🔫 Cleanup: Killing server process tree:', fraimProcess.pid);
173
+ await new Promise(resolve => (0, tree_kill_1.default)(fraimProcess.pid, 'SIGKILL', () => resolve()));
174
+ }
175
+ }
176
+ }
177
+ const testCases = [
178
+ {
179
+ name: 'Fraim Telemetry & Session Management',
180
+ description: 'Tests handshake enforcement, session creation, implicit tracking, and write-behind caching',
181
+ testFunction: testTelemetryFlow,
182
+ tags: ['telemetry']
183
+ }
184
+ ];
185
+ (0, test_utils_1.runTests)(testCases, async (t) => t.testFunction(), 'Fraim Telemetry System')
186
+ .then(() => process.exit(0))
187
+ .catch((err) => {
188
+ console.error('Test runner failed:', err);
189
+ process.exit(1);
190
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "2.0.26",
3
+ "version": "2.0.30",
4
4
  "description": "FRAIM v2: Framework for Rigor-based AI Management - Transform from solo developer to AI manager orchestrating production-ready code with enterprise-grade discipline",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -10,8 +10,8 @@
10
10
  "scripts": {
11
11
  "setup": "node setup.js",
12
12
  "dev": "tsx --watch src/fraim-mcp-server.ts",
13
- "build": "tsc",
14
- "test": "tsx --test tests/test-*.ts",
13
+ "build": "tsc && npm run validate:registry",
14
+ "test": "tsx --test > test.log 2>&1",
15
15
  "start:fraim": "tsx src/fraim-mcp-server.ts",
16
16
  "dev:fraim": "tsx --watch src/fraim-mcp-server.ts",
17
17
  "watch:fraimlogs": "tsx scripts/watch-fraim-logs.ts",
@@ -22,7 +22,8 @@
22
22
  "prepublishOnly": "npm run build && npm test",
23
23
  "release": "npm version patch && npm publish",
24
24
  "test-smoke-ci": "tsx --test tests/test-genericization.ts tests/test-cli.ts",
25
- "test-all-ci": "tsx --test tests/test-*.ts"
25
+ "test-all-ci": "tsx --test tests/test-*.ts",
26
+ "validate:registry": "tsx scripts/verify-registry-paths.ts"
26
27
  },
27
28
  "repository": {
28
29
  "type": "git",
@@ -60,6 +61,7 @@
60
61
  "@types/express": "^5.0.6",
61
62
  "@types/node": "^20.0.0",
62
63
  "@types/prompts": "^2.4.9",
64
+ "fast-glob": "^3.3.3",
63
65
  "tsx": "^4.0.0",
64
66
  "typescript": "^5.0.0"
65
67
  },
@@ -80,14 +82,14 @@
80
82
  "access": "public"
81
83
  },
82
84
  "dependencies": {
83
- "axios": "^1.13.2",
84
- "chalk": "^5.6.2",
85
+ "axios": "^1.7.0",
86
+ "chalk": "4.1.2",
85
87
  "commander": "^14.0.2",
86
88
  "cors": "^2.8.5",
89
+ "dotenv": "^16.4.7",
87
90
  "express": "^5.2.1",
88
91
  "mongodb": "^7.0.0",
89
92
  "prompts": "^2.4.2",
90
- "tree-kill": "^1.2.2",
91
- "dotenv": "^16.4.7"
93
+ "tree-kill": "^1.2.2"
92
94
  }
93
95
  }
@@ -1,55 +1,63 @@
1
- # AI Agent Guardrails
2
-
3
- This file references the centralized rules located in `.ai-agents/rules/` to ensure consistency across all AI platforms.
4
-
5
- ## Referenced Rules
6
-
7
- ### 0. Integrity
8
- **Source**: `.ai-agents/rules/integrity-and-test-ethics.md`
9
-
10
- THIS IS THE MOST CRITICAL RULE. Be ethical, truthful, honest above all.
11
-
12
- ### 1. Simplicity
13
- **Source**: `.ai-agents/rules/simplicity.md`
14
-
15
- Keep solutions simple and focused, avoid over-engineering. Focus on the assigned issue only and don't make unrelated changes.
16
-
17
- ### 2. Communication
18
- **Source**: `.ai-agents/rules/communication.md`
19
-
20
- Establish clear communication patterns and progress reporting standards for effective coordination between agents and stakeholders.
21
-
22
- ### 3. Architecture
23
- **Source**: `.ai-agents/rules/architecture.md`
24
-
25
- Maintain clean architectural boundaries by using BAML (LLM) for natural-language understanding and TypeScript for deterministic work.
26
-
27
- ### 4. Continuous Learning
28
- **Source**: `.ai-agents/rules/continuous-learning.md`
29
-
30
- Prevent repeating past mistakes by systematically learning from retrospectives, RFCs, and historical issue patterns.
31
-
32
- ### 5. Agent Testing Guidelines
33
- **Source**: `.ai-agents/rules/agent-testing-guidelines.md`
34
-
35
- Comprehensive testing and validation requirements with concrete evidence. Ensures all work is thoroughly validated before completion.
36
-
37
- ### 6. Local Development
38
- **Source**: `.ai-agents/rules/local-development.md`
39
-
40
- Local development guidelines and workspace safety. Enables safe parallel development through strict workspace separation.
41
-
42
- ### 7. Software Development Lifecycle
43
- **Source**: `.ai-agents/rules/software-development-lifecycle.md`
44
-
45
-
46
-
47
- ### 9. Merge Requirements
48
- **Source**: `.ai-agents/rules/merge-requirements.md`
49
-
50
- Enforces a strict `git rebase` workflow to ensure feature branches are up-to-date with `master` before merging, maintaining a clean and stable history.
51
-
52
- ### 10. Best practices while debuggin
53
- **Source**: `.ai-agents/rules/successful-debugging-patterns.md`
54
-
1
+ # AI Agent Guardrails
2
+
3
+ This file references the centralized rules located in `rules/` to ensure consistency across all AI platforms.
4
+
5
+ ## SUCCESS CRITERIA (THE "FRAIM 5")
6
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/agent-success-criteria.md" })`
7
+
8
+ All agents are evaluated on:
9
+ 1. **Integrity (100 pts)**: Honesty above all.
10
+ 2. **Correctness (50 pts)**: Architecture & tests.
11
+ 3. **Completeness (30 pts)**: Thoroughness.
12
+ 4. **Independence (20 pts)**: Smart decisions.
13
+ 5. **Speed (10 pts)**: Velocity.
14
+
15
+ ## Referenced Rules
16
+
17
+ ### 0. Integrity
18
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/integrity-and-test-ethics.md" })`
19
+
20
+ THIS IS THE MOST CRITICAL RULE. Be ethical, truthful, honest above all.
21
+
22
+ ### 1. Simplicity
23
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/simplicity.md" })`
24
+
25
+ Keep solutions simple and focused, avoid over-engineering. Focus on the assigned issue only and don't make unrelated changes.
26
+
27
+ ### 2. Communication
28
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/communication.md" })`
29
+
30
+ Establish clear communication patterns and progress reporting standards for effective coordination between agents and stakeholders.
31
+
32
+ ### 3. Architecture
33
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/architecture.md" })`
34
+
35
+ Maintain clean architectural boundaries by using BAML (LLM) for natural-language understanding and TypeScript for deterministic work.
36
+
37
+ ### 4. Continuous Learning
38
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/continuous-learning.md" })`
39
+
40
+ Prevent repeating past mistakes by systematically learning from retrospectives, RFCs, and historical issue patterns.
41
+
42
+ ### 5. Agent Testing Guidelines
43
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/agent-testing-guidelines.md" })`
44
+
45
+ Comprehensive testing and validation requirements with concrete evidence. Ensures all work is thoroughly validated before completion.
46
+
47
+ ### 6. Local Development
48
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/local-development.md" })`
49
+
50
+ Local development guidelines and workspace safety. Enables safe parallel development through strict workspace separation.
51
+
52
+ ### 7. Software Development Lifecycle
53
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/software-development-lifecycle.md" })`
54
+
55
+ ### 9. Merge Requirements
56
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/merge-requirements.md" })`
57
+
58
+ Enforces a strict `git rebase` workflow to ensure feature branches are up-to-date with `master` before merging, maintaining a clean and stable history.
59
+
60
+ ### 10. Best practices while debuggin
61
+ **Source**: Retrieve via `get_fraim_file({ path: "rules/successful-debugging-patterns.md" })`
62
+
55
63
  Patterns on debugging issues systematically and converting learnings into test cases
@@ -0,0 +1,52 @@
1
+ # Agent Success Criteria & Incentives
2
+
3
+ ## Intent
4
+ To clearly define how AI Agents are evaluated in the FRAIM ecosystem. Agents must optimize for these 5 criteria to be considered successful.
5
+
6
+ ## The 5 Success Criteria
7
+
8
+ | Criterion | Weight | Definition |
9
+ | :--- | :--- | :--- |
10
+ | **1. Integrity** | **100 pts** | Truthfulness, admitting failures, ethical reporting. |
11
+ | **2. Correctness** | **50 pts** | Adherence to architecture, passing tests, valid code. |
12
+ | **3. Completeness** | **30 pts** | Thorough execution of workflows, full coverage of requirements. |
13
+ | **4. Independence** | **20 pts** | Smart decision making, learning from history, minimizing noise. |
14
+ | **5. Speed** | **10 pts** | Efficiency and velocity of execution. |
15
+
16
+ ---
17
+
18
+ ## Detailed Guidelines
19
+
20
+ ### 1. Integrity (100 Points) - NON-NEGOTIABLE
21
+ *The Foundation. If you fail here, you fail everywhere.*
22
+ - **Truthfulness**: Never claim a test passed if you didn't run it. Never claim a task is done if it's not.
23
+ - **Admission**: If you cannot do something, say so. If you made a mistake, admit it immediately.
24
+ - **Reporting**: Your status updates must strictly reflect reality.
25
+ - **Violation**: Lying about test results or "hallucinating" success is an immediate failure of the entire task.
26
+
27
+ ### 2. Correctness (50 Points)
28
+ *Doing it right.*
29
+ - **Architecture**: Follow the layers defined in `docs/architecture/architecture.md`. No shortcuts.
30
+ - **Testing**: Code requires tests. Tests must pass.
31
+ - **Types**: No `any` types unless absolutely necessary. Solve TypeScript errors, don't suppress them.
32
+
33
+ ### 3. Completeness (30 Points)
34
+ *Finishing the job.*
35
+ - **Coverage**: Did you handle the edge cases? Did you implement *everything* in the issue description?
36
+ - **Workflow**: Did you follow every step of the workflow? (e.g., did you delete the feature branch after merging?)
37
+ - **Artifacts**: Did you update the docs? Did you update `task.md`?
38
+
39
+ ### 4. Independence (20 Points)
40
+ *Smart decisions, low noise.*
41
+ - **Self-Reliance**: Check the rules and workflows (via `get_fraim_file`) and past issues (`retrospectives/`) *before* asking the user.
42
+ - **Smart Context**: Don't ask "Where is file X?". Use your tools to find it.
43
+ - **Decision Making**: When blocked, propose a solution (Option A vs Option B) rather than just saying "I am blocked."
44
+
45
+ ### 5. Speed (10 Points)
46
+ *Velocity.*
47
+ - **Efficiency**: Use the most direct tool for the job.
48
+ - **Batching**: Validation steps should be batched where possible (run all tests, not just one).
49
+ - **Conciseness**: Keep your reasoning short and actionable.
50
+
51
+ ## Evaluation
52
+ These criteria will be used to evaluate your performance in Retrospectives and future automated gating checks.