@enterprise-skills/orchestrator 3.2.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/dist/__tests__/advisor.test.d.ts +2 -0
- package/dist/__tests__/advisor.test.d.ts.map +1 -0
- package/dist/__tests__/advisor.test.js +92 -0
- package/dist/__tests__/advisor.test.js.map +1 -0
- package/dist/__tests__/audit-logger.test.d.ts +2 -0
- package/dist/__tests__/audit-logger.test.d.ts.map +1 -0
- package/dist/__tests__/audit-logger.test.js +115 -0
- package/dist/__tests__/audit-logger.test.js.map +1 -0
- package/dist/__tests__/dag-resolver.test.d.ts +2 -0
- package/dist/__tests__/dag-resolver.test.d.ts.map +1 -0
- package/dist/__tests__/dag-resolver.test.js +297 -0
- package/dist/__tests__/dag-resolver.test.js.map +1 -0
- package/dist/__tests__/orchestrator.test.d.ts +2 -0
- package/dist/__tests__/orchestrator.test.d.ts.map +1 -0
- package/dist/__tests__/orchestrator.test.js +152 -0
- package/dist/__tests__/orchestrator.test.js.map +1 -0
- package/dist/__tests__/policy-enforcer.test.d.ts +2 -0
- package/dist/__tests__/policy-enforcer.test.d.ts.map +1 -0
- package/dist/__tests__/policy-enforcer.test.js +113 -0
- package/dist/__tests__/policy-enforcer.test.js.map +1 -0
- package/dist/__tests__/signal-router.test.d.ts +2 -0
- package/dist/__tests__/signal-router.test.d.ts.map +1 -0
- package/dist/__tests__/signal-router.test.js +96 -0
- package/dist/__tests__/signal-router.test.js.map +1 -0
- package/dist/__tests__/state-machine.test.d.ts +2 -0
- package/dist/__tests__/state-machine.test.d.ts.map +1 -0
- package/dist/__tests__/state-machine.test.js +278 -0
- package/dist/__tests__/state-machine.test.js.map +1 -0
- package/dist/advisor.d.ts +41 -0
- package/dist/advisor.d.ts.map +1 -0
- package/dist/advisor.js +268 -0
- package/dist/advisor.js.map +1 -0
- package/dist/api/handlers.d.ts +28 -0
- package/dist/api/handlers.d.ts.map +1 -0
- package/dist/api/handlers.js +305 -0
- package/dist/api/handlers.js.map +1 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +20 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/routes/complete.d.ts +9 -0
- package/dist/api/routes/complete.d.ts.map +1 -0
- package/dist/api/routes/complete.js +34 -0
- package/dist/api/routes/complete.js.map +1 -0
- package/dist/api/routes/dashboard.d.ts +9 -0
- package/dist/api/routes/dashboard.d.ts.map +1 -0
- package/dist/api/routes/dashboard.js +29 -0
- package/dist/api/routes/dashboard.js.map +1 -0
- package/dist/api/routes/execute.d.ts +10 -0
- package/dist/api/routes/execute.d.ts.map +1 -0
- package/dist/api/routes/execute.js +35 -0
- package/dist/api/routes/execute.js.map +1 -0
- package/dist/api/routes/gate.d.ts +9 -0
- package/dist/api/routes/gate.d.ts.map +1 -0
- package/dist/api/routes/gate.js +34 -0
- package/dist/api/routes/gate.js.map +1 -0
- package/dist/api/routes/index.d.ts +7 -0
- package/dist/api/routes/index.d.ts.map +1 -0
- package/dist/api/routes/index.js +19 -0
- package/dist/api/routes/index.js.map +1 -0
- package/dist/api/routes/middleware.d.ts +13 -0
- package/dist/api/routes/middleware.d.ts.map +1 -0
- package/dist/api/routes/middleware.js +55 -0
- package/dist/api/routes/middleware.js.map +1 -0
- package/dist/api/routes/signal.d.ts +9 -0
- package/dist/api/routes/signal.d.ts.map +1 -0
- package/dist/api/routes/signal.js +34 -0
- package/dist/api/routes/signal.js.map +1 -0
- package/dist/api/types.d.ts +87 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +3 -0
- package/dist/api/types.js.map +1 -0
- package/dist/audit-logger.d.ts +20 -0
- package/dist/audit-logger.d.ts.map +1 -0
- package/dist/audit-logger.js +125 -0
- package/dist/audit-logger.js.map +1 -0
- package/dist/builtin-triggers.d.ts +3 -0
- package/dist/builtin-triggers.d.ts.map +1 -0
- package/dist/builtin-triggers.js +235 -0
- package/dist/builtin-triggers.js.map +1 -0
- package/dist/dag-resolver.d.ts +22 -0
- package/dist/dag-resolver.d.ts.map +1 -0
- package/dist/dag-resolver.js +250 -0
- package/dist/dag-resolver.js.map +1 -0
- package/dist/hardening-sensors.d.ts +22 -0
- package/dist/hardening-sensors.d.ts.map +1 -0
- package/dist/hardening-sensors.js +135 -0
- package/dist/hardening-sensors.js.map +1 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +269 -0
- package/dist/index.js.map +1 -0
- package/dist/policy-enforcer.d.ts +27 -0
- package/dist/policy-enforcer.d.ts.map +1 -0
- package/dist/policy-enforcer.js +185 -0
- package/dist/policy-enforcer.js.map +1 -0
- package/dist/signal-router.d.ts +19 -0
- package/dist/signal-router.d.ts.map +1 -0
- package/dist/signal-router.js +206 -0
- package/dist/signal-router.js.map +1 -0
- package/dist/state-machine.d.ts +45 -0
- package/dist/state-machine.d.ts.map +1 -0
- package/dist/state-machine.js +300 -0
- package/dist/state-machine.js.map +1 -0
- package/dist/task-contract.d.ts +46 -0
- package/dist/task-contract.d.ts.map +1 -0
- package/dist/task-contract.js +71 -0
- package/dist/task-contract.js.map +1 -0
- package/dist/types.d.ts +167 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared middleware for orchestration API routes.
|
|
4
|
+
* Designed for Next.js App Router — import into route.ts files.
|
|
5
|
+
* Requires the host project to provide a Supabase service client.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.rateLimit = rateLimit;
|
|
9
|
+
exports.extractLicenseKey = extractLicenseKey;
|
|
10
|
+
exports.jsonError = jsonError;
|
|
11
|
+
exports.jsonSuccess = jsonSuccess;
|
|
12
|
+
const RATE_LIMIT_WINDOW_MS = 60_000;
|
|
13
|
+
const RATE_LIMIT_MAX = 120;
|
|
14
|
+
const rateLimitMap = new Map();
|
|
15
|
+
function rateLimit(key) {
|
|
16
|
+
const now = Date.now();
|
|
17
|
+
const entry = rateLimitMap.get(key);
|
|
18
|
+
if (!entry || now > entry.resetAt) {
|
|
19
|
+
rateLimitMap.set(key, { count: 1, resetAt: now + RATE_LIMIT_WINDOW_MS });
|
|
20
|
+
return { allowed: true, remaining: RATE_LIMIT_MAX - 1 };
|
|
21
|
+
}
|
|
22
|
+
entry.count++;
|
|
23
|
+
if (entry.count > RATE_LIMIT_MAX) {
|
|
24
|
+
return { allowed: false, remaining: 0 };
|
|
25
|
+
}
|
|
26
|
+
return { allowed: true, remaining: RATE_LIMIT_MAX - entry.count };
|
|
27
|
+
}
|
|
28
|
+
function extractLicenseKey(headers) {
|
|
29
|
+
const auth = headers.get('authorization');
|
|
30
|
+
if (auth?.startsWith('Bearer es-')) {
|
|
31
|
+
return auth.slice(7);
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function jsonError(message, status) {
|
|
36
|
+
return new Response(JSON.stringify({ ok: false, error: message }), {
|
|
37
|
+
status,
|
|
38
|
+
headers: {
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
'X-Content-Type-Options': 'nosniff',
|
|
41
|
+
'Cache-Control': 'no-store',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function jsonSuccess(data, status = 200) {
|
|
46
|
+
return new Response(JSON.stringify({ ok: true, data }), {
|
|
47
|
+
status,
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
'X-Content-Type-Options': 'nosniff',
|
|
51
|
+
'Cache-Control': 'no-store',
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/api/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e,EAAE,MAAc;IACvD,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE;QACjE,MAAM;QACN,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,wBAAwB,EAAE,SAAS;YACnC,eAAe,EAAE,UAAU;SAC5B;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,WAAW,CAAC,IAAa,EAAE,SAAiB,GAAG;IAC7D,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;QACtD,MAAM;QACN,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,wBAAwB,EAAE,SAAS;YACnC,eAAe,EAAE,UAAU;SAC5B;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/orchestration/signal
|
|
3
|
+
* Emit downstream signal.
|
|
4
|
+
*
|
|
5
|
+
* Drop this into: app/api/orchestration/signal/route.ts
|
|
6
|
+
*/
|
|
7
|
+
import type { SupabaseClient } from '../handlers';
|
|
8
|
+
export declare function createHandler(getSupabase: () => SupabaseClient): (request: Request) => Promise<Response>;
|
|
9
|
+
//# sourceMappingURL=signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../../src/api/routes/signal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,cAAc,IAClC,SAAS,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC,CAoBhE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* POST /api/orchestration/signal
|
|
4
|
+
* Emit downstream signal.
|
|
5
|
+
*
|
|
6
|
+
* Drop this into: app/api/orchestration/signal/route.ts
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.createHandler = createHandler;
|
|
10
|
+
const handlers_1 = require("../handlers");
|
|
11
|
+
const middleware_1 = require("./middleware");
|
|
12
|
+
function createHandler(getSupabase) {
|
|
13
|
+
return async function POST(request) {
|
|
14
|
+
const licenseKey = (0, middleware_1.extractLicenseKey)(request.headers);
|
|
15
|
+
if (!licenseKey)
|
|
16
|
+
return (0, middleware_1.jsonError)('Missing or invalid license key', 401);
|
|
17
|
+
const rl = (0, middleware_1.rateLimit)(licenseKey);
|
|
18
|
+
if (!rl.allowed)
|
|
19
|
+
return (0, middleware_1.jsonError)('Rate limit exceeded', 429);
|
|
20
|
+
let body;
|
|
21
|
+
try {
|
|
22
|
+
body = (await request.json());
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return (0, middleware_1.jsonError)('Invalid JSON body', 400);
|
|
26
|
+
}
|
|
27
|
+
const supabase = getSupabase();
|
|
28
|
+
const result = await (0, handlers_1.handleSignal)(supabase, licenseKey, body);
|
|
29
|
+
if (!result.body.ok)
|
|
30
|
+
return (0, middleware_1.jsonError)(result.body.error ?? 'Unknown error', result.status);
|
|
31
|
+
return (0, middleware_1.jsonSuccess)(result.body.data, result.status);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=signal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal.js","sourceRoot":"","sources":["../../../src/api/routes/signal.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAOH,sCAqBC;AA1BD,0CAA2C;AAG3C,6CAAoF;AAEpF,SAAgB,aAAa,CAAC,WAAiC;IAC7D,OAAO,KAAK,UAAU,IAAI,CAAC,OAAgB;QACzC,MAAM,UAAU,GAAG,IAAA,8BAAiB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,UAAU;YAAE,OAAO,IAAA,sBAAS,EAAC,gCAAgC,EAAE,GAAG,CAAC,CAAC;QAEzE,MAAM,EAAE,GAAG,IAAA,sBAAS,EAAC,UAAU,CAAC,CAAC;QACjC,IAAI,CAAC,EAAE,CAAC,OAAO;YAAE,OAAO,IAAA,sBAAS,EAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;QAE9D,IAAI,IAAmB,CAAC;QACxB,IAAI,CAAC;YACH,IAAI,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAkB,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAA,sBAAS,EAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,IAAA,uBAAY,EAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAE9D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAAE,OAAO,IAAA,sBAAS,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3F,OAAO,IAAA,wBAAW,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export interface ApiRequest {
|
|
2
|
+
body: Record<string, unknown>;
|
|
3
|
+
licenseKey: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ApiResponse<T = unknown> {
|
|
6
|
+
status: number;
|
|
7
|
+
body: {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
data?: T;
|
|
10
|
+
error?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ExecuteRequest {
|
|
14
|
+
session_id: string;
|
|
15
|
+
skill_id: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CompleteRequest {
|
|
18
|
+
session_id: string;
|
|
19
|
+
skill_id: string;
|
|
20
|
+
status: string;
|
|
21
|
+
grade?: string;
|
|
22
|
+
duration_seconds: number;
|
|
23
|
+
summary: string;
|
|
24
|
+
findings_count: number;
|
|
25
|
+
metrics?: Record<string, unknown>;
|
|
26
|
+
downstream_signals?: Array<{
|
|
27
|
+
target_skill: string;
|
|
28
|
+
signal: string;
|
|
29
|
+
condition: string;
|
|
30
|
+
payload?: Record<string, unknown>;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
export interface GateRequest {
|
|
34
|
+
session_id: string;
|
|
35
|
+
action: string;
|
|
36
|
+
skill_id?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SignalRequest {
|
|
39
|
+
session_id: string;
|
|
40
|
+
from_skill: string;
|
|
41
|
+
to_skill: string;
|
|
42
|
+
signal_type: string;
|
|
43
|
+
urgency?: string;
|
|
44
|
+
condition: string;
|
|
45
|
+
message?: string;
|
|
46
|
+
payload?: Record<string, unknown>;
|
|
47
|
+
trigger_id?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface DashboardResponse {
|
|
50
|
+
active_workflows: Array<{
|
|
51
|
+
id: string;
|
|
52
|
+
workflow_name: string;
|
|
53
|
+
status: string;
|
|
54
|
+
steps_completed: number;
|
|
55
|
+
steps_total: number;
|
|
56
|
+
created_at: string;
|
|
57
|
+
}>;
|
|
58
|
+
recent_executions: Array<{
|
|
59
|
+
id: string;
|
|
60
|
+
skill_id: string;
|
|
61
|
+
status: string;
|
|
62
|
+
grade?: string;
|
|
63
|
+
duration_seconds?: number;
|
|
64
|
+
created_at: string;
|
|
65
|
+
}>;
|
|
66
|
+
pending_signals: Array<{
|
|
67
|
+
id: string;
|
|
68
|
+
from_skill: string;
|
|
69
|
+
to_skill: string;
|
|
70
|
+
signal_type: string;
|
|
71
|
+
urgency: string;
|
|
72
|
+
created_at: string;
|
|
73
|
+
}>;
|
|
74
|
+
gate_decisions: Array<{
|
|
75
|
+
id: string;
|
|
76
|
+
gate_id: string;
|
|
77
|
+
action: string;
|
|
78
|
+
decision: string;
|
|
79
|
+
created_at: string;
|
|
80
|
+
}>;
|
|
81
|
+
metrics_summary: {
|
|
82
|
+
total_executions: number;
|
|
83
|
+
success_rate: number;
|
|
84
|
+
active_sessions: number;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE;QACJ,EAAE,EAAE,OAAO,CAAC;QACZ,IAAI,CAAC,EAAE,CAAC,CAAC;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,kBAAkB,CAAC,EAAE,KAAK,CAAC;QACzB,Y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,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,cAAc,EAAE,KAAK,CAAC;QACpB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,eAAe,EAAE;QACf,gBAAgB,EAAE,MAAM,CAAC;QACzB,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AuditEntry } from './types';
|
|
2
|
+
export declare class AuditLogger {
|
|
3
|
+
private logPath;
|
|
4
|
+
private previousHash;
|
|
5
|
+
constructor(logPath: string);
|
|
6
|
+
private getLastHash;
|
|
7
|
+
private computeHash;
|
|
8
|
+
log(sessionId: string, eventType: AuditEntry['event_type'], details: Record<string, unknown>, skillId?: string, workflowId?: string): AuditEntry;
|
|
9
|
+
verify(): {
|
|
10
|
+
valid: boolean;
|
|
11
|
+
entries: number;
|
|
12
|
+
firstInvalid?: number;
|
|
13
|
+
};
|
|
14
|
+
getEntries(filter?: {
|
|
15
|
+
event_type?: AuditEntry['event_type'];
|
|
16
|
+
skill_id?: string;
|
|
17
|
+
since?: string;
|
|
18
|
+
}): AuditEntry[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=audit-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-logger.d.ts","sourceRoot":"","sources":["../src/audit-logger.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAA8E;gBAEtF,OAAO,EAAE,MAAM;IAW3B,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,WAAW;IAKnB,GAAG,CACD,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,UAAU,CAAC,YAAY,CAAC,EACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,UAAU;IAkBb,MAAM,IAAI;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IAuBpE,UAAU,CAAC,MAAM,CAAC,EAAE;QAClB,UAAU,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;QACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,UAAU,EAAE;CAmBjB"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AuditLogger = void 0;
|
|
37
|
+
const crypto_1 = require("crypto");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
class AuditLogger {
|
|
41
|
+
logPath;
|
|
42
|
+
previousHash = '0000000000000000000000000000000000000000000000000000000000000000';
|
|
43
|
+
constructor(logPath) {
|
|
44
|
+
this.logPath = logPath;
|
|
45
|
+
const dir = path.dirname(logPath);
|
|
46
|
+
if (!fs.existsSync(dir)) {
|
|
47
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
48
|
+
}
|
|
49
|
+
if (fs.existsSync(logPath)) {
|
|
50
|
+
this.previousHash = this.getLastHash();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
getLastHash() {
|
|
54
|
+
try {
|
|
55
|
+
const content = fs.readFileSync(this.logPath, 'utf-8').trim();
|
|
56
|
+
if (!content)
|
|
57
|
+
return this.previousHash;
|
|
58
|
+
const lines = content.split('\n').filter(l => l.trim());
|
|
59
|
+
const lastLine = lines[lines.length - 1];
|
|
60
|
+
const entry = JSON.parse(lastLine);
|
|
61
|
+
return entry.integrity_hash;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return this.previousHash;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
computeHash(entry) {
|
|
68
|
+
const payload = JSON.stringify(entry) + this.previousHash;
|
|
69
|
+
return (0, crypto_1.createHash)('sha256').update(payload).digest('hex');
|
|
70
|
+
}
|
|
71
|
+
log(sessionId, eventType, details, skillId, workflowId) {
|
|
72
|
+
const partial = {
|
|
73
|
+
timestamp: new Date().toISOString(),
|
|
74
|
+
session_id: sessionId,
|
|
75
|
+
event_type: eventType,
|
|
76
|
+
details,
|
|
77
|
+
};
|
|
78
|
+
if (skillId)
|
|
79
|
+
partial.skill_id = skillId;
|
|
80
|
+
if (workflowId)
|
|
81
|
+
partial.workflow_id = workflowId;
|
|
82
|
+
const hash = this.computeHash(partial);
|
|
83
|
+
const entry = { ...partial, integrity_hash: hash };
|
|
84
|
+
fs.appendFileSync(this.logPath, JSON.stringify(entry) + '\n', 'utf-8');
|
|
85
|
+
this.previousHash = hash;
|
|
86
|
+
return entry;
|
|
87
|
+
}
|
|
88
|
+
verify() {
|
|
89
|
+
if (!fs.existsSync(this.logPath)) {
|
|
90
|
+
return { valid: true, entries: 0 };
|
|
91
|
+
}
|
|
92
|
+
const lines = fs.readFileSync(this.logPath, 'utf-8').trim().split('\n').filter(l => l.trim());
|
|
93
|
+
let prevHash = '0000000000000000000000000000000000000000000000000000000000000000';
|
|
94
|
+
for (let i = 0; i < lines.length; i++) {
|
|
95
|
+
const entry = JSON.parse(lines[i]);
|
|
96
|
+
const { integrity_hash, ...rest } = entry;
|
|
97
|
+
const payload = JSON.stringify(rest) + prevHash;
|
|
98
|
+
const expected = (0, crypto_1.createHash)('sha256').update(payload).digest('hex');
|
|
99
|
+
if (integrity_hash !== expected) {
|
|
100
|
+
return { valid: false, entries: lines.length, firstInvalid: i };
|
|
101
|
+
}
|
|
102
|
+
prevHash = integrity_hash;
|
|
103
|
+
}
|
|
104
|
+
return { valid: true, entries: lines.length };
|
|
105
|
+
}
|
|
106
|
+
getEntries(filter) {
|
|
107
|
+
if (!fs.existsSync(this.logPath))
|
|
108
|
+
return [];
|
|
109
|
+
const lines = fs.readFileSync(this.logPath, 'utf-8').trim().split('\n').filter(l => l.trim());
|
|
110
|
+
let entries = lines.map(l => JSON.parse(l));
|
|
111
|
+
if (filter?.event_type) {
|
|
112
|
+
entries = entries.filter(e => e.event_type === filter.event_type);
|
|
113
|
+
}
|
|
114
|
+
if (filter?.skill_id) {
|
|
115
|
+
entries = entries.filter(e => e.skill_id === filter.skill_id);
|
|
116
|
+
}
|
|
117
|
+
if (filter?.since) {
|
|
118
|
+
const since = filter.since;
|
|
119
|
+
entries = entries.filter(e => e.timestamp >= since);
|
|
120
|
+
}
|
|
121
|
+
return entries;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.AuditLogger = AuditLogger;
|
|
125
|
+
//# sourceMappingURL=audit-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-logger.js","sourceRoot":"","sources":["../src/audit-logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAoC;AACpC,uCAAyB;AACzB,2CAA6B;AAG7B,MAAa,WAAW;IACd,OAAO,CAAS;IAChB,YAAY,GAAW,kEAAkE,CAAC;IAElG,YAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAA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AQ,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,MAAM,EAAE,KAAK,EAAE,CAAC;YAClB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAC3B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAvGD,kCAuGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-triggers.d.ts","sourceRoot":"","sources":["../src/builtin-triggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,EAmP/C,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUILTIN_TRIGGERS = void 0;
|
|
4
|
+
exports.BUILTIN_TRIGGERS = [
|
|
5
|
+
// Security escalation
|
|
6
|
+
{
|
|
7
|
+
id: 'critical-vuln-to-incident',
|
|
8
|
+
name: 'Critical Vulnerability -> Incident Response',
|
|
9
|
+
when: { skill: 'security-audit', condition: 'findings.any(severity == "critical")' },
|
|
10
|
+
then: { action: 'suggest', target: 'incident-response', urgency: 'immediate', message: 'Critical security vulnerability detected. Consider invoking incident response.' },
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'secret-exposure-to-rollback',
|
|
14
|
+
name: 'Secret Exposure -> Rollback Manager',
|
|
15
|
+
when: { skill: 'security-audit', condition: 'findings.any(type == "exposed_secret")' },
|
|
16
|
+
then: { action: 'suggest', target: 'rollback-manager', urgency: 'immediate', message: 'Exposed secret detected. Consider immediate rotation and rollback.' },
|
|
17
|
+
},
|
|
18
|
+
// Session integrity — PM-session-start-20260416-01 (G3: metadata-over-evidence)
|
|
19
|
+
{
|
|
20
|
+
id: 'session-start-na-claim',
|
|
21
|
+
name: 'Session Start N/A Claim -> Anti-Hallucination Verification',
|
|
22
|
+
when: {
|
|
23
|
+
skill: 'session-start',
|
|
24
|
+
condition: 'findings.any(type == "enforcement_gate_na_without_exclusion_file")',
|
|
25
|
+
},
|
|
26
|
+
then: {
|
|
27
|
+
action: 'suggest',
|
|
28
|
+
target: 'anti-hallucination-agent',
|
|
29
|
+
urgency: 'high',
|
|
30
|
+
message: 'Session-start report claimed a gate is "N/A" but no .project-ai/ENFORCEMENT_EXCLUSIONS.yaml was cited. Verify the claim against filesystem evidence before proceeding.',
|
|
31
|
+
config: { scope: 'registry+code', focus: 'metadata_vs_evidence' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
// Tool affordance mismatch — PM-tool-affordance-20260306-01 (G6: tool-affordance-mismatch)
|
|
35
|
+
// Fires when an evidence probe uses a tool whose sandbox / auth model cannot
|
|
36
|
+
// reach the target class (e.g. WebFetch against a private repo returning 404).
|
|
37
|
+
{
|
|
38
|
+
id: 'tool-affordance-mismatch',
|
|
39
|
+
name: 'Tool Affordance Mismatch -> Anti-Hallucination Verification',
|
|
40
|
+
when: {
|
|
41
|
+
skill: 'any',
|
|
42
|
+
condition: '(tool.name == "WebFetch" AND target.url.matches("private|architect-os|github.com/mawebb001|origin/")) OR (tool.returned_status == 404 AND target.was_declared_private) OR (probe.tool_not_in_affordance_matrix_for_target_class)',
|
|
43
|
+
},
|
|
44
|
+
then: {
|
|
45
|
+
action: 'suggest',
|
|
46
|
+
target: 'anti-hallucination-agent',
|
|
47
|
+
urgency: 'high',
|
|
48
|
+
message: 'Evidence probe used a tool whose affordance does not match the target access class. A null/404 from such a tool is not informative. Re-probe using a tool from the Tool Affordance Matrix in rules/metadata-evidence.mdc whose Can Reach column covers the target.',
|
|
49
|
+
config: { scope: 'tool_selection', focus: 'affordance_matrix' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// Quality chain
|
|
53
|
+
{
|
|
54
|
+
id: 'post-feature-review',
|
|
55
|
+
name: 'Feature Complete -> Code Review + Test Gap',
|
|
56
|
+
when: { skill: 'feature-builder', condition: 'status == "completed"' },
|
|
57
|
+
then: { action: 'suggest', target: ['code-review', 'test-gap-analyzer'], urgency: 'normal', message: 'Feature built. Recommend code review and test quality check.' },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'post-refactor-grounding',
|
|
61
|
+
name: 'Refactor Complete -> Anti-Hallucination Verification',
|
|
62
|
+
when: { skill: 'refactor-agent', condition: 'status == "completed"' },
|
|
63
|
+
then: { action: 'suggest', target: 'anti-hallucination-agent', urgency: 'normal', message: 'Refactoring complete. Recommend grounding verification.', config: { scope: 'code' } },
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'post-scaffold-wiring',
|
|
67
|
+
name: 'Scaffold Complete -> Test Orchestrator',
|
|
68
|
+
when: { skill: 'code-scaffolder', condition: 'status == "completed"' },
|
|
69
|
+
then: { action: 'suggest', target: 'test-orchestrator', urgency: 'low', message: 'New code scaffolded. Recommend running tests to verify wiring.' },
|
|
70
|
+
},
|
|
71
|
+
// Audit chain
|
|
72
|
+
{
|
|
73
|
+
id: 'audit-failure-to-bug-hunter',
|
|
74
|
+
name: 'Pre-Deploy Fail -> Bug Hunter',
|
|
75
|
+
when: { skill: 'pre-deploy-check', condition: 'status == "failed"' },
|
|
76
|
+
then: { action: 'suggest', target: 'bug-hunter', urgency: 'high', message: 'Pre-deploy check failed. Investigate failing checks.' },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'test-gaps-to-bootstrap',
|
|
80
|
+
name: 'Test Gaps Detected -> Bootstrap Testing',
|
|
81
|
+
when: { skill: 'test-gap-analyzer', condition: 'metrics.meaningful_coverage < 0.5' },
|
|
82
|
+
then: { action: 'suggest', target: 'bootstrap-testing', urgency: 'normal', message: 'Significant test quality gaps found. Consider bootstrapping missing test infrastructure.' },
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'stale-docs-to-knowledge-decay',
|
|
86
|
+
name: 'Code Review Finds Stale Comments -> Knowledge Decay',
|
|
87
|
+
when: { skill: 'code-review', condition: 'findings.any(type == "stale_documentation")' },
|
|
88
|
+
then: { action: 'suggest', target: 'knowledge-decay-detector', urgency: 'low', message: 'Stale documentation patterns found in code review.' },
|
|
89
|
+
},
|
|
90
|
+
// RAG and AI
|
|
91
|
+
{
|
|
92
|
+
id: 'rag-grounding-to-hallucination',
|
|
93
|
+
name: 'RAG Grounding Issues -> Anti-Hallucination Agent',
|
|
94
|
+
when: { skill: 'rag-audit', condition: 'findings.any(type == "ungrounded_generation")' },
|
|
95
|
+
then: { action: 'suggest', target: 'anti-hallucination-agent', urgency: 'high', message: 'RAG audit found ungrounded code generation. Recommend full grounding check.' },
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'hallucination-critical-to-review',
|
|
99
|
+
name: 'Hallucination Critical -> Code Review',
|
|
100
|
+
when: { skill: 'anti-hallucination-agent', condition: 'findings.any(type == "fabricated_reference" AND severity == "critical")' },
|
|
101
|
+
then: { action: 'require', target: 'code-review', urgency: 'high', message: 'Critical fabricated references found. Code review required before proceeding.' },
|
|
102
|
+
},
|
|
103
|
+
// Operations
|
|
104
|
+
{
|
|
105
|
+
id: 'incident-to-rollback',
|
|
106
|
+
name: 'SEV1 Incident -> Rollback Manager',
|
|
107
|
+
when: { skill: 'incident-response', condition: 'metrics.severity == "SEV1"' },
|
|
108
|
+
then: { action: 'suggest', target: 'rollback-manager', urgency: 'immediate', message: 'SEV1 incident. Rollback plan recommended.' },
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'rollback-to-tests',
|
|
112
|
+
name: 'Rollback Complete -> Test Orchestrator',
|
|
113
|
+
when: { skill: 'rollback-manager', condition: 'status == "completed"' },
|
|
114
|
+
then: { action: 'suggest', target: 'test-orchestrator', urgency: 'high', message: 'Rollback executed. Verify system health with test suite.' },
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'deploy-pass-to-changelog',
|
|
118
|
+
name: 'Deploy Check Pass -> Changelog',
|
|
119
|
+
when: { skill: 'pre-deploy-check', condition: 'grade == "PASS"' },
|
|
120
|
+
then: { action: 'suggest', target: 'changelog-generator', urgency: 'low', message: 'Deploy check passed. Generate release notes?' },
|
|
121
|
+
},
|
|
122
|
+
// Security & compliance
|
|
123
|
+
{
|
|
124
|
+
id: 'threat-to-hardening',
|
|
125
|
+
name: 'Threat Model Complete -> Security Hardening',
|
|
126
|
+
when: { skill: 'threat-modeling-agent', condition: 'findings.any(risk_level == "critical")' },
|
|
127
|
+
then: { action: 'suggest', target: 'security-hardening-agent', urgency: 'high', message: 'Critical threats identified. Recommend hardening assessment.' },
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: 'hardening-to-compliance',
|
|
131
|
+
name: 'Hardening Complete -> Compliance Mapper',
|
|
132
|
+
when: { skill: 'security-hardening-agent', condition: 'status == "completed"' },
|
|
133
|
+
then: { action: 'suggest', target: 'compliance-mapper', urgency: 'normal', message: 'Hardening assessment complete. Map findings to compliance frameworks.' },
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'compliance-gaps-to-builder',
|
|
137
|
+
name: 'Compliance Gaps -> Compliance Builder',
|
|
138
|
+
when: { skill: 'compliance-mapper', condition: 'metrics.gap_count > 0' },
|
|
139
|
+
then: { action: 'suggest', target: 'compliance-builder', urgency: 'normal', message: 'Compliance gaps detected. Generate missing controls and policies.' },
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'sox-material-weakness',
|
|
143
|
+
name: 'SOX Material Weakness -> Incident Response',
|
|
144
|
+
when: { skill: 'sox-compliance-agent', condition: 'findings.any(type == "material_weakness")' },
|
|
145
|
+
then: { action: 'require', target: 'incident-response', urgency: 'immediate', message: 'Material weakness detected. Requires immediate remediation per SOX requirements.' },
|
|
146
|
+
},
|
|
147
|
+
// UX & visual
|
|
148
|
+
{
|
|
149
|
+
id: 'ux-catastrophe-to-feature',
|
|
150
|
+
name: 'UX Catastrophe -> Feature Builder',
|
|
151
|
+
when: { skill: 'ux-heuristic-evaluator', condition: 'findings.any(severity >= 4)' },
|
|
152
|
+
then: { action: 'suggest', target: 'feature-builder', urgency: 'high', message: 'Usability catastrophe found. Prevents task completion.' },
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 'design-drift-to-refactor',
|
|
156
|
+
name: 'Design Token Drift -> Refactor Agent',
|
|
157
|
+
when: { skill: 'design-system-auditor', condition: 'metrics.hardcoded_values > 20' },
|
|
158
|
+
then: { action: 'suggest', target: 'refactor-agent', urgency: 'normal', message: 'Significant design system drift. Recommend batch token migration.' },
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'visual-regression-block',
|
|
162
|
+
name: 'Visual Regression -> Block Deploy',
|
|
163
|
+
when: { skill: 'visual-regression-agent', condition: 'findings.any(type == "regression_critical")' },
|
|
164
|
+
then: { action: 'require', target: 'pre-deploy-check', urgency: 'high', message: 'Critical visual regression blocks deployment.' },
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'advanced-uat-bypass',
|
|
168
|
+
name: 'Destructive Action Bypass -> Security Audit',
|
|
169
|
+
when: { skill: 'advanced-uat-agent', condition: 'findings.any(type == "destructive_action_bypass")' },
|
|
170
|
+
then: { action: 'require', target: 'security-audit', urgency: 'immediate', message: 'Destructive action bypass detected. Security review required.' },
|
|
171
|
+
},
|
|
172
|
+
// Business & strategy
|
|
173
|
+
{
|
|
174
|
+
id: 'prd-to-feature',
|
|
175
|
+
name: 'PRD Approved -> Feature Builder',
|
|
176
|
+
when: { skill: 'product-requirements-builder', condition: 'status == "completed"' },
|
|
177
|
+
then: { action: 'suggest', target: 'feature-builder', urgency: 'normal', message: 'PRD generated. Ready for implementation.' },
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 'business-model-to-gtm',
|
|
181
|
+
name: 'Business Analysis -> Go-To-Market',
|
|
182
|
+
when: { skill: 'business-model-analyzer', condition: 'status == "completed"' },
|
|
183
|
+
then: { action: 'suggest', target: 'go-to-market-builder', urgency: 'low', message: 'Business model analyzed. Recommend building GTM strategy.' },
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: 'policy-to-access',
|
|
187
|
+
name: 'Policy Gates -> Skill Access Controls',
|
|
188
|
+
when: { skill: 'policy-gate-manager', condition: 'status == "completed"' },
|
|
189
|
+
then: { action: 'suggest', target: 'skill-access-manager', urgency: 'normal', message: 'Policy gates defined. Align role-based skill access.' },
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 'procurement-gap-to-security',
|
|
193
|
+
name: 'Procurement Gap -> Security Audit',
|
|
194
|
+
when: { skill: 'procurement-security-questionnaire-builder', condition: 'findings.any(type == "control_gap")' },
|
|
195
|
+
then: { action: 'require', target: 'security-audit', urgency: 'high', message: 'Buyer-facing control gap detected. Security review required.' },
|
|
196
|
+
},
|
|
197
|
+
// Self-improving loop
|
|
198
|
+
{
|
|
199
|
+
id: 'hallucination-miss-to-postmortem',
|
|
200
|
+
name: 'Hallucination Agent Correction -> Post-Mortem',
|
|
201
|
+
when: { skill: 'anti-hallucination-agent', condition: 'downstream_signals.any(condition == "user_correction_received")' },
|
|
202
|
+
then: { action: 'require', target: 'agent-post-mortem', urgency: 'high', message: 'Anti-hallucination agent received a user correction. Post-mortem required.' },
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: 'bug-miss-to-postmortem',
|
|
206
|
+
name: 'Bug Hunter Correction -> Post-Mortem',
|
|
207
|
+
when: { skill: 'bug-hunter', condition: 'downstream_signals.any(condition == "user_correction_received")' },
|
|
208
|
+
then: { action: 'require', target: 'agent-post-mortem', urgency: 'high', message: 'Bug hunter received a user correction. Post-mortem required.' },
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: 'security-miss-to-postmortem',
|
|
212
|
+
name: 'Security Audit Correction -> Post-Mortem',
|
|
213
|
+
when: { skill: 'security-audit', condition: 'downstream_signals.any(condition == "user_correction_received")' },
|
|
214
|
+
then: { action: 'require', target: 'agent-post-mortem', urgency: 'high', message: 'Security audit correction. Post-mortem required.' },
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: 'postmortem-to-skill-learner',
|
|
218
|
+
name: 'Post-Mortem Patch -> Skill Learner',
|
|
219
|
+
when: { skill: 'agent-post-mortem', condition: 'downstream_signals.any(condition == "patch_proposal_ready")' },
|
|
220
|
+
then: { action: 'suggest', target: 'skill-learner', urgency: 'normal', message: 'Post-mortem generated a patch proposal. Skill learner can validate and stage it.' },
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: 'skill-fix-staged-to-project-manager',
|
|
224
|
+
name: 'Skill Patch Staged -> Project Manager',
|
|
225
|
+
when: { skill: 'skill-learner', condition: 'status == "patch_staged"' },
|
|
226
|
+
then: { action: 'suggest', target: 'project-manager', urgency: 'normal', message: 'A skill patch has been staged for review.' },
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: 'vector-disagreement-to-postmortem',
|
|
230
|
+
name: 'Vector Disagreement -> Post-Mortem',
|
|
231
|
+
when: { skill: 'anti-hallucination-agent OR bug-hunter OR security-audit', condition: 'findings.any(confidence == "DISPUTED")' },
|
|
232
|
+
then: { action: 'suggest', target: 'agent-post-mortem', urgency: 'normal', message: 'Verification vectors disagreed. Post-mortem recommended.' },
|
|
233
|
+
},
|
|
234
|
+
];
|
|
235
|
+
//# sourceMappingURL=builtin-triggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-triggers.js","sourceRoot":"","sources":["../src/builtin-triggers.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAwB;IACnD,sBAAsB;IACtB;QACE,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,6CAA6C;QACnD,IAAI,EAAE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