@backendkit-labs/agent-coding 0.28.4 → 0.29.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/README.md +2 -2
- package/dist/__tests__/context-hooks.test.d.ts +2 -0
- package/dist/__tests__/context-hooks.test.d.ts.map +1 -0
- package/dist/__tests__/context-hooks.test.js +21 -0
- package/dist/__tests__/context-hooks.test.js.map +1 -0
- package/dist/__tests__/sandbox.test.js +1 -1
- package/dist/__tests__/sandbox.test.js.map +1 -1
- package/dist/context-hooks.d.ts +11 -0
- package/dist/context-hooks.d.ts.map +1 -0
- package/dist/context-hooks.js +23 -0
- package/dist/context-hooks.js.map +1 -0
- package/dist/context-services.d.ts +12 -0
- package/dist/context-services.d.ts.map +1 -0
- package/dist/context-services.js +20 -0
- package/dist/context-services.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/dist/orchestration/capability-matrix.d.ts +1 -1
- package/dist/orchestration/capability-matrix.d.ts.map +1 -1
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts +2 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js +42 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts +2 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js +64 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts +2 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.js +159 -0
- package/dist/pipeline/__tests__/engine-brief.test.js.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts +2 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js +276 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts +28 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.js +91 -0
- package/dist/pipeline/coding-pipeline-hooks.js.map +1 -0
- package/dist/pipeline/index.d.ts +13 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +44 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts +11 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js +105 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js +21 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js +101 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js +54 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js +57 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js +43 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts +10 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js +264 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts +31 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js +120 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts +33 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js +126 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts +27 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js +155 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts +21 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js +110 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts +39 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js +65 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts +30 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js +249 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts +52 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js +144 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts +37 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js +129 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/index.d.ts +17 -0
- package/dist/pipeline/orchestration/audit/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/index.js +26 -0
- package/dist/pipeline/orchestration/audit/index.js.map +1 -0
- package/dist/pipeline/orchestration/audit/types.d.ts +79 -0
- package/dist/pipeline/orchestration/audit/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/types.js +10 -0
- package/dist/pipeline/orchestration/audit/types.js.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts +133 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.js +322 -0
- package/dist/pipeline/orchestration/audit-reporter.js.map +1 -0
- package/dist/pipeline/orchestration/config-loader.d.ts +51 -0
- package/dist/pipeline/orchestration/config-loader.d.ts.map +1 -0
- package/dist/pipeline/orchestration/config-loader.js +215 -0
- package/dist/pipeline/orchestration/config-loader.js.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts +36 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.js +157 -0
- package/dist/pipeline/orchestration/domain-detector.js.map +1 -0
- package/dist/pipeline/orchestration/fsm.d.ts +92 -0
- package/dist/pipeline/orchestration/fsm.d.ts.map +1 -0
- package/dist/pipeline/orchestration/fsm.js +243 -0
- package/dist/pipeline/orchestration/fsm.js.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts +52 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.js +120 -0
- package/dist/pipeline/orchestration/gate-resolver.js.map +1 -0
- package/dist/pipeline/orchestration/index.d.ts +16 -0
- package/dist/pipeline/orchestration/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/index.js +32 -0
- package/dist/pipeline/orchestration/index.js.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts +37 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.js +248 -0
- package/dist/pipeline/orchestration/intent-detector.js.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts +17 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.js +26 -0
- package/dist/pipeline/orchestration/keyword-match.js.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts +158 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.js +414 -0
- package/dist/pipeline/orchestration/orchestrator.js.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts +54 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.js +278 -0
- package/dist/pipeline/orchestration/policy-engine.js.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts +38 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.js +145 -0
- package/dist/pipeline/orchestration/risk-scorer.js.map +1 -0
- package/dist/pipeline/orchestration/task-context.d.ts +205 -0
- package/dist/pipeline/orchestration/task-context.d.ts.map +1 -0
- package/dist/pipeline/orchestration/task-context.js +162 -0
- package/dist/pipeline/orchestration/task-context.js.map +1 -0
- package/dist/pipeline/orchestration/types.d.ts +111 -0
- package/dist/pipeline/orchestration/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/types.js +37 -0
- package/dist/pipeline/orchestration/types.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js +170 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js +39 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js.map +1 -0
- package/dist/pipeline/qa/index.d.ts +3 -0
- package/dist/pipeline/qa/index.d.ts.map +1 -0
- package/dist/pipeline/qa/index.js +6 -0
- package/dist/pipeline/qa/index.js.map +1 -0
- package/dist/pipeline/qa/qa-service.d.ts +33 -0
- package/dist/pipeline/qa/qa-service.d.ts.map +1 -0
- package/dist/pipeline/qa/qa-service.js +239 -0
- package/dist/pipeline/qa/qa-service.js.map +1 -0
- package/dist/pipeline/qa-orchestrator.d.ts +60 -0
- package/dist/pipeline/qa-orchestrator.d.ts.map +1 -0
- package/dist/pipeline/qa-orchestrator.js +177 -0
- package/dist/pipeline/qa-orchestrator.js.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.js +161 -0
- package/dist/pipeline/reflection/domains/agent-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts +46 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.js +241 -0
- package/dist/pipeline/reflection/domains/audit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js +156 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.js +174 -0
- package/dist/pipeline/reflection/domains/commit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.js +194 -0
- package/dist/pipeline/reflection/domains/test-domain.js.map +1 -0
- package/dist/pipeline/reflection/historical-loader.d.ts +105 -0
- package/dist/pipeline/reflection/historical-loader.d.ts.map +1 -0
- package/dist/pipeline/reflection/historical-loader.js +462 -0
- package/dist/pipeline/reflection/historical-loader.js.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js +98 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js +112 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts +71 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js +97 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts +63 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js +90 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts +65 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.js +99 -0
- package/dist/pipeline/reflection/hooks/test-hook.js.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts +60 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js +286 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js.map +1 -0
- package/dist/store/ProjectStore.d.ts +1 -1
- package/dist/store/ProjectStore.d.ts.map +1 -1
- package/dist/store/types.d.ts +28 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +3 -0
- package/dist/store/types.js.map +1 -0
- package/dist/tools/__tests__/command-parser.test.js +1 -1
- package/dist/tools/__tests__/command-parser.test.js.map +1 -1
- package/dist/tools/__tests__/declared-facts.test.d.ts +2 -0
- package/dist/tools/__tests__/declared-facts.test.d.ts.map +1 -0
- package/dist/tools/__tests__/declared-facts.test.js +21 -0
- package/dist/tools/__tests__/declared-facts.test.js.map +1 -0
- package/dist/tools/__tests__/package-install.test.d.ts +2 -0
- package/dist/tools/__tests__/package-install.test.d.ts.map +1 -0
- package/dist/tools/__tests__/package-install.test.js +56 -0
- package/dist/tools/__tests__/package-install.test.js.map +1 -0
- package/dist/tools/__tests__/save-tools.secrets.test.js +1 -1
- package/dist/tools/__tests__/save-tools.secrets.test.js.map +1 -1
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +1 -0
- package/dist/tools/edit-file.js.map +1 -1
- package/dist/tools/list-directory.d.ts.map +1 -1
- package/dist/tools/list-directory.js +1 -0
- package/dist/tools/list-directory.js.map +1 -1
- package/dist/tools/package-install.d.ts +11 -0
- package/dist/tools/package-install.d.ts.map +1 -0
- package/dist/tools/package-install.js +112 -0
- package/dist/tools/package-install.js.map +1 -0
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +1 -0
- package/dist/tools/read-file.js.map +1 -1
- package/dist/tools/run-command.d.ts.map +1 -1
- package/dist/tools/run-command.js +5 -1
- package/dist/tools/run-command.js.map +1 -1
- package/dist/tools/save-audit.d.ts.map +1 -1
- package/dist/tools/save-audit.js +7 -6
- package/dist/tools/save-audit.js.map +1 -1
- package/dist/tools/save-context.d.ts.map +1 -1
- package/dist/tools/save-context.js +3 -2
- package/dist/tools/save-context.js.map +1 -1
- package/dist/tools/save-learning.d.ts.map +1 -1
- package/dist/tools/save-learning.js +4 -3
- package/dist/tools/save-learning.js.map +1 -1
- package/dist/tools/save-user-preference.d.ts.map +1 -1
- package/dist/tools/save-user-preference.js +3 -2
- package/dist/tools/save-user-preference.js.map +1 -1
- package/dist/tools/search-files.d.ts.map +1 -1
- package/dist/tools/search-files.js +1 -0
- package/dist/tools/search-files.js.map +1 -1
- package/dist/tools/update-session.d.ts.map +1 -1
- package/dist/tools/update-session.js +3 -2
- package/dist/tools/update-session.js.map +1 -1
- package/dist/tools/write-file.d.ts.map +1 -1
- package/dist/tools/write-file.js +1 -0
- package/dist/tools/write-file.js.map +1 -1
- package/package.json +63 -44
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description TestHook — Puente entre el test runner (jest) y el ReflectionEngine.
|
|
4
|
+
*
|
|
5
|
+
* Transforma resultados de testing (fallos de typecheck, timeouts, cobertura baja)
|
|
6
|
+
* en FailureRecord y los reporta al ReflectionEngine.
|
|
7
|
+
*
|
|
8
|
+
* Se integra en el pipeline de test validation gate.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const hook = new TestHook(engine);
|
|
13
|
+
* await hook.reportTestFailure('tsc_noEmit_type_error', 'Error TS2345', files);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TestHook = void 0;
|
|
18
|
+
const test_domain_1 = require("../domains/test-domain");
|
|
19
|
+
// ── TestHook ─────────────────────────────────────────────────────────────────
|
|
20
|
+
class TestHook {
|
|
21
|
+
engine;
|
|
22
|
+
constructor(engine) {
|
|
23
|
+
this.engine = engine;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @description Reporta un fallo de test al Reflection Engine.
|
|
27
|
+
* Convierte los datos en FailureRecord, detecta el failureType
|
|
28
|
+
* automáticamente según el mensaje de error.
|
|
29
|
+
*
|
|
30
|
+
* @param failureType - Tipo de fallo detectado (opcional, se auto-detecta si no se provee)
|
|
31
|
+
* @param errorMessage - Mensaje de error del test/typecheck
|
|
32
|
+
* @param archivos - Archivos involucrados en el fallo
|
|
33
|
+
* @param domain - Dominio del Reflection Engine (default: "test")
|
|
34
|
+
* @returns El FailureRecord creado y los patrones detectados
|
|
35
|
+
*/
|
|
36
|
+
async reportTestFailure(errorMessage, archivos, failureType, domain = 'test') {
|
|
37
|
+
// Detectar failureType si no se provee
|
|
38
|
+
const detectedType = failureType ?? (0, test_domain_1.detectTestFailureType)(errorMessage);
|
|
39
|
+
const meta = (0, test_domain_1.getTestFailureTypeMeta)(detectedType);
|
|
40
|
+
// Determinar severidad según el tipo
|
|
41
|
+
const severity = meta?.severity ?? 'high';
|
|
42
|
+
// Construir el FailureRecord
|
|
43
|
+
const record = {
|
|
44
|
+
domain,
|
|
45
|
+
failureType: detectedType,
|
|
46
|
+
severity,
|
|
47
|
+
dimension: meta?.dimension ?? 'calidad',
|
|
48
|
+
gate: 'jest',
|
|
49
|
+
agenteResponsable: 'system',
|
|
50
|
+
hallazgo: errorMessage,
|
|
51
|
+
recomendacion: meta?.genericRecommendation ?? 'Revisar el error del test y corregirlo antes de continuar',
|
|
52
|
+
archivos,
|
|
53
|
+
fecha: new Date().toISOString(),
|
|
54
|
+
};
|
|
55
|
+
// Reportar al Reflection Engine
|
|
56
|
+
const result = await this.engine.reportIncident(record);
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @description Reporta un fallo de cobertura por debajo del umbral.
|
|
61
|
+
*/
|
|
62
|
+
async reportCoverageFailure(threshold, actual, archivos) {
|
|
63
|
+
const message = `Cobertura por debajo del umbral: esperado ${threshold}, obtenido ${actual}`;
|
|
64
|
+
return this.reportTestFailure(message, archivos, 'coverage_below_threshold');
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @description Reporta un test como flaky (intermitente).
|
|
68
|
+
*/
|
|
69
|
+
async reportFlakyTest(testName, failureRate, archivos) {
|
|
70
|
+
const message = `Test flaky detectado: "${testName}" (falla ${failureRate} de las veces)`;
|
|
71
|
+
return this.reportTestFailure(message, archivos, 'flaky_test');
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @description Ejecuta una reflexión completa del dominio test.
|
|
75
|
+
*/
|
|
76
|
+
async reflectTestDomain() {
|
|
77
|
+
return this.engine.reflect({ domain: 'test', autoPromote: true });
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @description Obtiene estadísticas de incidentes del dominio test.
|
|
81
|
+
*/
|
|
82
|
+
async getTestStats() {
|
|
83
|
+
const stats = await this.engine.getStats();
|
|
84
|
+
const catalog = this.engine.getCatalog();
|
|
85
|
+
const testRecords = await catalog.findByDomain('test');
|
|
86
|
+
const unresolved = await catalog.findUnresolved();
|
|
87
|
+
const patternsByFailureType = {};
|
|
88
|
+
for (const record of testRecords) {
|
|
89
|
+
patternsByFailureType[record.failureType] = (patternsByFailureType[record.failureType] ?? 0) + 1;
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
totalIncidents: stats.totalIncidents,
|
|
93
|
+
unresolvedCount: unresolved.length,
|
|
94
|
+
patternsByFailureType,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.TestHook = TestHook;
|
|
99
|
+
//# sourceMappingURL=test-hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-hook.js","sourceRoot":"","sources":["../../../../src/pipeline/reflection/hooks/test-hook.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAIH,wDAAuF;AAEvF,gFAAgF;AAEhF,MAAa,QAAQ;IACX,MAAM,CAAmB;IAEjC,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,iBAAiB,CACrB,YAAoB,EACpB,QAAkB,EAClB,WAAyB,EACzB,SAA2B,MAAM;QAKjC,uCAAuC;QACvC,MAAM,YAAY,GAAG,WAAW,IAAI,IAAA,mCAAqB,EAAC,YAAY,CAAC,CAAC;QACxE,MAAM,IAAI,GAAG,IAAA,oCAAsB,EAAC,YAAY,CAAC,CAAC;QAElD,qCAAqC;QACrC,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,MAAM,CAAC;QAE1C,6BAA6B;QAC7B,MAAM,MAAM,GAA8B;YACxC,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AAU,EAAE,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;QAElD,MAAM,qBAAqB,GAA2B,EAAE,CAAC;QACzD,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;YACjC,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACnG,CAAC;QAED,OAAO;YACL,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,eAAe,EAAE,UAAU,CAAC,MAAM;YAClC,qBAAqB;SACtB,CAAC;IACJ,CAAC;CACF;AArHD,4BAqHC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description LessonsMemoGenerator — Genera un memo de lecciones aprendidas
|
|
3
|
+
* a partir de los patrones detectados por el Reflection Engine.
|
|
4
|
+
*
|
|
5
|
+
* El memo se inyecta en el system prompt de los agentes para que aprendan
|
|
6
|
+
* de errores pasados automaticamente. Cierra el ciclo:
|
|
7
|
+
*
|
|
8
|
+
* Codigo -> Auditoria -> Reflection Engine -> LessonsMemo -> System Prompt
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const generator = new LessonsMemoGenerator(engine);
|
|
13
|
+
* const memo = await generator.generate();
|
|
14
|
+
* // Inyectar memo en el system prompt del agente
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import { ReflectionEngine } from '@backendkit-labs/agent-core';
|
|
18
|
+
export declare class LessonsMemoGenerator {
|
|
19
|
+
private engine;
|
|
20
|
+
constructor(engine: ReflectionEngine);
|
|
21
|
+
/**
|
|
22
|
+
* @description Genera el memo de lecciones aprendidas basado en los patrones
|
|
23
|
+
* detectados por el Reflection Engine.
|
|
24
|
+
*
|
|
25
|
+
* El memo incluye:
|
|
26
|
+
* - Resumen de patrones por dominio
|
|
27
|
+
* - Lecciones concretas extraidas de cada patron (que hacer y que evitar)
|
|
28
|
+
* - Reglas promovidas a policyRules
|
|
29
|
+
*
|
|
30
|
+
* @returns Contenido del memo en markdown, o null si no hay patrones
|
|
31
|
+
*/
|
|
32
|
+
generate(): Promise<string | null>;
|
|
33
|
+
/**
|
|
34
|
+
* @description Genera y persiste el memo en disco.
|
|
35
|
+
* La ruta es: ~/.deepseek-code/projects/{hash}/audits/lecciones-aprendidas.md
|
|
36
|
+
*
|
|
37
|
+
* @returns Ruta del archivo generado, o null si no hay lecciones
|
|
38
|
+
*/
|
|
39
|
+
persist(): Promise<string | null>;
|
|
40
|
+
/**
|
|
41
|
+
* @description Obtiene la ruta del archivo de memo.
|
|
42
|
+
*/
|
|
43
|
+
getMemoPath(): string;
|
|
44
|
+
private getDomainIcon;
|
|
45
|
+
/**
|
|
46
|
+
* Convierte un DetectedPattern en una leccion con formato markdown.
|
|
47
|
+
*/
|
|
48
|
+
private formatPatternAsLesson;
|
|
49
|
+
/**
|
|
50
|
+
* Genera una recomendacion concreta basada en el failureType.
|
|
51
|
+
*/
|
|
52
|
+
private buildRecommendation;
|
|
53
|
+
/**
|
|
54
|
+
* Builds a self-review checklist based on detected patterns.
|
|
55
|
+
*/
|
|
56
|
+
private buildChecklist;
|
|
57
|
+
private formatFailureType;
|
|
58
|
+
private getSeverityEmoji;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=lessons-memo-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessons-memo-generator.d.ts","sourceRoot":"","sources":["../../../src/pipeline/reflection/lessons-memo-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAS/D,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAmB;gBAErB,MAAM,EAAE,gBAAgB;IAIpC;;;;;;;;;;OAUG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA6ExC;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAUvC;;OAEG;IACH,WAAW,IAAI,MAAM;IAYrB,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAwB7B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyC3B;;OAEG;IACH,OAAO,CAAC,cAAc;IAoCtB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;CASzB"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description LessonsMemoGenerator — Genera un memo de lecciones aprendidas
|
|
4
|
+
* a partir de los patrones detectados por el Reflection Engine.
|
|
5
|
+
*
|
|
6
|
+
* El memo se inyecta en el system prompt de los agentes para que aprendan
|
|
7
|
+
* de errores pasados automaticamente. Cierra el ciclo:
|
|
8
|
+
*
|
|
9
|
+
* Codigo -> Auditoria -> Reflection Engine -> LessonsMemo -> System Prompt
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const generator = new LessonsMemoGenerator(engine);
|
|
14
|
+
* const memo = await generator.generate();
|
|
15
|
+
* // Inyectar memo en el system prompt del agente
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
|
+
}
|
|
24
|
+
Object.defineProperty(o, k2, desc);
|
|
25
|
+
}) : (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
o[k2] = m[k];
|
|
28
|
+
}));
|
|
29
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
+
}) : function(o, v) {
|
|
32
|
+
o["default"] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
35
|
+
var ownKeys = function(o) {
|
|
36
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
37
|
+
var ar = [];
|
|
38
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
return ownKeys(o);
|
|
42
|
+
};
|
|
43
|
+
return function (mod) {
|
|
44
|
+
if (mod && mod.__esModule) return mod;
|
|
45
|
+
var result = {};
|
|
46
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
+
__setModuleDefault(result, mod);
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
})();
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.LessonsMemoGenerator = void 0;
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
const os = __importStar(require("os"));
|
|
55
|
+
const fs = __importStar(require("fs/promises"));
|
|
56
|
+
// ── Constantes ───────────────────────────────────────────────────────────────
|
|
57
|
+
const MEMO_FILENAME = 'lecciones-aprendidas.md';
|
|
58
|
+
// ── LessonsMemoGenerator ─────────────────────────────────────────────────────
|
|
59
|
+
class LessonsMemoGenerator {
|
|
60
|
+
engine;
|
|
61
|
+
constructor(engine) {
|
|
62
|
+
this.engine = engine;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @description Genera el memo de lecciones aprendidas basado en los patrones
|
|
66
|
+
* detectados por el Reflection Engine.
|
|
67
|
+
*
|
|
68
|
+
* El memo incluye:
|
|
69
|
+
* - Resumen de patrones por dominio
|
|
70
|
+
* - Lecciones concretas extraidas de cada patron (que hacer y que evitar)
|
|
71
|
+
* - Reglas promovidas a policyRules
|
|
72
|
+
*
|
|
73
|
+
* @returns Contenido del memo en markdown, o null si no hay patrones
|
|
74
|
+
*/
|
|
75
|
+
async generate() {
|
|
76
|
+
const stats = await this.engine.getStats();
|
|
77
|
+
if (stats.totalIncidents === 0) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
// Obtener patrones detectados
|
|
81
|
+
const allPatterns = this.engine.getLastPatterns();
|
|
82
|
+
const promotedRules = this.engine.getLastPromotedRules();
|
|
83
|
+
if (allPatterns.length === 0 && promotedRules.length === 0) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const sections = [];
|
|
87
|
+
// Encabezado
|
|
88
|
+
sections.push(`# Lessons Learned (Auto-generated)
|
|
89
|
+
|
|
90
|
+
> Automatically generated by the Reflection Engine.
|
|
91
|
+
> Based on ${stats.totalIncidents} incidents analyzed across ${stats.activeDomains.length} domains.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
`);
|
|
96
|
+
// --- Section 1: Summary by domain ---
|
|
97
|
+
sections.push('## Summary by Domain\n');
|
|
98
|
+
sections.push('| Domain | Incidents | Active Patterns |');
|
|
99
|
+
sections.push('|--------|-----------|-----------------|');
|
|
100
|
+
for (const domain of stats.activeDomains) {
|
|
101
|
+
const incidentCount = stats.countsByDomain[domain] ?? 0;
|
|
102
|
+
const patternCount = stats.patternsByDomain[domain] ?? 0;
|
|
103
|
+
const icon = this.getDomainIcon(domain);
|
|
104
|
+
sections.push(`| ${icon} ${domain} | ${incidentCount} | ${patternCount} |`);
|
|
105
|
+
}
|
|
106
|
+
sections.push('');
|
|
107
|
+
// --- Section 2: Lessons by pattern ---
|
|
108
|
+
sections.push('## Lessons Learned\n');
|
|
109
|
+
if (allPatterns.length === 0) {
|
|
110
|
+
sections.push('_No active patterns. Recorded incidents have not crossed the promotion threshold._\n');
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
for (const pattern of allPatterns) {
|
|
114
|
+
sections.push(this.formatPatternAsLesson(pattern));
|
|
115
|
+
sections.push('');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// --- Section 3: Promoted policy rules ---
|
|
119
|
+
if (promotedRules.length > 0) {
|
|
120
|
+
sections.push('## Promoted Policy Rules\n');
|
|
121
|
+
sections.push('| ID | Name | Domain | Trigger |');
|
|
122
|
+
sections.push('|----|------|--------|---------|');
|
|
123
|
+
for (const rule of promotedRules) {
|
|
124
|
+
const triggerInfo = rule.trigger
|
|
125
|
+
? `${rule.trigger.pattern} (x${rule.trigger.minOccurrences})`
|
|
126
|
+
: 'auto-generated';
|
|
127
|
+
sections.push(`| ${rule.id} | ${rule.name} | ${rule.trigger?.domain ?? 'N/A'} | ${triggerInfo} |`);
|
|
128
|
+
}
|
|
129
|
+
sections.push('');
|
|
130
|
+
}
|
|
131
|
+
// --- Section 4: Self-review checklist ---
|
|
132
|
+
sections.push('## Self-Review Checklist\n');
|
|
133
|
+
sections.push(`Based on detected patterns, before finalizing any implementation, verify:
|
|
134
|
+
|
|
135
|
+
${this.buildChecklist(allPatterns)}
|
|
136
|
+
`);
|
|
137
|
+
return sections.join('\n');
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @description Genera y persiste el memo en disco.
|
|
141
|
+
* La ruta es: ~/.deepseek-code/projects/{hash}/audits/lecciones-aprendidas.md
|
|
142
|
+
*
|
|
143
|
+
* @returns Ruta del archivo generado, o null si no hay lecciones
|
|
144
|
+
*/
|
|
145
|
+
async persist() {
|
|
146
|
+
const content = await this.generate();
|
|
147
|
+
if (!content)
|
|
148
|
+
return null;
|
|
149
|
+
const filePath = this.getMemoPath();
|
|
150
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
151
|
+
await fs.writeFile(filePath, content, 'utf-8');
|
|
152
|
+
return filePath;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @description Obtiene la ruta del archivo de memo.
|
|
156
|
+
*/
|
|
157
|
+
getMemoPath() {
|
|
158
|
+
const cwd = process.cwd();
|
|
159
|
+
const home = process.env.USERPROFILE ?? process.env.HOME ?? os.homedir();
|
|
160
|
+
const projectKey = cwd
|
|
161
|
+
.replace(/[/\\]$/, '')
|
|
162
|
+
.replace(/:[/\\]/g, '--')
|
|
163
|
+
.replace(/[^a-zA-Z0-9-]/g, '-');
|
|
164
|
+
return path.join(home, '.deepseek-code', 'projects', projectKey, 'audits', MEMO_FILENAME);
|
|
165
|
+
}
|
|
166
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
167
|
+
getDomainIcon(domain) {
|
|
168
|
+
const icons = {
|
|
169
|
+
audit: 'audit',
|
|
170
|
+
test: 'test',
|
|
171
|
+
commit: 'commit',
|
|
172
|
+
agent: 'agent',
|
|
173
|
+
bootstrap: 'bootstrap',
|
|
174
|
+
};
|
|
175
|
+
return icons[domain] ?? domain;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Convierte un DetectedPattern en una leccion con formato markdown.
|
|
179
|
+
*/
|
|
180
|
+
formatPatternAsLesson(pattern) {
|
|
181
|
+
const severityEmoji = this.getSeverityEmoji(pattern.severity);
|
|
182
|
+
// Construir recomendacion concreta
|
|
183
|
+
const recommendation = this.buildRecommendation(pattern);
|
|
184
|
+
return [
|
|
185
|
+
`### ${severityEmoji} ${this.formatFailureType(pattern.failureType)}`,
|
|
186
|
+
'',
|
|
187
|
+
`- **Domain:** ${pattern.domain}`,
|
|
188
|
+
`- **Occurrences:** ${pattern.count} (last: ${pattern.lastSeen.slice(0, 10)})`,
|
|
189
|
+
`- **Dominant severity:** ${pattern.severity}`,
|
|
190
|
+
`- **Dimension:** ${pattern.dominantDimension}`,
|
|
191
|
+
`- **Typical gate:** ${pattern.dominantGate}`,
|
|
192
|
+
'',
|
|
193
|
+
'**What to avoid:**',
|
|
194
|
+
`> ${pattern.recommendedAction || 'This pattern has repeated. Avoid in future implementations.'}`,
|
|
195
|
+
'',
|
|
196
|
+
'**Recommendation:**',
|
|
197
|
+
`> ${recommendation}`,
|
|
198
|
+
'',
|
|
199
|
+
].join('\n');
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Genera una recomendacion concreta basada en el failureType.
|
|
203
|
+
*/
|
|
204
|
+
buildRecommendation(pattern) {
|
|
205
|
+
const ft = pattern.failureType;
|
|
206
|
+
// Recomendaciones especificas por failureType
|
|
207
|
+
const recommendations = {
|
|
208
|
+
// Audit
|
|
209
|
+
missing_rollback: 'Always implement rollback/compensation for write operations. Verify every write/save has a corresponding rollback.',
|
|
210
|
+
connection_leak: 'Ensure all HTTP/DB clients are closed in finally blocks. Use try/finally or using pattern.',
|
|
211
|
+
security_vulnerability: 'Review OWASP Top 10 before implementing authentication, authorization, or user input handling.',
|
|
212
|
+
missing_test_coverage: 'Every new public method must have at least one unit test. Verify coverage before committing.',
|
|
213
|
+
incomplete_error_handling: 'Every function that can fail must have try/catch with explicit error handling. Do not leave errors unhandled.',
|
|
214
|
+
architecture_violation: 'Review ADRs before implementing. Verify the implementation respects documented architectural decisions.',
|
|
215
|
+
hardcoded_secret: 'Never hardcode secrets, API keys, or tokens. Use environment variables or a secrets vault.',
|
|
216
|
+
// Test
|
|
217
|
+
tsc_noEmit_type_error: 'Run tsc --noEmit before each commit. Type errors must be fixed in code, not silenced with `as any`.',
|
|
218
|
+
coverage_below_threshold: 'Do not commit if coverage drops below threshold. Add tests for new code BEFORE committing.',
|
|
219
|
+
flaky_test: 'Flaky tests must be marked as flaky and isolated. Do not ignore them.',
|
|
220
|
+
test_without_assertion: 'Every test must have at least one assertion. A test without an assertion is not a test.',
|
|
221
|
+
// Commit
|
|
222
|
+
typecheck_failed_before_commit: 'Run type check before each commit. Do not rely solely on the IDE.',
|
|
223
|
+
test_failed_before_commit: 'Run tests before committing. If they fail, diagnose and fix.',
|
|
224
|
+
branch_naming_invalid: 'Follow the branch naming convention: feature/initials_description_date or fix/initials_description_date.',
|
|
225
|
+
// Agent
|
|
226
|
+
wrong_agent_selected: 'Verify the selected agent is correct for the task domain. Use the capability matrix as reference.',
|
|
227
|
+
agent_hallucination: 'Verify all referenced APIs, methods, and packages actually exist. Do not invent functionality.',
|
|
228
|
+
delegation_failed: 'When delegating to another agent, provide sufficient context: relevant files, history, and constraints.',
|
|
229
|
+
tool_execution_failed: 'Verify invoked tools are available in the current environment.',
|
|
230
|
+
// Bootstrap
|
|
231
|
+
missing_config_yaml: 'Verify configuration files exist before starting. If missing, run the seed.',
|
|
232
|
+
memory_load_failure: 'Verify persistent memory is accessible. If load fails, continue with defaults.',
|
|
233
|
+
manifest_corrupt: 'Validate YAML before writing the manifest. Use tmp+rename pattern for atomic writes.',
|
|
234
|
+
};
|
|
235
|
+
return recommendations[ft]
|
|
236
|
+
?? `Pattern "${ft}" detected ${pattern.count} times. Review previous implementations to avoid repeating the same mistake.`;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Builds a self-review checklist based on detected patterns.
|
|
240
|
+
*/
|
|
241
|
+
buildChecklist(patterns) {
|
|
242
|
+
const checks = [];
|
|
243
|
+
// Always-present general checklist
|
|
244
|
+
checks.push('### 1. Connections');
|
|
245
|
+
checks.push('- [ ] If you created a WRITER (write, save, persist), is there a READER (read, load, subscribe)?');
|
|
246
|
+
checks.push('- [ ] If you added a hook/extension point, is it wired up somewhere?');
|
|
247
|
+
checks.push('');
|
|
248
|
+
checks.push('### 2. Logic');
|
|
249
|
+
checks.push('- [ ] If using includes(), does it NOT match its own negation ("no X".includes("X") = true)?');
|
|
250
|
+
checks.push('- [ ] If there are scores/weights, is the direction correct? (higher = better or higher = worse?)');
|
|
251
|
+
checks.push('- [ ] If there are if/else branches, are they in the correct order?');
|
|
252
|
+
checks.push('');
|
|
253
|
+
checks.push('### 3. Robustness');
|
|
254
|
+
checks.push('- [ ] Do all switch statements have a default case?');
|
|
255
|
+
checks.push('- [ ] Are all catch blocks handling the error (not empty)?');
|
|
256
|
+
checks.push('- [ ] Do file writes use the tmp+rename atomic pattern?');
|
|
257
|
+
// Pattern-specific checklist items
|
|
258
|
+
const failureTypes = new Set(patterns.map(p => p.failureType));
|
|
259
|
+
if (failureTypes.has('missing_rollback')) {
|
|
260
|
+
checks.push('- [ ] Do write operations have compensation/rollback?');
|
|
261
|
+
}
|
|
262
|
+
if (failureTypes.has('security_vulnerability')) {
|
|
263
|
+
checks.push('- [ ] Was OWASP Top 10 reviewed for this implementation?');
|
|
264
|
+
}
|
|
265
|
+
if (failureTypes.has('hardcoded_secret')) {
|
|
266
|
+
checks.push('- [ ] Are there no hardcoded secrets?');
|
|
267
|
+
}
|
|
268
|
+
return checks.join('\n');
|
|
269
|
+
}
|
|
270
|
+
formatFailureType(type) {
|
|
271
|
+
return type
|
|
272
|
+
.replace(/_/g, ' ')
|
|
273
|
+
.replace(/\b\w/g, c => c.toUpperCase());
|
|
274
|
+
}
|
|
275
|
+
getSeverityEmoji(severity) {
|
|
276
|
+
switch (severity) {
|
|
277
|
+
case 'critical': return 'CRITICAL';
|
|
278
|
+
case 'high': return 'HIGH';
|
|
279
|
+
case 'medium': return 'MEDIUM';
|
|
280
|
+
case 'low': return 'LOW';
|
|
281
|
+
default: return 'INFO';
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
exports.LessonsMemoGenerator = LessonsMemoGenerator;
|
|
286
|
+
//# sourceMappingURL=lessons-memo-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessons-memo-generator.js","sourceRoot":"","sources":["../../../src/pipeline/reflection/lessons-memo-generator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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AAQ,CAAC,CAAC,OAAO,QAAQ,CAAC;YAC/B,KAAK,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC;YACzB,OAAO,CAAC,CAAC,OAAO,MAAM,CAAC;QACzB,CAAC;IACH,CAAC;CACF;AAtQD,oDAsQC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProjectStoreData, SessionUpdates } from '
|
|
1
|
+
import type { ProjectStoreData, SessionUpdates } from './types';
|
|
2
2
|
export declare class ProjectStore implements ProjectStoreData {
|
|
3
3
|
readonly homeDir: string;
|
|
4
4
|
readonly projectDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectStore.d.ts","sourceRoot":"","sources":["../../src/store/ProjectStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ProjectStore.d.ts","sourceRoot":"","sources":["../../src/store/ProjectStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAKhE,qBAAa,YAAa,YAAW,gBAAgB;IACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,GAAG,EAAE,MAAM,EAAE,OAAO,SAAa;IAQ7C,OAAO,CAAC,eAAe;IA6BvB,UAAU,IAAI,MAAM;IACpB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAGpC,YAAY,IAAI,MAAM;IACtB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAGrC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAStC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKjD,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAQ9C,UAAU,IAAI,MAAM,EAAE;IAMtB,cAAc,IAAI,MAAM;IAGxB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3C,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAa5C,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ5D,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAwC5C,OAAO,CAAC,IAAI;IAGZ,OAAO,CAAC,OAAO;IAGf,OAAO,CAAC,MAAM;IAGd,OAAO,CAAC,SAAS;IAKjB,+EAA+E;IAC/E,OAAO,CAAC,UAAU;IAOlB,gGAAgG;IAChG,OAAO,CAAC,eAAe;CAU1B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface SessionUpdates {
|
|
2
|
+
/** Replace the Current Feature section — what is being worked on + progress */
|
|
3
|
+
feature?: string;
|
|
4
|
+
/** Append bullets to Decisions — key choices made (accumulates over time) */
|
|
5
|
+
decisions?: string[];
|
|
6
|
+
/** Replace Active Issues section — current blockers or open items */
|
|
7
|
+
issues?: string[];
|
|
8
|
+
/** Append bullets to Engine Learnings — non-obvious codebase discoveries (accumulates) */
|
|
9
|
+
learnings?: string[];
|
|
10
|
+
/** Replace Next Steps section — what needs to happen after this */
|
|
11
|
+
next_steps?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface ProjectStoreData {
|
|
14
|
+
/** Absolute path to the project memory directory (~/.{appName}/projects/{key}). Read-only. */
|
|
15
|
+
readonly projectDir?: string;
|
|
16
|
+
appendContext(content: string): void;
|
|
17
|
+
appendLearning(content: string): void;
|
|
18
|
+
saveAudit(agentId: string, content: string): void;
|
|
19
|
+
getContext(): string;
|
|
20
|
+
getLearnings(): string;
|
|
21
|
+
/** Returns combined global + project agent-notes for a given agent id. */
|
|
22
|
+
getAgentNotes?(agentId: string): string;
|
|
23
|
+
listAudits(): string[];
|
|
24
|
+
getLatestAudit(agentId: string): string | null;
|
|
25
|
+
appendUserPreference(content: string): void;
|
|
26
|
+
updateSession(updates: SessionUpdates): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/store/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC3B,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B,8FAA8F;IAC9F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,UAAU,IAAI,MAAM,CAAC;IACrB,YAAY,IAAI,MAAM,CAAC;IACvB,0EAA0E;IAC1E,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACxC,UAAU,IAAI,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/C,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/store/types.ts"],"names":[],"mappings":""}
|
|
@@ -69,7 +69,7 @@ describe('run_command — wrapper bypasses are rejected', () => {
|
|
|
69
69
|
expect(await run_command_1.runCommandTool.execute({ command: 'echo "$(sh -c id)"' }, ctx)).toMatch(/not in the allowed list/);
|
|
70
70
|
});
|
|
71
71
|
it('applies the per-agent blocklist to wrapped binaries', async () => {
|
|
72
|
-
const blocked = { ...ctx,
|
|
72
|
+
const blocked = { ...ctx, services: new Map([['coding.blockedCommands', ['rm']]]) };
|
|
73
73
|
expect(await run_command_1.runCommandTool.execute({ command: 'env rm -rf x' }, blocked)).toMatch(/"rm" is not available/);
|
|
74
74
|
expect(await run_command_1.runCommandTool.execute({ command: 'find . -delete' }, blocked)).toMatch(/"rm" is not available/);
|
|
75
75
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-parser.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/command-parser.test.ts"],"names":[],"mappings":";;AAAA,sDAAmD;AACnD,gDAAgD;AAEhD,MAAM,GAAG,GAAG;IACR,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE;IAC9D,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;IAC1E,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;CAC3B,CAAC;AAEF,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;IACjE,EAAE,CAAC,IAAI,CAAC;QACJ,CAAC,gBAAgB,EAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpD,CAAC,uBAAuB,EAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpD,CAAC,kBAAkB,EAAmB,CAAC,K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AE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrG,MAAM,CAAC,MAAM,4BAAc,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAC5G,MAAM,CAAC,MAAM,4BAAc,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAClH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,GAAG,GAAG,MAAM,4BAAc,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,EAAE,GAAG,CAAC,CAAC;QACpG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-facts.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/declared-facts.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("../../index");
|
|
4
|
+
// SPEC-0015 F3: core no longer knows tool names; the approval prompts come from the facts these tools declare.
|
|
5
|
+
describe('coding tools declare the facts that drive approval', () => {
|
|
6
|
+
const byName = (n) => index_1.CODING_TOOLS.find(t => t.name === n);
|
|
7
|
+
it.each(['write_file', 'edit_file', 'run_command'])('%s declares readOnly: false (it asks)', name => {
|
|
8
|
+
expect(byName(name).readOnly).toBe(false);
|
|
9
|
+
});
|
|
10
|
+
it.each(['read_file', 'list_directory', 'search_files'])('%s declares readOnly: true (it never asks)', name => {
|
|
11
|
+
expect(byName(name).readOnly).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
it('run_command flags package installs with alwaysAsk, and only those', () => {
|
|
14
|
+
const ask = byName('run_command').alwaysAsk;
|
|
15
|
+
expect(ask({ command: 'npm install left-pad' })).toBe(true);
|
|
16
|
+
expect(ask({ command: 'cd /tmp && npm i -D foo' })).toBe(true);
|
|
17
|
+
expect(ask({ command: 'npm test' })).toBe(false);
|
|
18
|
+
expect(ask({ notACommand: 1 })).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=declared-facts.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-facts.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/declared-facts.test.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAE3C,+GAA+G;AAC/G,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;IAChE,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,oBAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAE,CAAC;IAEpE,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,uCAAuC,EAAE,IAAI,CAAC,EAAE;QAChG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC,CAAC,4CAA4C,EAAE,IAAI,CAAC,EAAE;QAC1G,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAA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