@nexusclawhq/cli 0.3.53 → 0.3.54
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/build-info.json +4 -4
- package/dist/nexus-cli/src/cli.js +1 -1
- package/dist/nexus-cli/src/cli.js.map +1 -1
- package/dist/nexus-cli/src/runtime/failure-normalizer.d.ts +1 -0
- package/dist/nexus-cli/src/runtime/failure-normalizer.js +46 -3
- package/dist/nexus-cli/src/runtime/failure-normalizer.js.map +1 -1
- package/dist/nexus-cli/src/runtime/failure-normalizer.test.js +15 -0
- package/dist/nexus-cli/src/runtime/failure-normalizer.test.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-bundle-remote.d.ts +1 -1
- package/dist/nexus-cli/src/services/workforce-test-remote.d.ts +1 -1
- package/dist/nexus-cli/src/services/workforce-test-remote.js +1 -1
- package/dist/nexus-cli/src/services/workforce-test-remote.test.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.schemas.d.ts +0 -38
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.schemas.js +0 -502
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.schemas.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.types.d.ts +0 -191
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.types.js +0 -3
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.types.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/context-selection.schemas.d.ts +0 -4
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/context-selection.schemas.js +0 -53
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/context-selection.schemas.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/context-selection.types.d.ts +0 -37
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/context-selection.types.js +0 -3
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/context-selection.types.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/contract-versions.d.ts +0 -19
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/contract-versions.js +0 -42
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/contract-versions.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/controlled-memory.schemas.d.ts +0 -12
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/controlled-memory.schemas.js +0 -161
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/controlled-memory.schemas.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/controlled-memory.types.d.ts +0 -44
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/controlled-memory.types.js +0 -3
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/controlled-memory.types.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/goal-snapshot.schemas.d.ts +0 -5
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/goal-snapshot.schemas.js +0 -81
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/goal-snapshot.schemas.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/goal-snapshot.types.d.ts +0 -61
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/goal-snapshot.types.js +0 -3
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/goal-snapshot.types.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/index.d.ts +0 -15
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/index.js +0 -32
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/index.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/proactive-decision.schemas.d.ts +0 -9
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/proactive-decision.schemas.js +0 -170
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/proactive-decision.schemas.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/proactive-decision.types.d.ts +0 -98
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/proactive-decision.types.js +0 -3
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/proactive-decision.types.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/success-evaluation.schemas.d.ts +0 -21
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/success-evaluation.schemas.js +0 -157
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/success-evaluation.schemas.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/success-evaluation.types.d.ts +0 -47
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/success-evaluation.types.js +0 -3
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/success-evaluation.types.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/training-evidence.schemas.d.ts +0 -19
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/training-evidence.schemas.js +0 -177
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/training-evidence.schemas.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/training-evidence.types.d.ts +0 -66
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/training-evidence.types.js +0 -3
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/training-evidence.types.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-runtime/index.d.ts +0 -53
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-runtime/index.js +0 -42
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-runtime/index.js.map +0 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-workforce-learning/index.d.ts +0 -743
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-workforce-learning/index.js +0 -1261
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-workforce-learning/index.js.map +0 -1
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EVALUATION_LIFECYCLE_TRANSITIONS = exports.successEvaluationRecordSchema = void 0;
|
|
4
|
-
exports.canTransitionEvaluationLifecycle = canTransitionEvaluationLifecycle;
|
|
5
|
-
exports.scoreSuccessEvaluationVector = scoreSuccessEvaluationVector;
|
|
6
|
-
const cognitive_policy_schemas_1 = require("./cognitive-policy.schemas");
|
|
7
|
-
exports.successEvaluationRecordSchema = {
|
|
8
|
-
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
9
|
-
$id: 'schema://nexusclaw/success-evaluation-record/v1',
|
|
10
|
-
type: 'object',
|
|
11
|
-
additionalProperties: false,
|
|
12
|
-
required: [
|
|
13
|
-
'schemaVersion',
|
|
14
|
-
'evaluationId',
|
|
15
|
-
'revision',
|
|
16
|
-
'workspaceId',
|
|
17
|
-
'executionId',
|
|
18
|
-
'goalSnapshotId',
|
|
19
|
-
'lineage',
|
|
20
|
-
'lifecycle',
|
|
21
|
-
'review',
|
|
22
|
-
'decision',
|
|
23
|
-
'criteria',
|
|
24
|
-
'hardGatePassed',
|
|
25
|
-
'evidenceCompleteness',
|
|
26
|
-
'confidence',
|
|
27
|
-
'evidenceRefs',
|
|
28
|
-
'idempotencyKeyHash',
|
|
29
|
-
'createdAt',
|
|
30
|
-
'digest',
|
|
31
|
-
],
|
|
32
|
-
properties: {
|
|
33
|
-
schemaVersion: { const: 'success-evaluation-record/v1' },
|
|
34
|
-
evaluationId: { type: 'string', minLength: 1 },
|
|
35
|
-
revision: { type: 'integer', minimum: 1 },
|
|
36
|
-
previousEvaluationId: { type: 'string', minLength: 1 },
|
|
37
|
-
supersedesEvaluationId: { type: 'string', minLength: 1 },
|
|
38
|
-
workspaceId: { type: 'string', minLength: 1 },
|
|
39
|
-
executionId: { type: 'string', minLength: 1 },
|
|
40
|
-
goalSnapshotId: { type: 'string', minLength: 1 },
|
|
41
|
-
lineage: { type: 'object' },
|
|
42
|
-
lifecycle: { enum: ['pending', 'provisional', 'final', 'superseded'] },
|
|
43
|
-
review: {
|
|
44
|
-
enum: [
|
|
45
|
-
'none',
|
|
46
|
-
'open',
|
|
47
|
-
'resolved_upheld',
|
|
48
|
-
'resolved_adjusted',
|
|
49
|
-
'resolved_rejected',
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
decision: {
|
|
53
|
-
enum: [
|
|
54
|
-
'passed',
|
|
55
|
-
'failed',
|
|
56
|
-
'partial',
|
|
57
|
-
'insufficient_evidence',
|
|
58
|
-
'blocked',
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
criteria: { type: 'array' },
|
|
62
|
-
hardGatePassed: { type: 'boolean' },
|
|
63
|
-
softUtility: { type: 'number' },
|
|
64
|
-
outcomeParticipation: { type: 'object' },
|
|
65
|
-
evidenceCompleteness: { type: 'number', minimum: 0, maximum: 1 },
|
|
66
|
-
confidence: { type: 'number', minimum: 0, maximum: 1 },
|
|
67
|
-
evidenceRefs: { type: 'array' },
|
|
68
|
-
idempotencyKeyHash: { type: 'string', pattern: cognitive_policy_schemas_1.COGNITION_SHA256_PATTERN },
|
|
69
|
-
createdAt: { type: 'string', minLength: 1 },
|
|
70
|
-
digest: { type: 'string', pattern: cognitive_policy_schemas_1.COGNITION_SHA256_PATTERN },
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
exports.EVALUATION_LIFECYCLE_TRANSITIONS = {
|
|
74
|
-
pending: ['provisional', 'final'],
|
|
75
|
-
provisional: ['provisional', 'final', 'superseded'],
|
|
76
|
-
final: ['superseded'],
|
|
77
|
-
superseded: [],
|
|
78
|
-
};
|
|
79
|
-
function canTransitionEvaluationLifecycle(from, to) {
|
|
80
|
-
return exports.EVALUATION_LIFECYCLE_TRANSITIONS[from].includes(to);
|
|
81
|
-
}
|
|
82
|
-
function scoreSuccessEvaluationVector(input) {
|
|
83
|
-
const byCode = new Map(input.criteria.map((item) => [item.criterionCode, item]));
|
|
84
|
-
const required = input.contract.criteria;
|
|
85
|
-
const completeCount = required.filter((item) => {
|
|
86
|
-
const evidence = byCode.get(item.code);
|
|
87
|
-
return (evidence &&
|
|
88
|
-
evidence.status !== 'missing' &&
|
|
89
|
-
evidence.status !== 'not_due' &&
|
|
90
|
-
evidence.evidenceRefs.length >= item.evidence.minimumSampleSize);
|
|
91
|
-
}).length;
|
|
92
|
-
const evidenceCompleteness = required.length === 0 ? 0 : completeCount / required.length;
|
|
93
|
-
const hardCriteria = required.filter((item) => item.hardGate);
|
|
94
|
-
const hardGateFailed = hardCriteria.some((item) => {
|
|
95
|
-
const status = byCode.get(item.code)?.status;
|
|
96
|
-
return status === 'failed' || status === 'partial';
|
|
97
|
-
});
|
|
98
|
-
if (hardGateFailed) {
|
|
99
|
-
return {
|
|
100
|
-
lifecycle: input.laggingWindowComplete ? 'final' : 'provisional',
|
|
101
|
-
decision: 'blocked',
|
|
102
|
-
hardGatePassed: false,
|
|
103
|
-
evidenceCompleteness,
|
|
104
|
-
effectiveNormalizedWeights: {},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const missingRequired = required.some((item) => {
|
|
108
|
-
const evidence = byCode.get(item.code);
|
|
109
|
-
return (!evidence ||
|
|
110
|
-
evidence.status === 'missing' ||
|
|
111
|
-
evidence.status === 'not_due' ||
|
|
112
|
-
evidence.evidenceRefs.length < item.evidence.minimumSampleSize);
|
|
113
|
-
});
|
|
114
|
-
if (missingRequired) {
|
|
115
|
-
return {
|
|
116
|
-
lifecycle: 'pending',
|
|
117
|
-
decision: 'insufficient_evidence',
|
|
118
|
-
hardGatePassed: false,
|
|
119
|
-
evidenceCompleteness,
|
|
120
|
-
effectiveNormalizedWeights: {},
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const hardGatePassed = hardCriteria.every((item) => byCode.get(item.code)?.status === 'passed');
|
|
124
|
-
const soft = required.filter((item) => !item.hardGate);
|
|
125
|
-
const totalWeight = soft.reduce((sum, item) => sum + (item.softWeight ?? 0), 0);
|
|
126
|
-
if (soft.length === 0 || totalWeight <= 0) {
|
|
127
|
-
return {
|
|
128
|
-
lifecycle: input.laggingWindowComplete &&
|
|
129
|
-
(!input.contract.reviewPolicy.requiredForFinal ||
|
|
130
|
-
input.requiredHumanReviewComplete)
|
|
131
|
-
? 'final'
|
|
132
|
-
: 'provisional',
|
|
133
|
-
decision: 'passed',
|
|
134
|
-
hardGatePassed: true,
|
|
135
|
-
softUtility: 1,
|
|
136
|
-
evidenceCompleteness,
|
|
137
|
-
effectiveNormalizedWeights: {},
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
const effectiveNormalizedWeights = Object.fromEntries(soft.map((item) => [item.code, (item.softWeight ?? 0) / totalWeight]));
|
|
141
|
-
const softUtility = soft.reduce((sum, item) => {
|
|
142
|
-
const score = byCode.get(item.code)?.normalizedScore ?? 0;
|
|
143
|
-
return sum + score * effectiveNormalizedWeights[item.code];
|
|
144
|
-
}, 0);
|
|
145
|
-
const finalAllowed = input.laggingWindowComplete &&
|
|
146
|
-
(!input.contract.reviewPolicy.requiredForFinal ||
|
|
147
|
-
input.requiredHumanReviewComplete);
|
|
148
|
-
return {
|
|
149
|
-
lifecycle: finalAllowed ? 'final' : 'provisional',
|
|
150
|
-
decision: softUtility >= 1 ? 'passed' : softUtility <= 0 ? 'failed' : 'partial',
|
|
151
|
-
hardGatePassed: true,
|
|
152
|
-
softUtility,
|
|
153
|
-
evidenceCompleteness,
|
|
154
|
-
effectiveNormalizedWeights,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=success-evaluation.schemas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"success-evaluation.schemas.js","sourceRoot":"","sources":["../../src/ai-employee-cognition/success-evaluation.schemas.ts"],"names":[],"mappings":";;;AAuFA,4EAKC;AAUD,oEAkGC;AA/LD,yEAAsE;AAEzD,QAAA,6BAA6B,GAAoB;IAC5D,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,iDAAiD;IACtD,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE;QACR,eAAe;QACf,cAAc;QACd,UAAU;QACV,aAAa;QACb,aAAa;QACb,gBAAgB;QAChB,SAAS;QACT,WAAW;QACX,QAAQ;QACR,UAAU;QACV,UAAU;QACV,gBAAgB;QAChB,sBAAsB;QACtB,YAAY;QACZ,cAAc;QACd,oBAAoB;QACpB,WAAW;QACX,QAAQ;KACT;IACD,UAAU,EAAE;QACV,aAAa,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE;QACxD,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ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,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC;QAC1D,OAAO,GAAG,GAAG,KAAK,GAAG,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC;IAC9D,CAAC,EAAE,CAAC,CAAC,CAAC;IACN,MAAM,YAAY,GAChB,KAAK,CAAC,qBAAqB;QAC3B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,gBAAgB;YAC5C,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvC,OAAO;QACL,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa;QACjD,QAAQ,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QAC/E,cAAc,EAAE,IAAI;QACpB,WAAW;QACX,oBAAoB;QACpB,0BAA0B;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { TypedEvidenceRefV1 } from './cognitive-policy.types';
|
|
2
|
-
import type { Sha256Digest } from '../agent-executable-assets/canonical-hash';
|
|
3
|
-
export type EvaluationLifecycleV1 = 'pending' | 'provisional' | 'final' | 'superseded';
|
|
4
|
-
export type EvaluationReviewV1 = 'none' | 'open' | 'resolved_upheld' | 'resolved_adjusted' | 'resolved_rejected';
|
|
5
|
-
export type EvaluationDecisionV1 = 'passed' | 'failed' | 'partial' | 'insufficient_evidence' | 'blocked';
|
|
6
|
-
export interface CriterionEvaluationV1 {
|
|
7
|
-
criterionCode: string;
|
|
8
|
-
status: 'passed' | 'failed' | 'partial' | 'missing' | 'not_due';
|
|
9
|
-
rawValue?: number | string | boolean;
|
|
10
|
-
normalizedScore?: number;
|
|
11
|
-
effectiveNormalizedWeight?: number;
|
|
12
|
-
hardGate: boolean;
|
|
13
|
-
evidenceRefs: TypedEvidenceRefV1[];
|
|
14
|
-
confidence: number;
|
|
15
|
-
}
|
|
16
|
-
export interface SuccessEvaluationRecordV1 {
|
|
17
|
-
schemaVersion: 'success-evaluation-record/v1';
|
|
18
|
-
evaluationId: string;
|
|
19
|
-
revision: number;
|
|
20
|
-
previousEvaluationId?: string;
|
|
21
|
-
supersedesEvaluationId?: string;
|
|
22
|
-
workspaceId: string;
|
|
23
|
-
executionId: string;
|
|
24
|
-
goalSnapshotId: string;
|
|
25
|
-
lineage: {
|
|
26
|
-
releaseSetId: string;
|
|
27
|
-
agentVersionId: string;
|
|
28
|
-
successContractDigest: Sha256Digest;
|
|
29
|
-
evaluatorVersion: string;
|
|
30
|
-
};
|
|
31
|
-
lifecycle: EvaluationLifecycleV1;
|
|
32
|
-
review: EvaluationReviewV1;
|
|
33
|
-
decision: EvaluationDecisionV1;
|
|
34
|
-
criteria: CriterionEvaluationV1[];
|
|
35
|
-
hardGatePassed: boolean;
|
|
36
|
-
softUtility?: number;
|
|
37
|
-
outcomeParticipation?: {
|
|
38
|
-
outcomeEventId: string;
|
|
39
|
-
attributionConfidence?: number;
|
|
40
|
-
};
|
|
41
|
-
evidenceCompleteness: number;
|
|
42
|
-
confidence: number;
|
|
43
|
-
evidenceRefs: TypedEvidenceRefV1[];
|
|
44
|
-
idempotencyKeyHash: Sha256Digest;
|
|
45
|
-
createdAt: string;
|
|
46
|
-
digest: Sha256Digest;
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"success-evaluation.types.js","sourceRoot":"","sources":["../../src/ai-employee-cognition/success-evaluation.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CognitiveDatasetManifestV1, TeacherEvidenceRefV1, TrainingTrajectoryV1 } from './training-evidence.types';
|
|
2
|
-
import { type CognitionValidationResultV1 } from './cognitive-policy.schemas';
|
|
3
|
-
import type { AnySchemaObject } from 'ajv';
|
|
4
|
-
export declare const trainingTrajectorySchema: AnySchemaObject;
|
|
5
|
-
export declare const cognitiveDatasetManifestSchema: AnySchemaObject;
|
|
6
|
-
export declare function datasetEligibilityForTrajectory(trajectory: TrainingTrajectoryV1, input: {
|
|
7
|
-
evaluationLifecycle: 'pending' | 'provisional' | 'final' | 'superseded';
|
|
8
|
-
reviewOpen: boolean;
|
|
9
|
-
lineageComplete: boolean;
|
|
10
|
-
humanCorrectionVerified: boolean;
|
|
11
|
-
}): 'blocked' | 'ready_for_review';
|
|
12
|
-
export declare function validateDatasetManifest(value: unknown): CognitionValidationResultV1<CognitiveDatasetManifestV1>;
|
|
13
|
-
export declare function hasSplitLeakage(examples: ReadonlyArray<{
|
|
14
|
-
leakageGroup: string;
|
|
15
|
-
split: string;
|
|
16
|
-
}>): boolean;
|
|
17
|
-
export declare function validateTeacherEvidenceRef(evidence: TeacherEvidenceRefV1): CognitionValidationResultV1<TeacherEvidenceRefV1>;
|
|
18
|
-
export declare function trainingTrajectoryDigest(trajectory: Omit<TrainingTrajectoryV1, 'digest'>): `sha256:${string}`;
|
|
19
|
-
export declare function cognitiveDatasetManifestDigest(manifest: Omit<CognitiveDatasetManifestV1, 'digest'>): `sha256:${string}`;
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cognitiveDatasetManifestSchema = exports.trainingTrajectorySchema = void 0;
|
|
4
|
-
exports.datasetEligibilityForTrajectory = datasetEligibilityForTrajectory;
|
|
5
|
-
exports.validateDatasetManifest = validateDatasetManifest;
|
|
6
|
-
exports.hasSplitLeakage = hasSplitLeakage;
|
|
7
|
-
exports.validateTeacherEvidenceRef = validateTeacherEvidenceRef;
|
|
8
|
-
exports.trainingTrajectoryDigest = trainingTrajectoryDigest;
|
|
9
|
-
exports.cognitiveDatasetManifestDigest = cognitiveDatasetManifestDigest;
|
|
10
|
-
const canonical_hash_1 = require("../agent-executable-assets/canonical-hash");
|
|
11
|
-
const cognitive_policy_schemas_1 = require("./cognitive-policy.schemas");
|
|
12
|
-
exports.trainingTrajectorySchema = {
|
|
13
|
-
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
14
|
-
$id: 'schema://nexusclaw/training-trajectory/v1',
|
|
15
|
-
type: 'object',
|
|
16
|
-
additionalProperties: false,
|
|
17
|
-
required: [
|
|
18
|
-
'schemaVersion',
|
|
19
|
-
'trajectoryId',
|
|
20
|
-
'workspaceId',
|
|
21
|
-
'goalSnapshotRef',
|
|
22
|
-
'contextManifestRefs',
|
|
23
|
-
'sequenceRefs',
|
|
24
|
-
'finalEvaluationRef',
|
|
25
|
-
'label',
|
|
26
|
-
'scoreVector',
|
|
27
|
-
'lineageDigest',
|
|
28
|
-
'consent',
|
|
29
|
-
'piiStatus',
|
|
30
|
-
'retentionTier',
|
|
31
|
-
'leakageGroup',
|
|
32
|
-
'split',
|
|
33
|
-
'qualityStatus',
|
|
34
|
-
'digest',
|
|
35
|
-
],
|
|
36
|
-
properties: {
|
|
37
|
-
schemaVersion: { const: 'training-trajectory/v1' },
|
|
38
|
-
trajectoryId: { type: 'string', minLength: 1 },
|
|
39
|
-
workspaceId: { type: 'string', minLength: 1 },
|
|
40
|
-
goalSnapshotRef: { type: 'object' },
|
|
41
|
-
contextManifestRefs: { type: 'array' },
|
|
42
|
-
sequenceRefs: { type: 'array' },
|
|
43
|
-
correctionRef: { type: 'object' },
|
|
44
|
-
finalEvaluationRef: { type: 'object' },
|
|
45
|
-
label: {
|
|
46
|
-
enum: [
|
|
47
|
-
'positive',
|
|
48
|
-
'negative',
|
|
49
|
-
'partial',
|
|
50
|
-
'no_action_correct',
|
|
51
|
-
'human_corrected',
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
scoreVector: { type: 'object' },
|
|
55
|
-
lineageDigest: { type: 'string' },
|
|
56
|
-
consent: { type: 'object' },
|
|
57
|
-
piiStatus: { enum: ['redacted', 'blocked'] },
|
|
58
|
-
retentionTier: { type: 'string' },
|
|
59
|
-
leakageGroup: { type: 'string' },
|
|
60
|
-
split: { enum: ['train', 'validation', 'test', 'holdout'] },
|
|
61
|
-
multimodalEvidenceRefs: { type: 'array' },
|
|
62
|
-
qualityStatus: { enum: ['candidate', 'approved', 'rejected'] },
|
|
63
|
-
digest: { type: 'string' },
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
exports.cognitiveDatasetManifestSchema = {
|
|
67
|
-
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
68
|
-
$id: 'schema://nexusclaw/cognitive-dataset-manifest/v1',
|
|
69
|
-
type: 'object',
|
|
70
|
-
additionalProperties: false,
|
|
71
|
-
required: [
|
|
72
|
-
'schemaVersion',
|
|
73
|
-
'datasetId',
|
|
74
|
-
'version',
|
|
75
|
-
'purpose',
|
|
76
|
-
'exampleRefs',
|
|
77
|
-
'splitPolicyDigest',
|
|
78
|
-
'sourceQueryDigest',
|
|
79
|
-
'consentPolicyVersion',
|
|
80
|
-
'createdBy',
|
|
81
|
-
'digest',
|
|
82
|
-
],
|
|
83
|
-
properties: {
|
|
84
|
-
schemaVersion: { const: 'cognitive-dataset-manifest/v1' },
|
|
85
|
-
datasetId: { type: 'string', minLength: 1 },
|
|
86
|
-
version: { type: 'string', minLength: 1 },
|
|
87
|
-
purpose: { enum: ['sft', 'preference', 'value', 'evaluation'] },
|
|
88
|
-
exampleRefs: { type: 'array' },
|
|
89
|
-
splitPolicyDigest: { type: 'string' },
|
|
90
|
-
sourceQueryDigest: { type: 'string' },
|
|
91
|
-
consentPolicyVersion: { type: 'string' },
|
|
92
|
-
createdBy: { type: 'string' },
|
|
93
|
-
approvedBy: { type: 'string' },
|
|
94
|
-
digest: { type: 'string' },
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
function datasetEligibilityForTrajectory(trajectory, input) {
|
|
98
|
-
if (input.evaluationLifecycle !== 'final' ||
|
|
99
|
-
input.reviewOpen ||
|
|
100
|
-
!input.lineageComplete ||
|
|
101
|
-
trajectory.consent.status !== 'allowed' ||
|
|
102
|
-
trajectory.piiStatus !== 'redacted' ||
|
|
103
|
-
((trajectory.label === 'human_corrected') && !input.humanCorrectionVerified)) {
|
|
104
|
-
return 'blocked';
|
|
105
|
-
}
|
|
106
|
-
return 'ready_for_review';
|
|
107
|
-
}
|
|
108
|
-
function validateDatasetManifest(value) {
|
|
109
|
-
const issues = (0, cognitive_policy_schemas_1.findForbiddenCognitionPayload)(value);
|
|
110
|
-
const manifest = value;
|
|
111
|
-
if (!manifest ||
|
|
112
|
-
manifest.schemaVersion !== 'cognitive-dataset-manifest/v1' ||
|
|
113
|
-
!manifest.datasetId ||
|
|
114
|
-
!manifest.version ||
|
|
115
|
-
!Array.isArray(manifest.exampleRefs)) {
|
|
116
|
-
issues.push({
|
|
117
|
-
code: 'DATASET_SAMPLE_INELIGIBLE',
|
|
118
|
-
jsonPath: '/',
|
|
119
|
-
message: 'Dataset identity, version, and examples are required',
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return issues.length
|
|
123
|
-
? { valid: false, issues }
|
|
124
|
-
: { valid: true, value: value, issues };
|
|
125
|
-
}
|
|
126
|
-
function hasSplitLeakage(examples) {
|
|
127
|
-
const splits = new Map();
|
|
128
|
-
for (const example of examples) {
|
|
129
|
-
const existing = splits.get(example.leakageGroup);
|
|
130
|
-
if (existing && existing !== example.split)
|
|
131
|
-
return true;
|
|
132
|
-
splits.set(example.leakageGroup, example.split);
|
|
133
|
-
}
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
function validateTeacherEvidenceRef(evidence) {
|
|
137
|
-
const issues = (0, cognitive_policy_schemas_1.findForbiddenCognitionPayload)(evidence);
|
|
138
|
-
if (evidence.schemaVersion !== 'teacher-evidence-ref/v1' ||
|
|
139
|
-
!evidence.contentDocumentId ||
|
|
140
|
-
!evidence.contentVersionId ||
|
|
141
|
-
!/^sha256:[0-9a-f]{64}$/u.test(evidence.contentDigest)) {
|
|
142
|
-
issues.push({
|
|
143
|
-
code: 'TEACHER_EVIDENCE_FILE_CONTRACT_INVALID',
|
|
144
|
-
jsonPath: '/',
|
|
145
|
-
message: 'Teacher evidence must reference ContentDocument/ContentVersion and a byte digest',
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
if (evidence.consent.status !== 'allowed' ||
|
|
149
|
-
evidence.piiStatus !== 'redacted' ||
|
|
150
|
-
evidence.annotationStatus !== 'approved') {
|
|
151
|
-
issues.push({
|
|
152
|
-
code: 'TEACHER_EVIDENCE_GOVERNANCE_BLOCKED',
|
|
153
|
-
jsonPath: '/',
|
|
154
|
-
message: 'Teacher evidence requires consent, redaction, and approved annotations',
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
if (evidence.segments.length === 0 ||
|
|
158
|
-
evidence.segments.some((segment) => segment.startMs !== undefined &&
|
|
159
|
-
segment.endMs !== undefined &&
|
|
160
|
-
segment.startMs >= segment.endMs)) {
|
|
161
|
-
issues.push({
|
|
162
|
-
code: 'TEACHER_EVIDENCE_SEGMENT_INVALID',
|
|
163
|
-
jsonPath: '/segments',
|
|
164
|
-
message: 'Teacher evidence requires ordered annotated segments',
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
return issues.length
|
|
168
|
-
? { valid: false, issues }
|
|
169
|
-
: { valid: true, value: evidence, issues };
|
|
170
|
-
}
|
|
171
|
-
function trainingTrajectoryDigest(trajectory) {
|
|
172
|
-
return (0, canonical_hash_1.canonicalJsonDigest)(trajectory);
|
|
173
|
-
}
|
|
174
|
-
function cognitiveDatasetManifestDigest(manifest) {
|
|
175
|
-
return (0, canonical_hash_1.canonicalJsonDigest)(manifest);
|
|
176
|
-
}
|
|
177
|
-
//# sourceMappingURL=training-evidence.schemas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"training-evidence.schemas.js","sourceRoot":"","sources":["../../src/ai-employee-cognition/training-evidence.schemas.ts"],"names":[],"mappings":";;;AAmGA,0EAoBC;AAED,0DAqBC;AAED,0CAUC;AAED,gEA2CC;AAED,4DAIC;AAED,wEAIC;AA9MD,8EAAgF;AAChF,yEAGoC;AAGvB,QAAA,wBAAwB,GAAoB;IACvD,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,2CAA2C;IAChD,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE;QACR,eAAe;QACf,cAAc;QACd,aAAa;QACb,iBAAiB;QACjB,qBAAqB;QACrB,cAAc;QACd,oBAAoB;QACpB,OAAO;QACP,aAAa;QACb,eAAe;QACf,SAAS;QACT,WAAW;QACX,eAAe;QACf,cAAc;QACd,OAAO;QACP,eAAe;QACf,QAAQ;KACT;IACD,UAAU,EAAE;QACV,aAAa,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE;QAClD,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QAC9C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QAC7C,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACnC,mBAAmB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACtC,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QAC/B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtC,KAAK,EAAE;YACL,IAAI,EAAE;gBACJ,UAAU;gBACV,UAAU;gBACV,SAAS;gBACT,mBAAmB;gBACnB,iBAAiB;aAClB;SACF;QACD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;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Q,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAC9B,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CACjC,OAAO,CAAC,OAAO,KAAK,SAAS;YAC7B,OAAO,CAAC,KAAK,KAAK,SAAS;YAC3B,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,EACnC,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,kCAAkC;YACxC,QAAQ,EAAE,WAAW;YACrB,OAAO,EAAE,sDAAsD;SAChE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC,MAAM;QAClB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;QAC1B,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC;AAED,SAAgB,wBAAwB,CACtC,UAAgD;IAEhD,OAAO,IAAA,oCAAmB,EAAC,UAAmB,CAAC,CAAC;AAClD,CAAC;AAED,SAAgB,8BAA8B,CAC5C,QAAoD;IAEpD,OAAO,IAAA,oCAAmB,EAAC,QAAiB,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { TypedEvidenceRefV1, VersionedRefV1 } from './cognitive-policy.types';
|
|
2
|
-
import type { Sha256Digest } from '../agent-executable-assets/canonical-hash';
|
|
3
|
-
export interface TrainingTrajectoryV1 {
|
|
4
|
-
schemaVersion: 'training-trajectory/v1';
|
|
5
|
-
trajectoryId: string;
|
|
6
|
-
workspaceId: string;
|
|
7
|
-
goalSnapshotRef: VersionedRefV1;
|
|
8
|
-
contextManifestRefs: VersionedRefV1[];
|
|
9
|
-
sequenceRefs: TypedEvidenceRefV1[];
|
|
10
|
-
correctionRef?: TypedEvidenceRefV1;
|
|
11
|
-
finalEvaluationRef: VersionedRefV1;
|
|
12
|
-
label: 'positive' | 'negative' | 'partial' | 'no_action_correct' | 'human_corrected';
|
|
13
|
-
scoreVector: Record<string, number>;
|
|
14
|
-
lineageDigest: Sha256Digest;
|
|
15
|
-
consent: {
|
|
16
|
-
status: 'allowed' | 'blocked';
|
|
17
|
-
policyVersion: string;
|
|
18
|
-
};
|
|
19
|
-
piiStatus: 'redacted' | 'blocked';
|
|
20
|
-
retentionTier: string;
|
|
21
|
-
leakageGroup: string;
|
|
22
|
-
split: 'train' | 'validation' | 'test' | 'holdout';
|
|
23
|
-
multimodalEvidenceRefs?: TypedEvidenceRefV1[];
|
|
24
|
-
qualityStatus: 'candidate' | 'approved' | 'rejected';
|
|
25
|
-
digest: Sha256Digest;
|
|
26
|
-
}
|
|
27
|
-
export interface CognitiveDatasetManifestV1 {
|
|
28
|
-
schemaVersion: 'cognitive-dataset-manifest/v1';
|
|
29
|
-
datasetId: string;
|
|
30
|
-
version: string;
|
|
31
|
-
purpose: 'sft' | 'preference' | 'value' | 'evaluation';
|
|
32
|
-
exampleRefs: VersionedRefV1[];
|
|
33
|
-
splitPolicyDigest: Sha256Digest;
|
|
34
|
-
sourceQueryDigest: Sha256Digest;
|
|
35
|
-
consentPolicyVersion: string;
|
|
36
|
-
createdBy: string;
|
|
37
|
-
approvedBy?: string;
|
|
38
|
-
digest: Sha256Digest;
|
|
39
|
-
}
|
|
40
|
-
export type DatasetEligibilityV1 = 'draft' | 'blocked' | 'ready_for_review' | 'approved';
|
|
41
|
-
export interface TeacherEvidenceRefV1 {
|
|
42
|
-
schemaVersion: 'teacher-evidence-ref/v1';
|
|
43
|
-
evidenceId: string;
|
|
44
|
-
modality: 'screen_video' | 'meeting_video' | 'audio' | 'transcript' | 'document';
|
|
45
|
-
contentDocumentId: string;
|
|
46
|
-
contentVersionId: string;
|
|
47
|
-
contentDigest: Sha256Digest;
|
|
48
|
-
segments: Array<{
|
|
49
|
-
startMs?: number;
|
|
50
|
-
endMs?: number;
|
|
51
|
-
transcriptChunkRef?: VersionedRefV1;
|
|
52
|
-
speakerRole?: string;
|
|
53
|
-
annotationRefs: VersionedRefV1[];
|
|
54
|
-
}>;
|
|
55
|
-
purpose: 'demonstration' | 'correction' | 'preference_pair' | 'evaluation_evidence';
|
|
56
|
-
consent: {
|
|
57
|
-
status: 'allowed' | 'blocked';
|
|
58
|
-
policyVersion: string;
|
|
59
|
-
capturedAt?: string;
|
|
60
|
-
};
|
|
61
|
-
piiStatus: 'redacted' | 'blocked';
|
|
62
|
-
annotationStatus: 'machine_candidate' | 'human_reviewed' | 'approved';
|
|
63
|
-
extractionModelVersion?: string;
|
|
64
|
-
retentionTier: string;
|
|
65
|
-
digest: Sha256Digest;
|
|
66
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"training-evidence.types.js","sourceRoot":"","sources":["../../src/ai-employee-cognition/training-evidence.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared agent-runtime remediation contracts.
|
|
3
|
-
*
|
|
4
|
-
* Owner of the generic deployment/routing/candidate/lineage types that close
|
|
5
|
-
* the runtime blockers in `ai-employee-runtime-blocker-remediation-v1` (design
|
|
6
|
-
* §5.1 / task 0.2).
|
|
7
|
-
*
|
|
8
|
-
* Boundary rule (task 0.2):
|
|
9
|
-
* - `AgentPrincipalContext` / `DataScopeRule` are NOT mirrored here — they
|
|
10
|
-
* reuse the existing AgentRuntime contract in the backend
|
|
11
|
-
* (`agent-runtime/interfaces`, `data-sharing/services/data-visibility`).
|
|
12
|
-
* - executable descriptor / release / evidence / snapshot contracts are owned
|
|
13
|
-
* by `agent-executable-assets` (Phase 1 of the executable-asset spec) and are
|
|
14
|
-
* never copied into this directory.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Auth-bound deployment request context (remediation design §5.1, R-01).
|
|
18
|
-
*
|
|
19
|
-
* `workspaceId` MUST be resolved from the authenticated/token context — never
|
|
20
|
-
* trusted from a request argument. A request may carry a `targetWorkspaceId`,
|
|
21
|
-
* but it is only used as an equality assertion against this context.
|
|
22
|
-
*
|
|
23
|
-
* Production user entries MUST NOT produce `actorType: 'service-account'` or
|
|
24
|
-
* an `actorId === 'system'` anonymous fallback; system jobs use an explicit
|
|
25
|
-
* service-account provenance instead.
|
|
26
|
-
*/
|
|
27
|
-
export interface DeploymentRequestContext {
|
|
28
|
-
readonly workspaceId: string;
|
|
29
|
-
readonly actorType: 'user' | 'service-account';
|
|
30
|
-
readonly actorId: string;
|
|
31
|
-
readonly capabilities: ReadonlyArray<string>;
|
|
32
|
-
readonly requestId: string;
|
|
33
|
-
readonly source: 'graphql' | 'cli' | 'system-job';
|
|
34
|
-
}
|
|
35
|
-
/** Capability prefixes used by the deployment authorization matrix (R-01.2). */
|
|
36
|
-
export declare const DEPLOYMENT_CAPABILITY: {
|
|
37
|
-
/** validate / dry-run. */
|
|
38
|
-
readonly read: "ai.manage:read";
|
|
39
|
-
/** install. */
|
|
40
|
-
readonly create: "ai.manage:create";
|
|
41
|
-
/** force-adopt. */
|
|
42
|
-
readonly update: "ai.manage:update";
|
|
43
|
-
/** activate / rollback. */
|
|
44
|
-
readonly publish: "ai.manage:publish";
|
|
45
|
-
};
|
|
46
|
-
export type DeploymentCapability = (typeof DEPLOYMENT_CAPABILITY)[keyof typeof DEPLOYMENT_CAPABILITY];
|
|
47
|
-
/**
|
|
48
|
-
* Assert that a resolved deployment context actually carries the capability an
|
|
49
|
-
* operation requires. Pure helper — the real permission guard lives in the
|
|
50
|
-
* backend `PermissionGuard`; this is the shared contract surface used by both
|
|
51
|
-
* the guard and CLI parity checks.
|
|
52
|
-
*/
|
|
53
|
-
export declare function assertDeploymentCapability(ctx: DeploymentRequestContext, required: DeploymentCapability): void;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Shared agent-runtime remediation contracts.
|
|
4
|
-
*
|
|
5
|
-
* Owner of the generic deployment/routing/candidate/lineage types that close
|
|
6
|
-
* the runtime blockers in `ai-employee-runtime-blocker-remediation-v1` (design
|
|
7
|
-
* §5.1 / task 0.2).
|
|
8
|
-
*
|
|
9
|
-
* Boundary rule (task 0.2):
|
|
10
|
-
* - `AgentPrincipalContext` / `DataScopeRule` are NOT mirrored here — they
|
|
11
|
-
* reuse the existing AgentRuntime contract in the backend
|
|
12
|
-
* (`agent-runtime/interfaces`, `data-sharing/services/data-visibility`).
|
|
13
|
-
* - executable descriptor / release / evidence / snapshot contracts are owned
|
|
14
|
-
* by `agent-executable-assets` (Phase 1 of the executable-asset spec) and are
|
|
15
|
-
* never copied into this directory.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.DEPLOYMENT_CAPABILITY = void 0;
|
|
19
|
-
exports.assertDeploymentCapability = assertDeploymentCapability;
|
|
20
|
-
/** Capability prefixes used by the deployment authorization matrix (R-01.2). */
|
|
21
|
-
exports.DEPLOYMENT_CAPABILITY = {
|
|
22
|
-
/** validate / dry-run. */
|
|
23
|
-
read: 'ai.manage:read',
|
|
24
|
-
/** install. */
|
|
25
|
-
create: 'ai.manage:create',
|
|
26
|
-
/** force-adopt. */
|
|
27
|
-
update: 'ai.manage:update',
|
|
28
|
-
/** activate / rollback. */
|
|
29
|
-
publish: 'ai.manage:publish',
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Assert that a resolved deployment context actually carries the capability an
|
|
33
|
-
* operation requires. Pure helper — the real permission guard lives in the
|
|
34
|
-
* backend `PermissionGuard`; this is the shared contract surface used by both
|
|
35
|
-
* the guard and CLI parity checks.
|
|
36
|
-
*/
|
|
37
|
-
function assertDeploymentCapability(ctx, required) {
|
|
38
|
-
if (!ctx.capabilities.includes(required)) {
|
|
39
|
-
throw new Error(`CAPABILITY_FORBIDDEN: deployment context lacks ${required}`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai-employee-runtime/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA0CH,gEASC;AA7BD,gFAAgF;AACnE,QAAA,qBAAqB,GAAG;IACnC,0BAA0B;IAC1B,IAAI,EAAE,gBAAgB;IACtB,eAAe;IACf,MAAM,EAAE,kBAAkB;IAC1B,mBAAmB;IACnB,MAAM,EAAE,kBAAkB;IAC1B,2BAA2B;IAC3B,OAAO,EAAE,mBAAmB;CACpB,CAAC;AAIX;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,GAA6B,EAC7B,QAA8B;IAE9B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,kDAAkD,QAAQ,EAAE,CAC7D,CAAC;IACJ,CAAC;AACH,CAAC"}
|